How to Run Ubuntu Server on VirtualBox – Step-by-Step Guide (2025)


Looking to create a virtual Ubuntu Server environment on your Windows or macOS machine? Using VirtualBox is one of the easiest and most efficient ways to do it — especially for developers, system admins, and students experimenting with Linux.
This guide walks you through the entire process of downloading, installing, and running Ubuntu Server on Oracle VM VirtualBox.
🧰 What You’ll Need
Before we begin, make sure you have the following:
Oracle VirtualBox – Free virtualization software
Download: https://www.virtualbox.orgUbuntu Server ISO – Headless version of Ubuntu (no GUI)
Download: https://ubuntu.com/download/serverAt least 2 GB RAM and 10 GB free disk space
Basic knowledge of Linux terminal (helpful, not mandatory)
🛠️ Step-by-Step Installation
Step 1: Install VirtualBox
Download VirtualBox from https://www.virtualbox.org
Run the installer and complete setup using default settings
Launch VirtualBox
Step 2: Download Ubuntu Server ISO
Choose the latest LTS version (e.g., Ubuntu Server 24.04 LTS)
Download the .iso file (around 1 GB)
Step 3: Create a New Virtual Machine
Open VirtualBox and click New
Set the name (e.g., UbuntuServer)
Type: Linux
Version: Ubuntu (64-bit)Click Next
Step 4: Assign Memory
Allocate 2048 MB (2 GB) or more
Click Next
Step 5: Create Virtual Hard Disk
Choose Create a virtual hard disk now
Select VDI (VirtualBox Disk Image)
Choose Dynamically allocated
Set size: 20 GB or more
Click Create
Step 6: Attach Ubuntu ISO
Select the new VM → Click Settings
Go to Storage
Under Controller: IDE, click the empty disk icon
Click the disk icon on the right → Choose a disk file
Browse and select the downloaded Ubuntu Server .iso
Click OK.
Step 7: Start the Virtual Machine
Click Start
Ubuntu Server installer will boot from ISO
Step 8: Install Ubuntu Server
Choose language and keyboard layout
Select Install Ubuntu Server
Configure network (use DHCP if unsure)
Set hostname, username, and password
Configure storage (select guided installation)
Optional: Install OpenSSH server for remote access
Wait for the installation to complete
Finally, reboot the system when prompted. You now have Ubuntu Server running!
🔧 Post-Installation Tips
Once installed, you’ll be greeted with a terminal login screen. From here you can:
Run sudo apt update && sudo apt upgrade to update packages
Use ip a to find your server’s IP
Install additional tools like nginx, docker, or git
Add shared folders or enable copy-paste in settings (requires Guest Additions)
📡 Optional: Enable SSH Access
To connect from your main system using SSH:
During install, ensure OpenSSH server is selected
Find the VM’s IP using ip a
From host OS (e.g., Windows), use:
ssh username@vm-ip
🧼 How to Shut Down the Server
Inside the server, run
sudo shutdown now
Or to reboot:
nginx
sudo reboot
Avoid closing VirtualBox window without properly shutting down the VM.
✅ Final Thoughts
VirtualBox + Ubuntu Server is a perfect combo for testing, learning, and sandboxing server environments safely on your computer. Whether you’re experimenting with web servers, setting up a home lab, or learning Linux commands — this virtual setup is your go-to tool.
💡 Pro Tip: You can clone this VM later for multiple isolated environments.