
Unlocking the full potential of your VirtualBox Ubuntu environment is essential for a seamless computing experience. While a fresh Ubuntu 18.04 installation in VirtualBox is functional, integrating the Guest Additions package dramatically enhances usability and performance.
Why bother with Guest Additions? They provide critical drivers and system applications that optimize the guest operating system for the virtual environment. This includes crucial features like automatic screen resizing, improved mouse pointer integration, shared clipboard functionality, drag-and-drop support, and better video performance. Installing them is a key step after setting up your virtual machine.
Here’s a straightforward guide to get this done efficiently:
First, ensure your Ubuntu guest system is up-to-date. Open the terminal and run:
sudo apt update
sudo apt upgrade
Next, install the necessary build tools and kernel headers required by the Guest Additions. These packages allow the installation process to build modules specifically for your current kernel version. Execute the following command:
sudo apt install build-essential dkms linux-headers-$(uname -r)
The $(uname -r) part automatically detects your current kernel version, ensuring you install the correct headers.
Now, you need to make the Guest Additions ISO image available to the virtual machine. In the VirtualBox menu (typically at the top of the VM window), navigate to “Devices” and select “Insert Guest Additions CD image…”.
This action should ideally mount the ISO image within your Ubuntu guest file system. If it doesn’t auto-run or prompt, you’ll need to navigate to the mounted CD-ROM drive. Open your file manager or check the /media
directory.
Once you’ve located the mounted drive (it might be named something like VBox_GuestAdditions_X.X.XX
), open a terminal and change into that directory. For example, if it mounted under /media/username/VBox_GuestAdditions_...
, you would use:
cd /media/username/VBoxGuestAdditionsX.X.XX
(Replace username
and the version numbers as appropriate).
Inside this directory, you will find the installation script. Execute it using sudo:
sudo ./VBoxLinuxAdditions.run
The script will run, compiling and installing the necessary modules. Pay attention to the terminal output for any errors, although the process is usually smooth.
After the installation completes, you must reboot your Ubuntu virtual machine for the changes to take effect.
sudo reboot
Once the system restarts, you should immediately notice the improvements – your screen resolution will likely adjust automatically when you resize the VM window, and you can test shared clipboard or drag-and-drop if enabled in the VirtualBox settings. Installing the Guest Additions is a simple yet impactful step that transforms your virtual machine experience.
Source: https://kifarunix.com/install-virtualbox-guest-additions-on-ubuntu-18-04/