Symlinks within shared folders in VirtualBox: Operation not permitted and Read Only Filesystem

Note: This post is 9 years old. Some information may no longer be correct or even relevant. Please, keep this in mind while reading.

This is not a bug, it is a security feature of Virtual Box. Nevertheless it is annoying when you want to use your virutal system as a build system which needs symlinks in shared folders. To enable symlink creation, do the following:

Shut down your virtual machine, close all VirtualBox windows, including the main GUI window

VBoxManage setextradata MACHINE_LABEL VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_LABEL 1

For example, if your virtual machine is called “Debian Wheezy” (with a space), you have to escape that space with a backslash. In my case, I had to do:

VBoxManage setextradata Debian\ Wheezy VBoxInternal2/SharedFoldersEnableSymlinksCreate/Public 1

To check if your setting has been taken, run

VBoxManage getextradata MACHINE_LABEL enumerate

Restart your virtual machine and creating of symlinks should work. I found that creating hard links still doesn’t work with this method. If anyone knows a fix for hard links, please let me know!

How to install Guest Additions with Folder Sharing on VirtualBox – The Debian Way

Note: This post is 9 years old. Some information may no longer be correct or even relevant. Please, keep this in mind while reading.
Debian Wheezy as guest Operating System with Folder Sharing

I always forget where to download the proper version of the Virtualbox GuestAdditions, so here is a short tutorial about how to do it quickly and easily in the Debian way. I always need folder sharing between the guest and host OS, so you will see how this is done also. I will be using the current stable distribution Debian Wheezy as host system (without a running display manager, just the console), and  as the guest system also Debian Wheezy. It turns out that Debian has even packaged the Guest Additions for virtualbox.

First, install Virtualbox and the Guest Additions:

apt-get install virtualbox virtualbox-guest-additions

Then install Debian Wheezy as a guest system. Next, mount the Guest Additions ISO file by navigating through the menu system of Virtualbox:

  • Devices -> CD/DVD Drives -> Coose a virtual CD/DVD disk file …

Choose the ISO from this path:

/usr/share/virtuabox/VBoxGuestAdditions.iso

Next, in your guest OS, mount the virtual CD, and run the installer:

mount /dev/cdrom /mnt
cd /mnt
./VBoxLinuxAdditions.run

Next shut down your guest OS (don’t to this in your host OS 😉 ):

halt

Now set up the shared folder in the menu system of Virtualbox:

  • Settings -> Shared Folders -> +
  • Select Folder
  • Check “Auto-mount”

Re-start your guest OS, and you will have the shared folder auto-mounted in /media/sf_Public . Voila!