Cybersecurity Updates & Tools

VirtualBox Guest Additions on Ubuntu 18.04: Install and Verify

VirtualBox is an open-source, cross-platform virtualization application that lets you run multiple operating systems simultaneously on a single host machine. While VirtualBox works out of the box, the default Ubuntu guest experience is limited, low screen resolution, no clipboard sharing, and no straightforward way to transfer files between the host and guest.

VirtualBox Guest Additions fix all of that. They are a set of drivers and utilities you install directly inside the guest operating system. Once installed, you get:

  • Shared clipboard between host and guest
  • Drag-and-drop file transfer
  • Shared folders for easy file access
  • Automatic screen resolution adjustment
  • Smoother mouse pointer integration

This guide walks you through installing VirtualBox Guest Additions on an Ubuntu 18.04 guest. The same steps apply to Ubuntu 16.04 and other Ubuntu-based distributions. These instructions work on both Desktop and Server guest installations.

<strong>Prerequisite:</strong>&nbsp;You need sudo access on the Ubuntu guest.

Install VirtualBox Guest Additions on Ubuntu

Step 1: Install the required build packages

Guest Additions compiles a kernel module during installation. Install the necessary build tools and kernel headers first:

bashsudo apt updatesudo apt install build-essential dkms linux-headers-$(uname -r)

The $(uname -r) expression automatically inserts your currently running kernel version.

Step 2: Mount the Guest Additions ISO

With your Ubuntu guest VM running, go to the VirtualBox menu bar and click:

Devices > Insert Guest Additions CD Image

VirtualBox mounts a virtual CD containing the installer. If you see an error that the guest has no CD-ROM drive, power off the VM, go to Settings > Storage, click the plus icon to add an optical device, then restart the VM and try again.

Step 3: Mount the CD from the terminal

In the Ubuntu guest terminal, create a mount point and attach the virtual CD:

bashsudo mkdir -p /mnt/cdromsudo mount /dev/cdrom /mnt/cdrom

Step 4: Run the installer

Navigate to the mount point and run the installation script. The --nox11 flag stops the installer from opening a separate terminal window:

bashcd /mnt/cdromsudo sh ./VBoxLinuxAdditions.run --nox11

You should see output like this:

Verifying archive integrity... All good.Uncompressing VirtualBox 5.2.32 Guest Additions for Linux........VirtualBox Guest Additions: Starting.

Step 5: Reboot the guest

Reboot the Ubuntu guest for the changes to take effect:

bashsudo shutdown -r now

Step 6: Verify the installation

After the VM restarts, log in and confirm the vboxguest kernel module loaded correctly:

bashlsmod | grep vboxguest

Output:

vboxguest             303104  2 vboxsf

If the command produces no output, the kernel module did not load. This usually means a build dependency was missing. Double-check that build-essentialdkms, and linux-headers installed without errors, then re-run the installer.

Enable Guest Additions Features

With Guest Additions installed, you can turn on the enhanced features from the VirtualBox VM settings:

  • Shared Clipboard: Settings > General > Advanced > Shared Clipboard
  • Drag and Drop: Settings > General > Advanced > Drag’n’Drop
  • Shared Folders: Settings > Shared Folders > Add new shared folder
  • 3D Acceleration: Settings > Display > Screen > Enable 3D Acceleration

Each setting takes effect after saving. Some require a full VM restart before they become active.

VirtualBox Guest Additions are now installed on your Ubuntu 18.04 guest. The improved screen resolution, clipboard sharing, and drag-and-drop support make working inside a VM significantly more comfortable. Leave a comment below if you run into any issues during installation.