VMware ESXi and vSphere Cluster Management

Install Ubuntu in Oracle VirtualBox

Learn how to create an Ubuntu virtual machine in Oracle VirtualBox, attach an Ubuntu ISO, complete installation, and configure Guest Additions.

Oracle VirtualBox lets you run another operating system inside a window on your existing computer. This guide explains how to create an Ubuntu virtual machine (VM), install Ubuntu from an ISO image, validate the installation, and improve desktop integration with Guest Additions.

How Ubuntu virtualization works

Oracle VirtualBox is desktop virtualization software. It acts as a hosted hypervisor: it runs on top of an existing operating system and provides software-defined hardware to virtual machines.

The host operating system is the operating system installed directly on the physical computer. The guest operating system is the system installed inside the VM. In this guide, the host could be Windows, macOS, or Linux, while Ubuntu is the guest.

A VM behaves like a separate computer with virtual RAM, virtual CPUs, a virtual hard disk, a virtual optical drive, and network hardware. An Ubuntu ISO image is a disk-image file containing bootable installation media. When attached to the VM's virtual optical drive, it behaves like an Ubuntu installation DVD or USB device.

Prerequisites

  • Install Oracle VirtualBox on the host computer.
  • Download an Ubuntu Desktop ISO that matches your needs.
  • Confirm that the host has enough unused RAM and disk space for both the host and the VM.
  • Make sure hardware virtualization is available. If VirtualBox reports that it is unavailable, enable Intel VT-x or AMD-V in the computer's BIOS or UEFI when supported.
  • Know where the ISO file is stored so it can be selected later.

Selecting the Ubuntu release and architecture

Use an Ubuntu release suitable for your course, applications, or support requirements. The desktop ISO must also match the host computer's supported CPU architecture. Most current desktop computers use 64-bit x86 architecture, commonly shown as amd64. ARM-based computers may require an ARM-compatible image and virtualization setup.

Choosing the wrong release or architecture can prevent the VM from booting, limit available software, or produce poor compatibility. Also check the ISO's download integrity when the Ubuntu distribution provides verification information.

Create the virtual machine

  1. Open VirtualBox Manager.
  2. Select New to start the virtual machine creation workflow.
  3. Enter a recognizable name, such as Ubuntu Desktop Lab or a name containing the intended release.
  4. Choose Linux as the operating system family and Ubuntu as the version or subtype when available.
  5. Choose the folder where VirtualBox should store the VM files.
  6. Continue to memory, processor, and virtual disk configuration.

The VM name identifies the machine in VirtualBox Manager. VM settings describe its virtual hardware and startup behavior. The associated files, including the virtual disk, are stored on the host at the selected location. Changing a name in the manager does not necessarily rename every file, so manage the VM through VirtualBox rather than moving individual files while it is running.

Allocate virtual hardware

RAM

RAM allocation is the amount of host memory reserved for the VM while it runs. Ubuntu Desktop needs enough memory for the desktop, updates, and applications, but the host also needs memory to remain responsive. A practical starting point is a moderate allocation such as 4 GB when the host has sufficient memory. Increase it only when the host can spare it.

Virtual CPUs

A virtual CPU is a host processor execution resource presented to Ubuntu as a processor. One or two virtual CPUs may be enough for basic tasks. More virtual CPUs can improve compilation or multitasking, but assigning too many can reduce host responsiveness. Keep some processing capacity available to the host.

Depending on the VirtualBox version, processor settings appear during VM creation or under the VM's settings. In general, change RAM and processor settings only while the VM is powered off.

SettingPurposeTypical selection considerationsCan be changed later

VM name — Identifies the VM — Use a recognizable name — Yes, usually through VirtualBox

Operating system type and version — Helps VirtualBox choose defaults — Select Linux and Ubuntu — Yes

RAM — Memory available to Ubuntu — Balance guest performance with host responsiveness — Yes, while powered off

Virtual CPUs — Processing resources presented to Ubuntu — Assign a small number appropriate to the host — Yes, while powered off

Virtual disk format — Defines the virtual disk file format — Select VDI for a native VirtualBox disk — Usually, with migration considerations

Disk allocation type — Controls how host storage is provisioned — Dynamic saves space initially; fixed reserves space — Usually not directly; recreate or clone if needed

Maximum virtual disk capacity — Sets the guest disk limit — Allow room for Ubuntu, updates, applications, and files — Often adjustable with disk-management procedures

ISO attachment — Supplies bootable installation media — Mount the Ubuntu ISO during installation — Yes

Create the virtual hard disk

A virtual hard disk is a file, or group of files, on the host that Ubuntu sees as an internal disk. It is not the same as a physical disk installed in the host.

  1. Choose to create a new virtual hard disk.
  2. Select VDI, which means VirtualBox Disk Image, as the disk format.
  3. Choose either dynamically allocated or fixed-size storage.
  4. Set the disk filename and storage location.
  5. Set the maximum capacity. Leave enough space for Ubuntu, updates, applications, and user data.

CharacteristicDynamically allocatedFixed-size

Initial host disk usage — Starts small and grows as data is written — Reserves the configured capacity immediately

Maximum guest capacity — The configured maximum — The configured maximum

Creation time — Usually shorter — Usually longer because space is reserved

Host storage planning — Requires monitoring future growth — Requires the full capacity to be available at creation

Suitable use cases — General labs and storage conservation — Predictable allocation and hosts with ample free space

Dynamic allocation does not remove the need for free host storage. If the file grows until the host disk is full, Ubuntu and the host can both become unstable. A virtual disk can be copied or moved to another compatible VirtualBox installation, but the VM should be shut down first and all associated files should be kept together. VirtualBox export and import can simplify migration.

Attach the Ubuntu ISO

  1. Open the new VM's storage settings, or use the startup-media selection shown by your VirtualBox version.
  2. Select the virtual optical drive.
  3. Choose the downloaded Ubuntu ISO.
  4. Confirm that the ISO is mounted in the virtual optical drive.
  5. Check the VM's boot order, which is the sequence of devices checked at startup. Place the optical drive before the empty virtual hard disk for the initial installation.

The ISO acts like a bootable DVD or USB installer. It is read by the VM, not by the host as an ordinary application.

Run the Ubuntu installer

  1. Start the VM. It should boot from the attached ISO.
  2. Choose the language and continue to the Ubuntu desktop installer.
  3. Select the keyboard layout and test the layout if the installer offers that option.
  4. Configure network access if available. The installer may download updates or use network services during setup.
  5. Choose the normal or minimal installation and select optional third-party software according to your needs and the choices presented by the Ubuntu release.
  6. When asked for the installation destination, select the VM's virtual disk. The disk should appear as the empty disk created in VirtualBox.
  7. Review the disk changes carefully before confirming. Never select a host disk.
  8. Enter a computer name, create the Ubuntu user account, and choose a strong password.
  9. Allow the installer to copy files and configure the guest system.
  10. When installation finishes, reboot the VM.
  11. Remove or detach the Ubuntu ISO when prompted, or eject it from the virtual optical drive before the next boot.

Validate the first boot

After the reboot, Ubuntu should start from the installed virtual disk rather than from the ISO. Sign in with the account created during installation and check the following:

  • The Ubuntu desktop opens and responds to mouse and keyboard input.
  • The display resolution is usable and the desktop can be resized if the current integration supports it.
  • The VM has network access when networking is required.
  • Ubuntu reports the expected memory and processor resources.
  • The virtual disk has enough available storage for updates and applications.

Apply Ubuntu updates after the first successful boot using the desktop's software-update tools. Updating improves security and may resolve compatibility issues before you install additional software.

Install VirtualBox Guest Additions

Guest Additions are VirtualBox drivers and guest software installed inside Ubuntu. They improve host-guest integration, including display resizing, pointer behavior, shared clipboard support, drag and drop where supported, shared folders, and other usability features.

  1. Start Ubuntu and sign in.
  2. Use the VirtualBox window menu to insert the Guest Additions virtual CD.
  3. Open the inserted disc inside Ubuntu and run its installer, following the instructions for the Ubuntu and VirtualBox versions in use.
  4. Allow any required packages or build steps to complete.
  5. Restart Ubuntu when requested.
  6. After the restart, enable features such as shared clipboard, drag and drop, or shared folders in the VM settings if needed.

Guest Additions may require build tools, kernel headers, or a matching kernel module. Requirements vary by Ubuntu and VirtualBox version. If installation reports a build error, update Ubuntu, confirm that the required development packages and kernel headers are available, and rerun the installer. A restart is commonly required before the drivers become active.

Troubleshooting

SymptomLikely causeCorrective action

VM does not boot installer — ISO is not attached, ISO is invalid, or the hard disk comes first in boot order — Mount the correct ISO, obtain a valid copy if necessary, and put the optical drive first during installation

Black screen or virtualization error — Hardware virtualization is disabled, or another host virtualization platform is using the feature — Enable Intel VT-x or AMD-V in BIOS or UEFI when supported; review host virtualization conflicts and restart the host after changes

Ubuntu installer cannot access the intended disk — No virtual disk is attached or the storage controller is misconfigured — Power off the VM, confirm that a VDI is connected, and create or attach one if missing

VM is slow or unresponsive — Too little RAM or CPU, host resource pressure, or slow or nearly full storage — Power off the VM and increase resources within safe limits, close host applications, or free and improve host storage

Installer reopens after reboot — The ISO remains mounted and is still first in the boot order — Eject or detach the ISO and ensure the virtual hard disk has priority

Display resolution is limited — Guest Additions are missing or not functioning — Install or repair Guest Additions, restart Ubuntu, and enable automatic display resizing where supported

Key points to remember

  • VirtualBox is the virtualization program; Ubuntu is the guest operating system.
  • The Ubuntu ISO is temporary bootable installation media.
  • The VDI virtual disk is a host-side file presented to Ubuntu as an internal disk.
  • Dynamic disks grow as needed, while fixed-size disks reserve their capacity at creation.
  • Balance VM RAM and virtual CPUs with the host's available resources.
  • Detach the ISO after installation so the VM boots from its virtual hard disk.
  • Install updates and Guest Additions after confirming the first successful boot.

For a related walkthrough, see Install Ubuntu 2.