Install VirtualBox Guest Additions in Debian

Advertisement

Advertisement

Intro

When installing Debian or other Linux distributions as a guest in VirtualBox, you should install the guest additions for better integration. This allows shared clipboard, screen resizing, and more.

Steps

  • First, in the host machine, go to the VirtualBox menu: Devices -> Insert Guest Additions CD image.
  • Then, make sure the Linux kernel headers are installed for your version (apt install linux-headers-$(uname -r))
  • You'll also need to ensure you have compiler tools (apt install build-essential)
  • Run the VBoxLinuxAdditions.run script from the cd image as root. (bash /media/cdrom0/VBoxLinuxAdditions.run)

Summary

# In VirtualBox, go to the menu 
# `Devices -> Insert Guest Additions CD image`

# Then in the terminal:

# Switch to root
sudo su -
mount # To confirm if CD image was mounted on /media/cdrom0
cd /media/cdrom0
VBoxLinuxAdditions.run
apt install build-essential linux-headers-$(uname -r)
bash VBoxLinuxAdditions.run

For more details, see this video:

Advertisement

Advertisement