How to install VirtualBox Guest Additions for Linux

VirtualBox Guest Additions are a set of device drivers and system applications which are designed to be installed in the guest operating systems of VirtualBox. Guest Additions are available as an ISO image for Windows, Linux, Solaris or OS/2. The Guest Additions offer a number of features including:

  • Seamless mouse support across host and guest operating systems.
  • Shared folders/clipboard between host and guest operating systems.
  • High-resolution video modes as well as hardware-accelerated performance for 3D graphics and 2D video.
  • Time synchronization between host and guest operating systems.

In this tutorial, I will describe how to install VirtualBox Guest Additions for Linux.

I assume that you already have a Linux guest virtual machine (VM) up and running on VirtualBox. The rest of the steps below should be done inside the Linux guest VM.

First, check out the version of your VirtualBox, and download the ISO image of
matching Guest Additions from http://download.virtualbox.org/virtualbox. For example, assuming that VirtualBox is 4.2.16, download Guest Additions for version 4.2.16.

$ wget http://download.virtualbox.org/virtualbox/4.2.16/VBoxGuestAdditions_4.2.16.iso

Next, install necessary packages:

On Ubuntu, Mint or Debian:

$ sudo apt-get install dkms gcc

On Fedora:

$ sudo yum install dkms gcc

On CentOS or RHEL:

$ sudo yum install kernel-devel gcc

Now, mount the ISO file for Guest Additions:

$ sudo mount -o loop VBoxGuestAdditions_4.2.16.iso /mnt
$ cd /mnt

Run the following executable in the mount point. This is the Guest Additions installer.

$ sudo ./VBoxLinuxAdditions.run

After the executable is completed, reboot the guest operating system to activate the updates.

To verify that Guest Additions are installed successfully, run the following. You should see several kernel modules loaded in the kernel.

$ lsmod | grep vbox
vboxvideo              12611  0
drm                   286313  1 vboxvideo
vboxsf                 39557  0
vboxguest             235614  2 vboxsf

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

5 thoughts on “How to install VirtualBox Guest Additions for Linux

  1. Thanks for this! I've been having trouble implementing shared folders and the documentation isn't clear at all.

  2. You should find the Guest Additions is embedded within the VB image and so no further download is needed.
    From within the VM, you should be able to go to the menu bar of VB, choose the Devices menu, and from within that select 'Insert Guest Additions CD image' and then choose run.

  3. Hi guys, I am running a model on virtual machine but the problem is that I am unable to see all my results because I can't scroll up or down. Any suggestion as how I can correct this?

Leave a comment

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

Current day month ye@r *