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.
- 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.runscript from the cd image as root. (
# 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: