Install Virtualbox Guest Additions on Ubuntu To Enable 3D Support

In this tutorial I will show you how to install virtualbox guest additions on Ubuntu virtual machine. Guest additions allow your guest OS to be full screen and enable the host and guest to share files and folders with each other. The guest additions will also provide 3D support for Unity desktop thus improving the speed of Ubuntu virtual machine.

Tip: Virtualbox Guest additions are compiled and installed inside a guest OS.

The following instructions are tested on Ubuntu 16.04 and Ubuntu 16.10.

Install Virtualbox Guest Additions on Ubuntu

Log into Ubuntu (Guest OS), open a terminal and update your software with the below command. && means the shell will only execute the next command after previous command is successfully executed.

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

Reboot your system.

sudo reboot

Install required packages for building kernel modules.

sudo apt-get install build-essential module-assistant dkms

Note: On Ubuntu MATE edition, you need to enable the universe repository, which can be done with the following command, in order to install module-assistant.

sudo add-apt-repository universe

sudo apt update

After the above packages are installed, prepare your system to build kernel module.

sudo m-a prepare


sudo m-a prepare

In the virtual machine window, select Devices > Insert Guest Additions CD image.

insert guest addition image

You will be asked to download the guest additions iso image. Click Download.

download virtualbox guest additions cd image

If you host is a Linux distribution, then the guest additions disk image will be downloaded to ~/.config/VirtualBox/ directory. Once the download is complete, click Insert button to insert the CD image into the virtual optical drive.

insert guest additions image

A pop-up will appear asking you if you would like to run it. Click the Run button.

Install Virtualbox Guest Additions on Ubuntu

Then enter your password on ubuntu and it will begin building the virtualbox guest additions kernel modules.

building virtualbox guest additions kernel modules

As you can see from the output, it’s also installing window system drivers and graphics libraries and that’s what make 3D acceleration in the guest OS possible. Once it’s done, press Return to close the window.

Reboot your Ubuntu virtual machine.

sudo reboot

Now the resizeable display should be working and the resolution of Ubuntu will adjust with the size of virtulbox window.  You can press right Ctrl and F keyboard shortcut to enter full-screen mode.

Enable 3D Hardware Acceleration

This step is useful to Ubuntu Unity edition.

Shutdown Ubutnu VM and open your virtualbox settings. Click Display on the left pane. In the Screen tab, allocate 128M video memory to Ubuntu VM and check the box before Enable 3D Acceleration. Save you settings.

enable 3d accerelation in virtualbox

Start your Ubuntu VM again. It should be running much faster right now because Unity 3D is supported now. You can run the following command in the terminal to determine whether Unity 3D is supported.

/usr/lib/nux/unity_support_test -p

Look at the last line of the output, if it says

Unity 3D supported: yes

Then Unity 3D is supported.

Rate this tutorial
[Total: 7 Average: 4.1]
  • Arkon

    Thanks for this tut. Worked like a charm!