Getting Guest Additions to work
In this section you will find some information on how to get VirtualBox Guest Additions to work. If you get them to work you will be able to use higher resolutions (native to your display, especially for 4k and retina displays) as well as copy & paste between your host and guest.
Please note that while the instructions here should work, we DO NOT OFFICIALLY SUPPORT THEM. The Guest Additions can contain bugs, or the Kernel itself might contain a bug that will make using the additions impossible. We highly recommend you at least try to get them working, as it will make your life a lot easier.
With that disclaimer out of the way, let’s get started. First of all, you should have completed the setup guide up to – and including installing – the kernel. This will not work with version 4.9 of the kernel that comes built-in with Debian 10.7. You also need the latest version of Virtual Box (6.1.18 at the time of writing this).
Here is a quick check-list before you get started:
- Kernel v 5.5.0 built
- Kernel v 5.5.0 installed
- Latest version of Virtual Box ( ≥ 6.1.18)
When you built your own version of the kernel, the built process generated an additional binary file called linux-headers-5.5.0-cmsc421project0-USERNAME+_5.5.0-cmsc421project0-USERNAME+-1_amd64.deb
or similar. This file includes the headers for your own version of the kernel and if you install it, Guest Additions (as well as other programs) will know how to build themselves specifically for your version of the kernel! The only downside is that if you change the name of the kernel – i.e. the version string – you have to reinstall the headers and the Guest Additions.
So, you have to slightly modify the installation process you saw in Installing your Kernel. Instead of installing the linux-image.deb file alone, now you need to also install the linux-headers.deb file first:
cd /usr/src
sudo dpkg -i ./linux-headers-5.5.0-cmsc421project0-USERNAME+_5.5.0-cmsc421project0-USERNAME+-1_amd64.deb
sudo dpkg -i ./linux-image-5.5.0-cmsc421project0-USERNAME+_5.5.0-cmsc421project0-USERNAME+-1_amd64.deb
The linux-headers-blah_blah
file can have a slightly different name depending on how many times you have compiled or any mistakes you might have made in the version string. You can use ls
or ls -la
while in the /usr/src
directory to see what files are in there. Double and/or triple check the names if you are getting errors that the file was not found.
Now, from your Host OS and the VirtualBox menu go to Devices > Insert Guest Additions CD image...
. You will probably get a pop up about autorun or something inside your VM now. You can just hit cancel and ignore that. Inside your VM now use your terminal to:
cd /media/cdrom
this is where the cd contents are. It might also be cdrom0 instead.sudo sh ./VBoxLinuxAdditions.run
This will take a bit of time.
At the end you should see some messages about: compiling modules for “your kernel version here”. Make sure there are no errors saying that no headers were found. Once that is done you can reboot the VM sudo reboot
.
Congratulations you are done! You should be able to enable the shared clipboard now to copy and paste text between guest and host. You can find the option in Devices > Shared Clipboard
while the VM is running, or from the VM Settings > General > Advanced tab
when it is not running. If you are getting issues, keep reading.
Help I am still not done!
As we said early on, bugs happen. Here you can find some solutions to issues we have encountered so far.
I am getting graphic glitches (desktop, colours, whatever)
You need to change the Virtual GPU your VM is using. To do that you need to shutdown the VM, then go to the VM Settings > Display
and change the ‘Graphics Controller’ dropdown. The option depends heavily on what your hardware is, so you would have to experiment here. The recommended for Linux guests is VMSVGA
but try them all out to see what works for your current hardware combination.
I am getting an error that the filesystem format is unknown (ISO 9660)
You didn’t enable ISO 9660 support during the make xconfig
step while you were configuring your kernel.