1. Home
  2. Linux

How to install VirtualBox Guest Additions for an Ubuntu Virtual Machine

VirtualBox Guest Additions are important in VirtualBox because they provide excellent graphics acceleration, as well as other useful features such as shared folder support, better graphics support, and others things too.

If you plan to use Ubuntu in a VirtualBox virtual machine, you’ll need to install these guest additions. In this guide, we’ll go over exactly how to do that. 

Note: Although this guide focuses on an Ubuntu VM, the installation instructions should also work on any guest Linux operating system in VirtualBox. However, the Linux header installation instructions will differ.

Setting up an Ubuntu VM in VirtualBox

Setting up an Ubuntu VM isn’t that hard. Essentially, you’ll install Ubuntu virtually just as you do on a physical computer. However, to speed up this process, you can download a pre-configured VM from OSboxes.org. 

To download a VM, head over to the Ubuntu page on Osboxes.org. Once on there, look for the latest release of Ubuntu, click on the “VirtualBox” tab, and select the download button.

Osboxes distributes its VMs in archive format. When the archive is done downloading, open up VirtualBox, click on “New,” and go through the setup of creating your new VM. 

When you get to the setup process for the VM, select “Use an existing virtual hard disk file,” and select the Osboxes VM VDI file as the existing hard drive to use the downloaded VM.

If you do not wish to use an OSboxes VM for Ubuntu, head over to Ubuntu.com/desktop, download the latest Ubuntu ISO file to your computer, load it up into VirtualBox, and install Ubuntu the old way.

Installing Linux headers in Ubuntu VM

Inside the Ubuntu VM, you need to install the Linux kernel headers. These headers are required to modify the Linux kernel, and the VirtualBox guest additions will not work on Ubuntu without it, as they’re kernel modules.

To install the latest Ubuntu kernel headers, start by launching a terminal window on the desktop. You can open up a terminal window on the desktop with Ctrl + Alt + T, or by clicking on “Terminal” in the app menu.

Once the terminal window is open in the Ubuntu VM, use the apt install command down below to install the Ubuntu Linux kernel headers. 

sudo apt install linux-headers-$(uname -r) -y

Downloading Guest Additions

Now that you’ve set up your OSboxes VM in VirtualBox, you can log in with the password “osboxes.org.” Or, if you set up your own VM using an Ubuntu ISO, log in with your username and password.

When you’ve logged in, you’ll need to download the latest release of the VirtualBox guest additions. The easiest and fastest way to do this is to do it within the VirtualBox app, rather than the official website.

From here, find the “Devices” menu inside of the Ubuntu window, and click on it with the mouse. When you click on the menu, you’ll see many different options available to click on.

Look to the bottom of the menu, and click on the “Insert Guest Additions” button in the menu. When you click on it for the first time (if you’ve never selected this option before) VirtualBox will begin to download the Guest Additions ISO file to your computer.

When the download process is complete, the VirtualBox Guest Additions ISO file will automatically be inserted into the Ubuntu VM’s virtual CD/DVD drive. Shortly after that, you’ll see a prompt pop-up on the Ubuntu VM’s desktop.

Installing the guest additions into the Ubuntu VM

When you insert the Guest Additions ISO file into the Ubuntu VM, you should see a prompt appear on the screen. This prompt will let you know that there is installable software on the disk that Ubuntu can install. 

Click on the “Run” button with the mouse to begin the installation. When you click “Run” a terminal window will pop up on the screen. Follow the prompts that tell you what to do. 

During the terminal installation of the Guest Additions, you may run into a failed installation. Failed installations happen when your Ubuntu VM is missing a few packages that the software expects to have. 

Do not worry if you run into an issue while installing Guest Additions. Simply read what packages it requires you to install. Open up the terminal window, install the packages with apt install, then, eject the Guest Additions ISO from the VM and re-insert it to bring up the “Run Software” dialog again.

When the terminal window finishes installing VirtualBox Guest Additions into your Ubuntu VM, reboot. You need to restart the Ubuntu VM to start using the new software installed into the Ubuntu VM kernel. 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.