A simple guide shows how to install VirtualBox guest additions in Ubuntu and other related Linux.
When you install Linux on a virtual machine, it is often named as the guest system. The host system is where you install the VirtualBox application.
Oracle’s VirtualBox provides a set of device drivers and apps that help achieve data and other communication between guest and host system. For example, if you want to share folders, drag and drop from host to guest. Here are some of the cool features of Guest Additions.
- Share folders
- Drag and drop feature
- Bi-directional clipboard to achieve seamless cut/copy & paste
- Better video performance
After you install VirtualBox in Ubuntu, you should definitely install Guest Additions. Here’s how.
Install VirtualBox Guest Additions in Ubuntu
These instructions assume that you have installed a guest Ubuntu system in VirtualBox.
- Open VirtualBox in the host system and start Ubuntu virtual machine.
- Open a terminal and install the following:
sudo apt install build-essential dkms linux-headers-$(uname -r)
- After the above command is complete, restart the guest Ubuntu system.
- After boot up is complete, go to the VirtualBox menu and select
Devices > Insert Guest Additions CD Image. Here’s an example image for your reference (Figure 1).
- Once you do that, you should see a new disk mounted under
/run/media/[user name]/directory. Go to that directory from the terminal.
- Then, execute the setup program
VBoxLinuxAdditions.runusing the below command.
- Wait for the instructions to finish. Once done, you should see the options available for Copy/Paste, folder share and others, as shown below (Figure 3).
In this tutorial, I have shown you how easily you can install guest additions in Ubuntu and other related distros. For Fedora, the instructions should be the same.
This article is tested in Ubuntu 23.10, although it should work just fine for other versions/distros.
Finally, let me know in the comment box if you face any errors while installing it.