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!