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

5/25/20252 min read

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:

  1. Oracle VirtualBox – Free virtualization software
    Download: https://www.virtualbox.org

  2. Ubuntu Server ISO – Headless version of Ubuntu (no GUI)
    Download: https://ubuntu.com/download/server

  3. At least 2 GB RAM and 10 GB free disk space

  4. Basic knowledge of Linux terminal (helpful, not mandatory)

🛠️ Step-by-Step Installation

Step 1: Install VirtualBox

Step 2: Download Ubuntu Server ISO

Step 3: Create a New Virtual Machine

  1. Open VirtualBox and click New

  2. Set the name (e.g., UbuntuServer)

  3. Type: Linux
    Version: Ubuntu (64-bit)

  4. 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

  1. Select the new VM → Click Settings

  2. Go to Storage

  3. Under Controller: IDE, click the empty disk icon

  4. Click the disk icon on the right → Choose a disk file

  5. 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:

  1. During install, ensure OpenSSH server is selected

  2. Find the VM’s IP using ip a

  3. 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.