How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (2024)

1. Overview

In this tutorial, we’ll walk you through one of the easiest ways to try out Ubuntu Desktop on a virtual machine. VirtualBox is a general purpose virtualiser that is available across Linux, Mac OS and Windows. It’s a great way to experience Ubuntu regardless of your current operating system.

VirtualBox 7 and above includes a new feature called Unattended Guest OS Install which significantly streamlines the setup experience for common operating systems like Ubuntu, making it easier than ever to get started.

Note: This tutorial will also work for other distributions, so try it out with some of the Ubuntu flavours as well!

What you’ll learn

  • How to install and configure VirtualBox
  • How to import an Ubuntu image
  • How to run a virtual instance of Ubuntu Desktop
  • Further configuration options

What you’ll need

  • A PC with internet access!

Duration: 3:00

You can download an Ubuntu image here. Make sure to save it to a memorable location on your PC! For this tutorial, we will use the latest Ubuntu 22.10 release.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (1)

Duration: 5:00

You can download VirtualBox from the downloads page here. This page includes instructions on how to install VirtualBox for your specific OS so we won’t repeat those here.

Once you have completed the installation, go ahead and run VirtualBox.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (2)

2. Create a new virtual machine

Click New to create a new virtual machine. Fill in the appropriate details:

  • Name: If you include the word Ubuntu in your name the Type and Version will auto-update.
  • Machine Folder: This is where your virtual machines will be stored so you can resume working on them whenever you like.
  • ISO Image: Here you need to add a link to the ISO you downloaded from the Ubuntu website.

We want to install Ubuntu unattendedly so we can leave the checkbox to skip unchecked.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (3)

Create a user profile

To enable the automatic install we need to prepopulate our username and password here in addition to our machine name so that it can be configured automatically during first boot.

The default credentials are:

  • Username: vboxuser
  • Password: changeme

It is important to change these values since the defaults will create a user without sudo access.

Ensure your Hostname has no spaces to proceed!

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (4)

It is also recommended to check the Guest Additions box to install the default Guest Additions ISO that is downloaded as part of VirtualBox. Guest additions enables a number of quality of life features such as changing resolution and dynamic screen resizing so it is highly recommended!

Note: If you choose not to use unattended install then this step will be skipped and you will go straight to the following screen. Once your machine has been created you will be able to create a username and password by proceeding through the standard Ubuntu Desktop installation flow on first boot.

Define the Virtual Machine’s resources

In the next section we can specifiy how much of our host machine’s memory and processors the virtual machine can use. For good performance it’s recommended to provide your VM with around 8GB of RAM (althought 4GB will still be usable) and 4 CPUs. Try to remain in the green areas of each slider to prevent issues with your machine running both the VM and the host OS.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (5)

Then we need to specify the size of the hard disc for the virtual machine. For Ubuntu we recommend around 25 GB as a minimum. By default the hard disk will scale dynamically as more memory is required up to the defined limit. If you want to pre-allocate the full amount, check the ‘Pre-allocate Full Size’ check box. This will improve performance but may take up unnecessary space.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (6)

Click Next to continue and view a summary of your machine setting.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (7)

After this click Finish to initialize the machine!

3. Install your image

Click Start to launch the virtual machine.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (8)

You will see a message saying ‘Powering VM up …’ and your desktop window will appear.

On first boot the unattended installation will kick in so do not interact with the prompt to ‘Try and Install Ubuntu’ and let it progress automatically to the splash screen and into the installer.

Note: If you chose not to use unattended install then you will need to progress through the Ubuntu install manually. Check out our Ubuntu Desktop installation tutorial for more details.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (9)

You will notice at this stage that the resolution of the window is fixed at 800x600. This is because the Guest Additions features are not installed until after the Ubuntu installation has completed.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (10)

Once the installation completes, the machine will automatically reboot to complete the installation.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (11)

Finally you will be greeted with the Ubuntu log-in screen where you can enter your username and password defined during the initial setup (don’t forget that the default password is ‘changeme’ if you left everything as the default).

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (12)

4. Explore Virtual Box

Enjoy your shiny new Ubuntu Desktop!

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (13)

As always we recommend opening a terminal and running sudo apt update && sudo apt upgrade -y and then sudo snap refresh to get everything updated to the latest versions.

Once you’ve finished your session you can close your machine by clicking the X in the top right of the window and choosing whether to keep your machine frozen in its current state or shut it down completely.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (14)

As you can probably tell, there are tonnes of further configuration options available in VirtualBox and we’ve only scratched the surface.

VirtualBox allows you to create and configure multiple virtual machines, so don’t be afraid to create new instances of Ubuntu to try out different system and storage configurations to fine tune your performance.

Why not try following the tutorial above with one of the Ubuntu flavours!

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (15)

5. Tell us your thoughts!

Thank you for following this tutorial, we’d love to hear how you got on.

Give us feedback in the Ubuntu Discourse if you have any issues.

To help us improve our tutorials, we’d love to hear more about you:

How will you use this tutorial?

What is your current level of experience?

What operating system are you following this tutorial on?

Was this tutorial useful?

Thank you for your feedback.

How to run an Ubuntu Desktop virtual machine using VirtualBox 7 | Ubuntu (2024)
Top Articles
Latest Posts
Article information

Author: Kerri Lueilwitz

Last Updated:

Views: 5799

Rating: 4.7 / 5 (47 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Kerri Lueilwitz

Birthday: 1992-10-31

Address: Suite 878 3699 Chantelle Roads, Colebury, NC 68599

Phone: +6111989609516

Job: Chief Farming Manager

Hobby: Mycology, Stone skipping, Dowsing, Whittling, Taxidermy, Sand art, Roller skating

Introduction: My name is Kerri Lueilwitz, I am a courageous, gentle, quaint, thankful, outstanding, brave, vast person who loves writing and wants to share my knowledge and understanding with you.