
Unlock Full Performance: A Step-by-Step Guide to Installing VirtualBox Guest Additions on Ubuntu 24.04
If you’re running Ubuntu 24.04 “Noble Numbat” in a VirtualBox virtual machine, you might notice it feels a bit constrained. Perhaps the screen resolution is stuck, you can’t seamlessly move your mouse between your host and the VM, or copying and pasting text is impossible. The solution to these common frustrations is installing VirtualBox Guest Additions.
This essential suite of device drivers and system applications dramatically improves the performance and usability of your virtual machine. It’s a critical step to bridge the gap between your host operating system and the guest Ubuntu environment.
Why You Need VirtualBox Guest Additions
Installing Guest Additions unlocks a range of powerful features that make your virtual machine experience significantly smoother and more integrated.
- Auto-Resizing Display: Say goodbye to fixed screen resolutions. Your Ubuntu VM’s display will automatically adjust as you resize the VirtualBox window.
- Shared Clipboard: Effortlessly copy text, files, or images on your host machine and paste them directly into your Ubuntu VM, and vice versa.
- Seamless Mouse Integration: Your mouse cursor will move fluidly between your host desktop and the VM window without needing to be “captured” or released.
- Shared Folders: Easily share folders and files between your host and guest operating systems, creating a seamless workflow.
- Improved Graphics Performance: Guest Additions provide enhanced video drivers that offer better performance and support for hardware acceleration, making the Ubuntu desktop feel much more responsive.
Installing Guest Additions on Ubuntu 24.04: The Definitive Guide
Follow these steps carefully to ensure a smooth installation process. We will primarily use the command line (Terminal), as it is the most reliable method.
Step 1: Prepare Your Ubuntu System
Before installing anything, it’s crucial to ensure your system is fully up-to-date. This step synchronizes your package lists and installs the latest kernel, which is necessary for the Guest Additions drivers to build correctly.
Open the Terminal in your Ubuntu VM and run the following command:
sudo apt update && sudo apt upgrade -y
This command first updates the package lists and then upgrades all installed packages without prompting you for confirmation. Once it’s finished, it’s a good practice to reboot the system to apply all updates.
sudo reboot
Step 2: Install Essential Build Dependencies
VirtualBox Guest Additions need to build kernel modules specifically for your system. To do this, it requires a few key packages: build-essential
for the compiler tools, dkms
to manage kernel modules, and the correct Linux kernel headers.
Open the Terminal again and install these dependencies with a single command:
sudo apt install build-essential dkms linux-headers-$(uname -r)
Security Tip: The $(uname -r)
part of the command is very important. It automatically inserts your currently running kernel version, ensuring you install the exact matching headers. This prevents common installation failures.
Step 3: Mount the Guest Additions CD Image
Now, you need to “insert” the virtual CD image containing the installation files into your VM.
- In the VirtualBox window of your running Ubuntu VM, navigate to the top menu bar.
- Click on Devices.
- Select Insert Guest Additions CD Image… from the dropdown menu.
You should see a CD icon appear on your Ubuntu desktop, and the system may prompt you to run the software automatically. Do not use the auto-run prompt, as we will run the installer manually from the Terminal for better control.
Step 4: Run the Installation Script
With the virtual CD mounted, we can now execute the installer.
First, navigate to the directory where the CD image is mounted. Open your Terminal and use the cd
command. The exact path will include your username and the version of VirtualBox you are using. You can use the ls
command to find the correct directory name.
ls /media/$USER/
This will show you the name of the mounted CD, which will look something like VBox_GAs_7.0.18
. Now, change into that directory:
cd /media/$USER/VBox_GAs_*
Once inside the directory, run the main Linux installation script with superuser privileges:
sudo ./VBoxLinuxAdditions.run
The script will now begin building and installing the necessary kernel modules. You will see text scrolling in your terminal as it completes the process. Wait until it finishes and you are returned to the command prompt.
Step 5: Reboot and Verify
The installation is complete, but the changes won’t take effect until you restart the virtual machine.
sudo reboot
After your Ubuntu 24.04 VM reboots, the installation is finished. You can verify it’s working by:
- Resizing the VirtualBox window: The Ubuntu desktop resolution should automatically adjust to fit the new window size.
- Enabling Shared Clipboard: Go to Devices > Shared Clipboard in the VirtualBox menu and select Bidirectional. You should now be able to copy and paste text between your host and the VM.
By following these steps, you have successfully installed VirtualBox Guest Additions, transforming your Ubuntu 24.04 VM from a basic installation into a powerful, fully-integrated, and highly efficient virtual environment.
Source: https://kifarunix.com/install-virtualbox-guest-additions-on-ubuntu-24-04/