Skip to main content

VirtualBox: Install Guest Additions in Linux VM

As mentioned in my previous post, I found VirtualBox pretty easy to install and make work. My only real difficulty was figuring out how to install the "Guest Additions" on Linux, as this is poorly documented. The "Guest Additions" are the VirtualBox equivalent of the "*-tools" of the commercial VM's and provide closer integration between the VM and host environment, so you usually want to install them.

Here are the steps I used to install the "Guest Additions" on Debian 8 & 9 with VirtualBox 6.1.*:

Step 1: Prepare for building a kernel module

$ sudo apt-get install build-essential module-assistant
$ sudo m-a prepare

Step 2: Run the Guest Additions install

  • Click the VirtualBox Devices menu on the VM.
  • Click "Insert Guest Additions CD image..."
  • Run the installer:
$ mount /media/cdrom
$ sudo sh /media/cdrom/VBoxLinuxAdditions.run
$ sudo reboot

Step 3: Fix permissions issue with shared folders

Unfortunately when you share a host folder with the VM, VirtualBox uses a group that normal users don't have (vboxsf), so I also added my user to that group:

$ sudo adduser <your user> vboxsf

Comments

Popular posts from this blog

Emacs and MacOS Catalina

Catalina introduced a lot of security changes and the most intrusive is probably all the popups asking to give permission for apps to access directories under Home, like Documents. Worse still, apps which weren't written to handle the new security measures might just fail silently with no clues for the user. A solution is to give apps like Emacs "Full Disk Access" under "Security & Privacy" in Preferences, to give unfettered access to your files and avoid all the popups and silent failures. Sounds good, but that doesn't actually work for Emacs because "Emacs" in the app bundle is actually a Ruby script which decides which flavour of Emacs executable to run. This never mattered before, but it does under Catalina because MacOS thinks the executable is /usr/bin/ruby . Conventional wisdom is therefore to give "Full Disk Access" to Ruby. While this does work, I've always been uncomfortable giving all Ruby scripts full access...

Merging Git Repositories

No project of significant size that I've ever seen has retained its initial structure. Restructuring projects is a fact of life, but unfortunately Git doesn't make it easy. Fundamentally this stems from the way Git works, treating changes as a succession of snapshots and not storing any other metadata. Of course this is part of what makes Git fast and efficient, but at the expense of making some common operations more difficult for users. Git really is a perfect 21st century illustration of the classic  "Worse Is Better"  paradigm of successful software 😀 Previously I discussed how to split a Git project apart into separate repositories . Now I'm going to discuss how to do the opposite and merge separate repositories into one. On the face of it, this would seem a simpler task as Git has powerful support for merging... Let's take the opposite example to my splitting apart article - say you have a main Git repo (ProjA) and a second repo (ProjB) in...

Convert Parallels Disk to VirtualBox VDI

I used to use the free Parallels Desktop Lite on the Mac App Store to host various Linux virtual machines for software testing purposes. Although I'd heard things about the company's business practices, I thought it was a pretty fair deal allowing people to run free OS's for free - you only had to pay to run Windows. However about a year ago they introduced a mandatory subscription (at £74 per annum) even to run Linux, in the guise of a normal software update. None of this was mentioned in the update info - Nice 😡 No worries I thought (this is the polite version) - I'll just restore the previous version from Time Machine and Bob was indeed my uncle. This plan worked fine until I upgraded to Catalina and sure enough Parallels would no longer run. Rather than pay the Parallels ransom, I decided to investigate the alternatives. After some research I settled on VirtualBox, a free open-source VM from Oracle. VirtualBox was surprisingly easy (for an open-source pro...