When setting up a VM in VirtualBox one the first things you should do is install the guest additions. This post will show you exactly how to do that using an Xubuntu VM.
So what are these Guest Additions? It’s a set of extensions that make your VM perform better as well as offer additional functionality. The details of everything that is included with these are listed on the VirtualBox manual here: https://www.virtualbox.org/manual/ch04.html
Basically it allows you to share a clipboard for copy/pasting between host and guest(or guest to guest), share folders, sync the time, better video support etc. It makes the experience of any VM much more enjoyable even if you don’t use all of the features that are enabled.
How to Install
Installation is pretty straight forward and only takes a few minutes. This example will be using Xubuntu 16.04. For Windows it’s even simpler as you just need to insert the CD as shown and then use it as you are most likely already familiar. (It should autoplay and run with no user action required). For Linux though there is some manual effort. So let’s get started.
- Start up the VM and log in to the desktop
- Insert the Guest Additions CD by clicking Devices in the VirtualBox container window and then select ‘Insert Guest Additions CD Image’.
- Now the CD will show on the desktop but not be mounted.
You can then double click to mount it.
- Now open a terminal and navigate to the folder path shown in the open, mounted guest additions CD.
- Once the terminal is in the same folder run the following command:
This command will run the autorun.sh shell script that will prompt you through installing the Guest Additions. It will ask for your password/root to run though as it will need to make system modifications.
The ./ allows it to have execute permissions and we are executing the shell script (they end in .sh). Autorun is the script that should run to kick off the entire installation process.
After a few moments you should see that it has installed and you can press Return (Enter) to exit.
- All that is left now is to reboot so the changes are available to your session. You could just restart your window manager, however rebooting is easy too.
That’s it. Once you run the autorun.sh script you can now start to use some of the other features in VirtualBox. However for other features such as sharing a folder from the Host to the Guest, you will need some additional configuration(adding a user to the sfvbox group). This will be covered in detail in my next article. So stay tuned to add it to your bookmarks for future reference.