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:
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> You need sudo access on the Ubuntu guest.
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-essential, dkms, and linux-headers installed without errors, then re-run the installer.
With Guest Additions installed, you can turn on the enhanced features from the VirtualBox VM settings:
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.
Squid is a full-featured caching proxy server that supports HTTP, HTTPS, and FTP. It is most…
Chromium is a fast, lightweight, open-source web browser developed primarily by Google. It serves as the…
MySQL Workbench is a cross-platform graphical tool for MySQL database administration. It brings together everything a…
NFS (Network File System) is a distributed file sharing protocol that lets you mount remote directories…
SSH (Secure Shell) is a cryptographic network protocol that creates a secure, encrypted connection between your…
Node.js is an open-source, cross-platform JavaScript runtime that lets you run JavaScript on the server side,…