How to Install & Use VirtualBox Guest Additions on Ubuntu

Install VirtualBox Guest Additions in Ubuntu and with this, you’ll be able to copy-paste, drag and drop between the host and guest system. It makes using Ubuntu on virtual machines a lot easier.
Warp Terminal

The VirtualBox Guest Additions consist of device drivers and system applications that optimize the operating system for better performance and usability. These drivers provide a tighter integration between the guest and host systems.

No matter how you are using your Virtual Machine, Guest Additions can be very helpful for you.

For example, I test many installations and applications inside a VM and take plenty of screenshots. It comes in very handy to be able to move those screenshots freely between the Host OS and the Guest OS.

📋
The host system is your actual operating system installed on your physical system. The guest system is the virtual machine you have installed inside your host operating system.

Before you see the steps to install VirtualBox Guest Additions on Ubuntu, let us first talk about its features.

Why Should You Use VirtualBox Guest Additions?

guest additions in virtualbox

With VirtualBox Guest Additions enabled, using the virtual machine becomes a lot more convenient. Don’t believe me? Here are the important features that the Guest Additions offer:

  • Mouse pointer integration: You no longer need to press any key to “free” the cursor from the Guest OS.
  • Shared clipboard: With the Guest Additions installed, you can copy-paste between the guest and the host operating systems.
  • Drag and drop: You can also drag and drop files between the host and the guest OS.
  • Shared folders: This feature allows you to exchange files between the host and the guest. You can ask VirtualBox to treat a certain host directory as a shared folder, and the program will make it available to the guest operating system as a network share, irrespective of whether the guest actually has a network.
  • Better video support: The custom video drivers that are installed with the Guest Additions provide you with extra high and non-standard video modes, as well as accelerated video performance. It also allows you to resize the virtual machine’s window. The video resolution in the guest will be automatically adjusted, as if you had manually entered an arbitrary resolution in the guest’s Display settings.
  • Seamless windows: The individual windows that are displayed on the desktop of the virtual machine can be mapped to the host’s desktop, as if the underlying application was actually running on the host.
  • Generic host/guest communication channels: The Guest Additions enable you to control and monitor guest execution. The “guest properties” provide a generic string-based mechanism to exchange data bits between a guest and a host, some of which have special meanings for controlling and monitoring the guest. Applications can be started on the Guest machine from the Host.
  • Time synchronization: The Guest Additions will resynchronize the time with that of the Host machine regularly. The parameters of the time synchronization mechanism can be configured.
  • Automated logins: Basically credentials passing, it can be a useful feature.

Impressed by the features it provides? Let’s see how you can install VirtualBox Guest Additions on Ubuntu Linux.

Suggested Read 📖

10 Reasons to Run Linux in Virtual Machines
You can run any operating system as a virtual machine to test things out or for a particular use case. When it comes to Linux, it is usually a better performer as a virtual machine when compared to other operating systems. Even if you hesitate to install Linux on bare

Installing VirtualBox Guest Additions on Ubuntu Guest system

The scenario here is that you have Ubuntu Linux installed inside VirtualBox. The host system could be any operating system.

I’ll demonstrate the installation process on Ubuntu 22.04 virtual machine.

First, run your virtual machine:

VirtualBox Ubuntu Virtual Machine
VirtualBox Ubuntu Virtual Machine

To get started, head to VirtualBox's menu, and select Device → Insert Guest Additions CD image… as shown in the screenshot below:

Install Guest Additions
Insert Guest Additions CD Image

This will provide you with the required installer inside the guest system (i.e., the virtual operating system). If you are prompted to run "VBox_GAs_7.0.8" automatically, you can go ahead and run it.

In either case, access the CD image mounted on your system from the dock, and run the autorun script available as a program (as shown in the screenshot below):

run autorun script

This should open up the installation in a terminal window while asking you for authorization.

Once you approve it, the installation will take a few minutes to complete:

guest additions installation

Troubleshooting tips

If you get an error like this one, it means you are missing some kernel modules, which happens in some cases, such as using a minimal installation of Ubuntu as a virtual machine:

Guest Additions Terminal Output
Error while installing Guest Additions in Ubuntu

You need to install a few more packages here. Just to clarify, you need to run these commands inside the virtual machine:

sudo apt install build-essential dkms linux-headers-generic 

Now run the Guest Addition setup again through the file manager, or type in the command below:

sudo rcvboxadd setup

Using VirtualBox Guest Addition features

Here are some screenshots for enabling/using helpful features of VirtualBox Guest Additions in use:

Change the Virtual Screen Resolution

By default, the virtual machine window when re-sized will auto-scale after installing the guest additions.

So, you may not need this feature. However, if you want a specific resolution, you can head to the "View" menu and select the virtual screen to scale or re-size as per your preferences.

Change Virtual Screen Resolution
Change Virtual Screen Resolution

Configure Drag And Drop (any files)

You can enable drag and drop from the top menu → Devices →Drag and Drop → Bidirectional.

With Bidirectional, you can drag and drop from guest to host and from host to guest, both.

Drag and Drop feature enable in virtualbox
Drag and Drop

Configure Shared Clipboard (for copy-pasting)

Similarly, you can enable shared clipboard from the top menu → Devices → Shared Clipboard → Bidirectional.

Shared Clipboard feature toggle in virtualbox
Shared Clipboard

In addition to this, you also get the option of "Shared Folders". Unlike the above options, it is not a simple toggle, so you need to head to the option and set the shared directory before using it.

guest system ubuntu folder sharing option

You need to choose a folder path from your host, a name for the folder, and the mount point (in the guest).

Suggested Read 📖

Top 9 Best Virtualization Software for Linux [2023]
We take a look at some of the best virtualization programs that make things easy for users creating/managing VMs.

Uninstalling VirtualBox Guest Additions

For some reason, if you would rather not use it anymore, here's how you can remove it.

Just enter the command below:

sudo vbox-uninstall-guest-additions
uninstall guest additions

Wrapping Up

Hopefully, by now, you have learned how to install and use the VirtualBox Guest Additions on Ubuntu.

💬 Please let us know if you use these Additions, and what feature you find to be the most helpful!

About the author
Sergiu

Sergiu

I'm a student passionate about anything involving creativity, especially music and poetry. I play music with friends, write and code. Linux and coffee are also at the top of my ever-growing list of p

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.