In this tutorial, we’ll show you how to install Ubuntu 20.04 Focal Fossa in a VirtualBox virtual machine. You’ll be able to follow along with this guide whether you are using Windows, Ubuntu, or some other Linux distribution. Configuration of VirtualBox and the installation of Ubuntu 20.04 itself stays very consistent across various platforms.
Installing Ubuntu in a virtual machine is a great way to test out applications without having to install software on your host system. It’s also an excellent way to test out Ubuntu itself, if you aren’t already running it. If you’re a Windows 10 user, you also have the option to install Ubuntu 20.04 alongside Windows 10 (dual boot), if you’d prefer that to a virtual machine.
In this tutorial you will learn:
- How to configure VirtualBox to host Ubuntu 20.04
- How to create a Ubuntu 20.04 virtual machine
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa, Windows 10, or most any Linux distribution |
Software | VirtualBox |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
Getting started
This tutorial assumes that you already have VirtualBox installed. If not, we have a guide about how to install VirtualBox on Ubuntu 20.04 Focal Fossa that you can follow before meeting back here. Windows users and others that aren’t running Ubuntu, you can head over to VirtualBox.org and download the latest version of VirtualBox for your system.
The other thing you need to have in order to get started is the Ubuntu 20.04 install image. This comes in the form of an ISO file. Check out our guide on downloading Ubuntu 20.04 Focal Fossa ISO image to get the copy that you want. It has all the official download links for Ubuntu 20.04 and the various desktop environments available. If in doubt, just download the vanilla “Ubuntu 20.04 LTS Desktop” version.
Creating a virtual machine on Ubuntu
You’ll notice that the screenshots in this section are taken on a Ubuntu system. Even if you are using some other Linux distribution or Windows 10, the menus and prompts are all pretty much identical. Whatever your host operating system is, you’ll be able to follow along with us.
- Open up VirtualBox from your system’s start menu or application launcher.
- Now, we can begin creating a new virtual machine by clicking the “New” button.
- Now you’ll need to name the new virtual machine, choose an area to save it, and make sure that the “type” and “version” are filled out correctly, as seen in the screenshot below. Then, click “Next” to continue.
- On this screen, you’ll select how much of your system’s memory the guest machine will have access to. VirtualBox says that the recommended memory to allocate is 1024 MB (1 GB) for Ubuntu. From experience, I can tell you that 2048 MB (2 GB) is much better and will ensure greater stability. If you can spare the extra gigabyte, we recommend allocating 2 GB instead of just 1. Either way, make your selection and then click “Next.”
- VirtualBox will now ask if you want to create the virtual hard disk now and what size it should be. VirtualBox recommends 10 GB. This is fine unless you plan to install a lot of software or store a lot of files. It can always be changed later if you decide that you need more storage space. Select “Create a virtual hard disk now” and click “Create” to finalize all your configuration.
- For hard disk file type, the default selection of VDI is good. Click “Next.”
- There’s not much sense in creating a fixed size virtual hard disk, since that will use more space on your hard drive than it necessarily needs. Unless you have some particular circumstance requiring a fixed size disk, leave the default “Dynamically allocated” option selected and click “Next.”
- Choose the size of the hard disk. As we said earlier, 10 GB will probably be fine for the majority of users. This is also your opportunity to select the path to the hard disk. The vast majority of users will do fine to just leave these settings alone and click “Create”.
- Now that we have our environment created, we are ready to install Ubuntu 20.04 on the virtual machine. You can highlight your newly created machine and click “Start” to boot it up.
- Seeing as that there’s no operating system currently installed, VirtualBox will prompt us to select an ISO file to boot from. Click on the little browse icon (pictured below) to select the Ubuntu 20.04 ISO image that we downloaded earlier.
- In the Optical Disk Selector menu, click “Add.”
- Navigate to where you downloaded the Ubuntu 20.04 ISO image, highlight it, and click “Open.”
- Now click “Choose” on the Optical Disk Selector.
- Finally, click “Create” to boot into the Ubuntu 20.04 installation.
From this point, you’ll be installing Ubuntu 20.04 just like you would on a physical machine. We have another guide on how to install Ubuntu 20.04 Focal Fossa desktop if you need some help with that.
Conclusion
Virtualization is a great way to run a second system without needing extra hardware. VirtualBox makes this easy with its sleek interface and extensive configuration options. Having a virtualized version of Ubuntu 20.04 gives you a lot of flexibility to test applications or maintain a separated environment from your host system.
For further reading, check out our guide on how to install guest editions on Ubuntu virtual machine, since that is probably the first thing you’ll want to do after you have your Ubuntu virtual machine up and running. Additionally, I might want to install the VirtualBox Extension Pack to gain an extra Virtualbox functionality.