Thinking about trying out the latest version of Ubuntu? It looks amazing and boasts a host of updates, features, and fixes, as it stands out as the most well-known Linux operating system.

But how do you try Ubuntu without installing it on an old PC or dual booting with your main operating system? The answer is a virtual machine—and you can make one in seconds with the free Oracle VirtualBox.

Here's how to install Ubuntu 22.04 in VirtualBox on Windows, macOS, and Linux.

Why Install Ubuntu in VirtualBox?

You can try Ubuntu or any other Linux operating system (OS) in many ways.

  1. Install it on an old PC
  2. Dual boot with Windows, macOS, or another Linux OS
  3. Install on Windows using the Windows Subsystem for Linux
  4. Run the Live CD version on your PC, which "installs" in the system memory until you reboot
  5. Install Ubuntu on a Raspberry Pi
  6. Install Ubuntu on VirtualBox

This guide explains how to use a virtual machine (VM), a software environment that an operating system sees as a physical PC, to run Ubuntu. It doesn't matter what operating system you have installed on your PC (the "host"); one or more can be installed in a virtual machine. Operating systems installed in a virtual machine are known as "guests."

A virtual machine is the simplest option for trying out Ubuntu and other Linux operating systems.

How to Install Ubuntu in VirtualBox

Creating an Ubuntu VirtualBox machine is straightforward for beginners to follow through.

Five main steps are required to install Ubuntu on your computer in VirtualBox:

  1. Install VirtualBox
  2. Download the Ubuntu ISO file
  3. Configure a virtual machine for a Linux operating system
  4. Boot Ubuntu in the virtual machine
  5. In VirtualBox, install Ubuntu

Apart from these methods, you should also look at a few additional mandatory steps for installing Ubuntu.

1. Install VirtualBox on Your Computer

Start the installation journey by grabbing a copy of VirtualBox and installing it on your computer.

Download: VirtualBox (Free)

VirtualBox is available for Windows, Linux, and macOS. The installation will differ depending on your computer's operating system, so check the detailed instructions on the VirtualBox download page.

Once installed, VirtualBox is ready to create a new virtual machine. Before you do that, however…

2. Download the Ubuntu 22.04 LTS ISO File

You'll need the Ubuntu ISO for VirtualBox to install Ubuntu on your virtual machine. For installation on a computer, you would typically burn the Ubuntu ISO file to a USB drive or a DVD.

Fortunately, on VirtualBox, Ubuntu installation is seamless, as you can use the downloaded ISO.

Various versions of Ubuntu are available. The safest option if you're trying it for the first time is an LTS release. "Long Term Support" means the operating system receives targeted updates for five years after the point of release. It acts as the flagship Ubuntu operating system; if you experience problems, support can be found, and bug fixes issued.

Download: Ubuntu 22.04 LTS

Install a Pre-Configured Ubuntu VirtualBox Disk

The rest of this guide will show you how to install Ubuntu in VirtualBox. It's straightforward but a little intensive and takes a while. You'll learn how to install Ubuntu—but what if you want to get it up and running immediately?

You could try a pre-configured disk image that you can load directly in VirtualBox.

Various operating systems are available as easy-to-use disk images for VirtualBox and VMware at www.osboxes.com. These are available in VDI format, a virtual disk image you can easily load in VirtualBox. Start by downloading the VDI file.

Download: Ubuntu 22.04 LTS VDI disk image

When you're ready, attach it to VirtualBox:

  1. In VirtualBox, click New.
  2. Enter the OS Name and Type, then click Next.
    Open dialog box in VirtualBox to set the VM name and OS details
  3. In the next window, set the username for your virtual machine, along with the password. You can input other relevant details if you like.
    Add user details screen in VirtualBox
  4. Within the Hardware screen, set the Memory size based on the default.
    Set hardware limits screen within VirtualBox
  5. Click Next.
  6. Select Use an existing virtual hard drive file in the Hard drive screen and click on the folder icon.
    Hard disk selector window in VirtualBox
  7. Browse to the downloaded VDI file.
  8. Select the VDI and click Open.
  9. Click on Finish once all configurations are in place.
  10. Select the new virtual machine in the main VirtualBox window and click Settings.
  11. In Display, increase video memory and Enable 3D Acceleration (this can be disabled if the VM fails).
    Display and video settings within VirtualBox
  12. Click OK when you're done.

All you need to do now is select the virtual machine, click Start, and wait for it to load.

3. Configure a VirtualBox Virtual Machine for Ubuntu

If you're installing Ubuntu manually, create and configure the VirtualBox virtual machine while the ISO downloads.

You must get this right, or the Ubuntu 22.04 installation may fail.

  1. In VirtualBox, click New.
  2. Set a Name for the virtual machine (e.g., Ubuntu 22.04).
    Open dialog box in VirtualBox to set the VM name and OS details
    Some configuration fields are grayed out, as they are selected by default when you enter the machine's name.
  3. Click Next.
  4. In the next window, set the username for your virtual machine, along with the password. You can input other relevant details if you would like.
    Add user details screen in VirtualBox
  5. Set the VM's Memory size—aim for around 25 percent of your computer's physical RAM.
    Set hardware limits screen within VirtualBox
  6. Click Next.

You'll need to create a virtual hard disk to run a virtual machine. This is an area of data stored on your computer's storage that is only accessible via the virtual machine.

  1. Select Create a Virtual Disk Now, then Next.
  2. Check the default VDI is selected, then Next.
    Virtual hard disk window in VirtualBox
  3. Check the summary of all your selected options, and click Finish once everything looks fine.

The virtual machine is almost ready to launch. The Settings screen is useful for making some other tweaks. For example, you can alter the number of processors, increase RAM, and more. Remember that the virtual machine's configuration is limited by the physical specification of the host machine—your computer.

4. Boot Ubuntu in the Virtual Machine

Ready to run Ubuntu?

To launch the virtual machine, select the VM and click Start. Moments later, the virtual machine will load up. Here you'll have a few options:

  1. Try or Install Ubuntu
  2. Ubuntu (safe graphics)
  3. OEM install
  4. Test memory
List of installation options for Ubuntu 22.04 within VirtualBox

To experience the flavor of Ubuntu, you can select the first option: Try or Install Ubuntu. If you don't select any option on this screen, the machine selects this option by default and starts loading the OS with the default settings.

5. Install Ubuntu in VirtualBox

At this stage, Ubuntu is the Live CD version. You can use it, connect to the internet, create files, etc., but they're all stored in the virtual machine's memory. Once you shut this virtual machine down or reboot, everything is lost.

Follow the on-screen instructions to install and set up your Ubuntu machine. A few minutes later, the virtual machine will reboot. It should automatically eject the ISO, so click Enter to proceed. If this doesn't happen, close the VM window then:

  1. Select the Ubuntu 22.04 VM
  2. Click Settings > Storage
  3. Click the Optical Drive icon
  4. Select Remove Disk from Virtual Drive
    Storage screen in VirtualBox showing a list of ISO options
  5. Click OK
  6. Then select the Ubuntu guest OS and click Start. Moments later, you'll be using Ubuntu 22.04 in your VirtualBox VM.
Ubuntu 22.04 desktop showing a list of icons

Run Multiple Guest Operating Systems With VirtualBox

If you've made it this far, you should have either installed Ubuntu 22.04 in VirtualBox or be ready to. The instructions above should tell you everything you need to know.

You don't have to stop with Ubuntu, however. Multiple operating systems can be installed in VirtualBox, from Windows and Linux OSes to ChromeOS and macOS. VirtualBox is an incredibly versatile utility that lets you use almost any operating system regardless of what is installed on your computer.