Infrastructure

How to Install VirtualBox and Create an Ubuntu Virtual Machine

Learn how to install VirtualBox and create your first Ubuntu virtual machine with this step-by-step tutorial covering installation, configuration, and guest additions.

By Inventive HQ Team

Installing Oracle VirtualBox and creating an Ubuntu virtual machine takes four stages: download and install VirtualBox from virtualbox.org, click New to create a VM and point it at your Ubuntu ISO, allocate at least 4 GB of RAM and a dynamically allocated virtual disk, then start the VM to boot the installer. On VirtualBox 7.x you can let the built-in Unattended Installation feature detect Ubuntu from the ISO and install it — and Guest Additions — automatically, so the whole thing is largely hands-off. The entire toolchain is free and open source, and the workflow is identical on Windows, macOS, and Linux hosts.

That's the summary an AI would give you. Here's what it can't show you — the actual decision points where beginners get stuck (Dynamic vs Fixed disk, VDI vs VMDK, how much RAM is "too much"), the animated map of how the pieces fit together, and a symptom → cause → fix table for the errors that stop people cold (the dreaded "32-bit only" dropdown, VT-x disabled in BIOS, no network). Everything below is the current VirtualBox 7.x workflow, not the decade-old wizard.

Note: This tutorial was originally migrated from an older site that referenced Ubuntu 10.10 and VirtualBox's early multi-page wizard. The steps have been updated to the current VirtualBox 7.x single-screen "Create Virtual Machine" flow. The concepts are unchanged; only the number of clicks got smaller.

The whole process at a glance

VirtualBox to Ubuntu VM workflow Four stages flow left to right: install VirtualBox, create the VM, configure RAM and disk, then boot and install Ubuntu. A packet animates along the path. From download to a running Ubuntu desktop 1 Install VirtualBox Download from virtualbox.org Run installer, accept defaults 2 Create the VM Click New, name it, select the Ubuntu ISO auto-detects OS 3 Size resources 4096 MB RAM, 2+ CPUs, 25 GB dynamic stay in green zone 4 Boot & install Click Start, Ubuntu installs, add Guest Additions A first Ubuntu VM is usually 15–25 minutes end to end

VirtualBox is a Type 2 (hosted) hypervisor: it runs as an ordinary application on top of your existing operating system rather than on bare metal. That is exactly what makes it perfect for learning and testing — you install one program and you can spin up throwaway Linux, Windows, or BSD machines that are fully isolated from your real system. It is open source (GPLv3) and runs on Linux, macOS, Windows, and Solaris hosts.

To get a copy, go to virtualbox.org and grab the package for your host OS. While you are there, download the Ubuntu Desktop ISO from ubuntu.com/download — you'll point the VM at that file in step 2.

Step 1 — Installing VirtualBox

The installer is a straightforward next-next-finish affair. The one screen that surprises people is the network warning.

  • Download VirtualBox for your host OS from virtualbox.org.
  • Double-click the installer.
  • Click Next, accept the licence agreement, click Next again.
  • Leave the default components selected (all are useful) and click Next.
  • You'll get a warning that installation will briefly reset your network connection — this is normal, because VirtualBox installs a virtual network adapter. Close any downloads or VPN sessions first, then click Yes.
  • Click Install. This takes a minute or two. On Windows you may be prompted to trust the "Oracle" device software; approve it, or the virtual network won't work.
  • Leave "Start Oracle VirtualBox after installation" ticked and click Finish.

VirtualBox launches to the VirtualBox Manager — an empty list on the left where your VMs will live, with a big New button in the toolbar.

Advertisement

Step 2 — Creating your first virtual machine

Modern VirtualBox collapsed the old multi-page wizard into a single screen. Here's the current flow:

  1. Click New in the toolbar.
  2. Give the VM a Name (e.g. Ubuntu-Test). VirtualBox auto-fills a folder for it.
  3. Under ISO Image, click the dropdown and browse to your downloaded Ubuntu ISO. VirtualBox reads the ISO and auto-detects the Type = Linux and Version = Ubuntu (64-bit) for you.
  4. Decision point — Unattended Install: if VirtualBox recognizes the ISO, it offers to install Ubuntu automatically. Leave it enabled and fill in a username, password, and hostname to have it install Ubuntu and Guest Additions with zero clicking. Tick "Skip Unattended Installation" instead if you want to drive the Ubuntu installer manually (useful for custom partitioning).
  5. On the Hardware step, set Base Memory to at least 4096 MB and Processors to 2. Watch the colour bar — keep the marker in the green zone (see the RAM guidance below).
  6. On the Hard Disk step, choose Create a Virtual Hard Disk Now, set the size to 25 GB or more, and leave the format on VDI.
  7. Click Finish.

How much memory (and why the slider is colour-coded)

The number you set is a ceiling, not a reservation — the VM only uses what it needs, up to that limit. But over-allocating starves the host. VirtualBox's slider turns amber then red as you approach and exceed a safe fraction of physical RAM.

Your host RAMSafe Ubuntu Desktop RAMNotes
8 GB2048–3072 MBTight — close other apps while the VM runs
16 GB4096 MBThe comfortable sweet spot
32 GB+8192 MBSmooth even with a browser and IDE inside the VM

Rule of thumb: keep the total RAM of all running VMs under ~50% of physical memory so the host OS keeps enough for itself.

Dynamic vs Fixed disk, and which format to pick

Two choices trip up beginners on the disk step. Here's the straight answer for each:

OptionWhat it doesPerformanceSpace used up frontPick this when
Dynamically allocatedGrows on the host only as the guest writes dataSlightly slower on heavy writesNearly zeroAlmost always — the sane default
Fixed sizeReserves the full size immediatelyMarginally fasterThe whole disk (e.g. 25 GB)Disk-heavy DB workloads on spinning rust
VDI formatVirtualBox's native diskNativeDefault — you're staying in VirtualBox
VHD formatMicrosoft's format (Hyper-V, Azure)NativeYou'll move the disk to Hyper-V/Azure
VMDK formatVMware's formatNativeYou'll move the disk to VMware/ESXi

Which should I use? For a first Ubuntu VM: Dynamically allocated + VDI. On a modern SSD the fixed-size performance edge is negligible, and dynamic disks keep your host storage tidy.

Step 3 — Powering on and installing Ubuntu

  1. Select your VM in the list and click Start.
  2. A console window opens. If you left Unattended Installation on, sit back — Ubuntu installs itself, reboots, and lands at the login screen with the credentials you entered.
  3. If you skipped unattended install, the VM boots off the ISO into the Ubuntu installer. Choose Install Ubuntu, and when it asks about disks, "Erase disk and install Ubuntu" is safe — it only touches the virtual 25 GB disk, never your real drive.
  4. Set your keyboard, timezone, username, and password; let it copy files (a few minutes), then Remove installation medium and reboot when prompted.

If VirtualBox doesn't auto-eject the ISO on reboot, remove it from Settings → Storage while the VM is off, or just press Enter at the "please remove medium" prompt.

Step 4 — Install Guest Additions (don't skip this)

A fresh Ubuntu VM works, but it's stuck at a small resolution with no clipboard sharing. Guest Additions fixes that by installing paravirtualized drivers inside the guest.

  1. With the VM running and Ubuntu logged in, open the VirtualBox window's Devices menu → Insert Guest Additions CD image.
  2. Ubuntu mounts a virtual CD. Open a terminal in that folder (or let the autorun prompt do it) and run the installer; enter your password when asked.
  3. Reboot the VM. You'll now get automatic window resizing, a shared clipboard, drag-and-drop, and much smoother graphics.

Then enable the conveniences under Devices: Shared Clipboard → Bidirectional and Drag and Drop → Bidirectional.

When it doesn't work: symptom → cause → fix

The errors below account for the vast majority of "VirtualBox won't work" support threads.

SymptomLikely causeFix
OS dropdown shows only 32-bit optionsHardware virtualization (VT-x / AMD-V) disabledReboot into BIOS/UEFI, enable Intel VT-x or AMD SVM; on Windows disable Hyper-V/WSL2/Core Isolation
"VT-x is disabled in the BIOS" on startSame as above, or nested virtualization offEnable virtualization in BIOS/UEFI; if in a cloud/VM, enable nested virtualization
VM won't start, "kernel driver not installed" (Windows)VirtualBox network/USB driver blockedReinstall and approve the Oracle device-software prompt; disable conflicting hypervisors
Same error on a Linux hostSecure Boot blocked the unsigned vboxdrv moduleSign the module for Secure Boot, or disable Secure Boot; run sudo /sbin/vboxconfig
Screen stuck at 640×480, no resizeGuest Additions not installedInstall Guest Additions (Step 4) and reboot
No internet inside the VMNetwork adapter disabled, or wrong modeSettings → Network → tick Enable Network Adapter; leave on NAT for basic internet
Black screen / very slow graphicsToo little video memory or bad 3D accelSettings → Display → raise Video Memory to 128 MB; toggle 3D Acceleration
Install disk full mid-installVirtual disk too smallPower off; File → Tools → Virtual Media Manager to resize, then extend the partition in Ubuntu

Quick pre-flight checklist

Before you click Start, confirm:

  • Virtualization (VT-x / AMD-V) enabled in BIOS/UEFI
  • Ubuntu ISO downloaded and selected in the VM
  • RAM in the green zone (4096 MB on a 16 GB host)
  • 2+ CPUs assigned
  • Disk set to Dynamically allocated, VDI, 25 GB+
  • On Windows: Hyper-V / WSL2 / Core Isolation disabled if the 64-bit options are missing
  • Plan to install Guest Additions after first boot

Next steps

Once your Ubuntu VM is running, the features that make VirtualBox genuinely useful are:

  • Snapshots — before any risky change, take a snapshot (Machine → Take Snapshot). If something breaks, roll back in seconds. This alone makes VMs the safest place to experiment.
  • Shared folders — mount a host directory inside the guest to move files without a network share.
  • Clones — duplicate a configured VM (linked or full clone) to spin up a fresh copy instantly.
  • Networking modes — graduate from NAT to Bridged when you need the VM reachable on your LAN, or a Host-only network to build an isolated multi-VM lab.

Virtual machines are the safest way to test new software, learn a new operating system, or build an isolated development environment — all without risking your main system. When you outgrow desktop virtualization and want to run VMs on a dedicated Linux host, the natural next step is KVM on Ubuntu or scripting VM creation with virt-install and cloud-init.

Frequently Asked Questions

Is VirtualBox free to use?

Yes. Oracle VirtualBox is free and open source under the GPLv3 for the base package. The separate Extension Pack (which adds USB 3.0, disk encryption, and RDP) is free for personal, educational, and evaluation use but requires a commercial licence for business use. The base hypervisor alone is enough to run an Ubuntu VM, so you can complete this entire tutorial at no cost.

How much RAM should I give an Ubuntu virtual machine?

For Ubuntu Desktop, allocate 4 GB (4096 MB) as a comfortable minimum and 8 GB if you have it to spare; Ubuntu Server runs fine on 2 GB. VirtualBox colour-codes the memory slider green, amber, and red — keep the pointer in the green zone, which generally means staying under about 50% of your host's physical RAM so the host OS keeps enough for itself. The number you set is a ceiling, not a reservation.

Should I choose a dynamically allocated or fixed-size disk?

Choose dynamically allocated for almost every case. It only consumes host disk space as the guest actually writes data, so an "80 GB" VM might occupy just a few GB on day one. Fixed-size grabs the whole amount up front and gives a small, marginal performance edge that matters mostly for disk-heavy databases. On modern SSDs the difference is negligible, so default to dynamic.

Why does VirtualBox only show 32-bit options for the guest OS?

This almost always means hardware virtualization (Intel VT-x or AMD-V) is disabled or unavailable. Reboot into your BIOS/UEFI and enable "Intel Virtualization Technology / VT-x" or "SVM Mode". On Windows hosts, an active Hyper-V, WSL2, or Memory Integrity (Core Isolation) feature can also monopolise the virtualization layer and force VirtualBox into 32-bit-only mode — disable those or use the newer Windows Hypervisor Platform backend.

What is the difference between VDI, VHD, and VMDK disk formats?

VDI is VirtualBox's native format and the right default. VHD is Microsoft's format (used by Hyper-V and Azure) and VMDK is VMware's — pick those only if you plan to move the disk to that platform. All three work identically inside VirtualBox for a basic Ubuntu VM, so leave it on VDI unless you have a portability reason.

Do I need to install Guest Additions?

It is optional but strongly recommended. Guest Additions installs paravirtualized drivers that unlock automatic screen resizing, a shared clipboard, drag-and-drop, shared folders, and much smoother graphics. Without it the VM works but feels sluggish and is stuck at a small fixed resolution. Install it from the running VM's Devices menu with "Insert Guest Additions CD image".

Can I use VirtualBox's Unattended Installation to skip the Ubuntu setup wizard?

Yes. VirtualBox 7.x can fully automate the Ubuntu install. When you create the VM, point the wizard at the Ubuntu ISO and it detects the OS, then lets you enter a username, password, and hostname. It installs Ubuntu and Guest Additions unattended while you wait — no clicking through the Ubuntu installer at all. Untick "Skip Unattended Installation" if you would rather drive the installer manually.

How many virtual machines can I run at once?

As many as your host RAM and CPU cores allow. Each running VM consumes the memory you assigned it plus a small overhead, and shares CPU cores with the host. A practical rule is to keep the sum of all running VMs' RAM under about 50–60% of physical memory. VMs that are powered off consume only disk space, not RAM.

Why does my Ubuntu VM have no internet access?

By default VirtualBox uses NAT networking, which gives the guest outbound internet but hides it from the host network — this is correct for most users and usually "just works". If it fails, check that the virtual network adapter is enabled (Settings → Network → Adapter 1 → "Enable Network Adapter"). Switch to Bridged Adapter only if you need the VM to appear as a real device with its own IP on your LAN.

virtualboxubuntuvirtual machinevirtualizationtutorial