René Fürst
By René Fürst Last updated on

Want to try out your own Linux system without needing a second computer or a fresh installation of your main system? A virtual machine makes exactly that possible. With VirtualBox, you create an isolated computer within your operating system on which you install Ubuntu. Your actual system remains untouched.

Linux for beginners - 3.2 Installing Ubuntu with VirtualBox

The video is only loaded from YouTube when you play it – data (including your IP address) is then transmitted to YouTube/Google. More in the privacy policy

In this guide, I will walk you step by step through the entire process: from downloading the Ubuntu image, through setting up the virtual machine, to the finished installation with Guest Additions for better usability. The procedure describes Ubuntu 16.04 LTS, but the steps can also be applied to other versions.

Key Takeaways

  • Ubuntu is a Linux distribution based on Debian that is suitable for both desktops and servers.
  • The LTS version (Long Term Support) receives security updates over a very long period and is therefore particularly suitable for beginners and long-term use.
  • You should assign at least 2 GB of RAM to the virtual machine. With 4 GB or more, the system runs much more smoothly.
  • A fixed hard disk size of about 20 GB offers room for updates and additional programs.
  • The network setting "Bridged Adapter" later allows you to access the virtual machine from outside.
  • With the Guest Additions, you install graphics drivers and extensions that enable a higher resolution and better usability.

Step 1: Download the Ubuntu Image

The first step is to get the right installation image. Go to the official Ubuntu website and navigate to the download section. There you will usually find two variants: the LTS version and the latest version. For beginners, the LTS version is the better choice, as it is supplied with security updates for longer. The version number is made up of the year and month of release. Ubuntu is released in April and October each year.

Then choose the desktop variant if you want a graphical interface. The server variant does without one and is operated entirely via the terminal. The image is about 1.6 GB in size, so the download may take a few minutes.

Installing Ubuntu in VirtualBox: A Beginner's Guide

Step 2: Choose the Architecture

Ubuntu is available in a 32-bit and a 64-bit version. What matters is the amount of RAM you want to assign to the virtual machine later. If you can provide at least 4 GB of RAM, take the 64-bit version. If you have less memory, the 32-bit version is sufficient. In my example, the host computer has 8 GB of RAM, so I can easily allocate 4 GB and use the 64-bit version.

Installing Ubuntu in VirtualBox: A Beginner's Guide

Step 3: Create a New Virtual Machine

Start VirtualBox and click "New". Give your machine any name you like, for example "Ubuntu Test". As soon as you enter the name, VirtualBox often automatically recognizes that it is Linux and suggests the appropriate Ubuntu version. You can also select other distributions such as Debian, Fedora, or Red Hat. Make sure to specify the architecture correctly: for the 64-bit image, you select "Linux 64-bit".

Installing Ubuntu in VirtualBox: A Beginner's Guide

In the next window, you set the RAM. The recommendation is at least 2 GB; if you have sufficient resources, 4 GB makes sense. Don't assign too much, because your main system itself needs enough memory. If memory is tight, everything will otherwise become noticeably slower.

Step 4: Create the Virtual Hard Disk

Next, you create the virtual hard disk. Select "Create a virtual hard disk now" and confirm with "Create". 8 GB is recommended, but I would rather recommend about 20 GB so that you have enough room for updates and programs later.

As the hard disk type, you can keep VDI, as it is optimized for VirtualBox. For storage, you choose "Fixed size". With this, VirtualBox reserves the entire storage space immediately on your real hard disk, which takes a bit longer but causes fewer problems later. Dynamic allocation is also possible, but it can lead to difficulties with a later expansion.

Installing Ubuntu in VirtualBox: A Beginner's Guide

Step 5: Mount the ISO Image and Start the Installation

Select your new machine in the overview and click "Start". A selection window opens in which you choose the downloaded ISO image. Confirm the selection and start the machine. A new window then opens, representing your virtual computer. From here, you start the installation of the system.

Installing Ubuntu in VirtualBox: A Guide for Beginners

You can try Ubuntu first without installing it. In this case, the system is started directly from the image, and everything is lost after a restart. For permanent use, however, you choose "Install Ubuntu". First select your language, in this example German, and then click "Install".

Installing Ubuntu in VirtualBox: A Guide for Beginners

Step 6: Performing the Installation

In the next window, you will be asked whether updates should be downloaded during installation. You can also do that later, so leave the checkbox unchecked in this example. Click "Continue".

Next, you have to decide how the hard drive should be used. Since this is the virtual hard drive that only VirtualBox accesses, you can choose the option "Erase disk and install Ubuntu". Confirm with "Install now". The installer automatically creates a partition with the ext4 file system as well as a swap partition, which serves as paging memory.

Installing Ubuntu in VirtualBox: A Beginner's Guide
Installing Ubuntu in VirtualBox: A Guide for Beginners

Then a few settings follow. Select your location so that the time zone is set correctly. For the keyboard layout, choose German. In the next step, you set your name, the name of the computer, and your password. You can also specify whether you want to log in automatically and whether your home directory should be encrypted. Encryption is optional, but keep in mind that in the event of a hard drive problem, it can also make recovery more difficult.

Installing Ubuntu in VirtualBox: A Beginner's Guide
Installing Ubuntu in VirtualBox: A Beginner's Guide

Depending on the computer, the installation takes about 10 to 30 minutes. So plan for a little time. Afterwards, you restart the machine.

Step 7: Adjusting the Network Settings for External Access

So that you can access the virtual machine from your host system later, you need to change the network setting. To do this, shut the machine down completely. You can do this via "Close" and the option "Power off". This way you avoid errors that can occur with a simple restart in a beta version.

Installing Ubuntu in VirtualBox: A Beginner's Guide

Then open the machine's settings in VirtualBox and switch to the "Network" section. Select the "Bridged Adapter" mode there and accept the existing interface. The bridged connection ensures that the virtual machine appears on the network like an independent computer. Confirm the change with "OK".

Installing Ubuntu in VirtualBox: A Beginner's Guide

You can leave the processor cores and the video memory at default. Only the network setting is important. Then start the machine again.

Step 8: Logging In and Installing the Guest Additions

After startup, you will see the login screen. Enter your password to log in. The graphical interface is now visible, but you quickly notice that the resolution is not yet at the desired value. This is because the graphics driver is missing.

Installing Ubuntu in VirtualBox: A Guide for Beginners

VirtualBox offers the so-called Guest Additions for this. In the menu bar of the virtual machine, click "Devices" and select "Insert Guest Additions CD image". Then you start the installer on the virtual CD and enter your password again. The necessary drivers and kernel modules are now installed. Wait until the process is complete, and confirm at the end by pressing the Enter key. Another restart is then necessary.

Installing Ubuntu in VirtualBox: A Beginner's Guide

After the restart, you can select the available resolutions in the display settings. Choose a resolution that suits your screen. A resolution of 1280 × 720 or slightly higher is well suited for daily work, as it remains clear even in smaller windows.

Installing Ubuntu in VirtualBox: A Beginner's Guide

Summary – Installing Ubuntu in VirtualBox: Guide for Beginners

You now have a working Ubuntu installation in a virtual machine. You downloaded the appropriate image, created the machine with sufficient memory and disk space, installed the system, and adjusted the network settings for external access. With the Guest Additions, the graphical interface also runs smoothly. You can continue working in the terminal later, because that is where you will get to know Linux best.

FAQ

Do I need a particularly powerful computer for Ubuntu in VirtualBox?No, but your host computer should have enough memory. With 8 GB of RAM, you can easily assign 4 GB to the virtual machine.

Which Ubuntu version should I choose as a beginner?The LTS version is the most suitable, as it receives security updates over a long period of time.

What is the difference between trying Ubuntu and installing Ubuntu?When trying it, the system runs directly from the image, and all changes are lost after a restart. With installation, the system is stored permanently on the virtual hard disk.

Why should I choose a fixed disk size?A fixed size prevents problems if you want to expand the disk later. Although creating it takes a bit longer, it is more stable.

Why does the display not work properly after installation?The Guest Additions are probably missing. Install them via the "Devices" menu of the virtual machine and then restart.

What does the bridged adapter do?The bridged adapter connects the virtual machine directly to your network. This way you can access it from your host system, for example via SSH.

René Fürst
Trainer About René Fürst Passionate IT consultant! I have been working in IT for over 16 years and have been confronted with a wide variety of tasks. All courses by René Fürst