Oracle VirtualBox is a software that lets you emulate guest systems under a virtual environment with your same hardware.
VirtualBox guest additions is a set of drivers and applications shipped with VirtualBox that enhance the performance of the guest OS, which includes mouse pointer integration, time synchronization between the host and the guest OS and accelerated video performance, also it adds some features like bidirectional clipboard, drag and drop as well as other useful features.
This article explains how to install VirtualBox guest additions on Ubuntu. There are two methods to achieve that,
Table of Contents
Install VirtualBox Guest Additions Using the GUI
Open VirtualBox and start the machine.
Open a terminal either graphically or by pressing t
while holding both Ctrl and Alt keys.
You need to update your apt package list and upgrade all the software installed on your machine:
sudo apt update sudo apt upgrade
Then install some packages that are necessary for installing guest additions.
sudo apt install build-essential dkms linux-headers-$(uname -r)
Now reboot your machine.
If you installed VirtualBox the standard way, then you have an empty virtual optical drive. You just need to open devices menu within VirtualBox, and then select insert guest addition CD image.
After that Ubuntu will automatically mount the CD, and it will ask you whether you want to execute an automatic software, select run.
Type-in your password.
Wait for installation to complete and hit enter.
Now reboot your machine again for changes to take effect.
Install VirtualBox Guest Additions Using the Command-Line
Open VirtualBox and start Ubuntu.
Update your apt package list and upgrade all of your software (run these commands in a terminal):
sudo apt update sudo apt upgrade
Then install some packages that are necessary for installing guest additions.
sudo apt install build-essential dkms linux-headers-$(uname -r)
Reboot your virtual machine:
sudo reboot
Attach Guest additions CD image from the Devices menu.
Open a terminal, create a new directory to be a mount point for the CD image we just attached, and mount /dev/cdrom in that directory.
sudo mkdir /mnt/my_cd sudo mount /dev/cdrom /mnt/my_cd
Be sure to cd
into the /mnt/my_cd directory, and execute guest additions installation script using as root.
sudo ./VBoxLinuxadditions.run
Now reboot your virtual machine; because there were some changes in the kernel.
sudo reboot
Conclusion
VirtualBox guest additions is a great way to enhance the performance and improve your experience using VirtualBox, there were two easy ways to install guest addition, follow what you are comfortable with.