Ahti Kitsik
Building tools with Python, Java, Go, JS. For enquiries email inbox@ahtik.com

writings biography

Fixing your virtualbox shared folder symlink error

16 Aug 2012 by @ahtik

Operations such as installing node.js or python virtualenv to a virtualbox writable shared folder can fail if you try to do this as a linux (ubuntu) virtualbox guest running Windows 7 host.

The cause is symlink permission.

Typical error:

ln -fs out/Release/node node
ln: failed to create symbolic link `node': Read-only file system

It can also be a "Protocol error".

This happens even if your shared folder is writable.

Fix: Enable symlinks feature in VirtualBox

Run at cmd prompt:

VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1

Verify by running:

VBoxManage getextradata YOURVMNAME enumerate

If your user belongs to Administrators group then start VirtualBox with "Run as Administrator"!

If user is not in Administrators group

By default Windows 7 security policy does not allow creating symlinks as it's a potential security threat. Run "secpol.msc" and navigate to "Local Policies-User Rights Assignments" and add your user to "Create symbolic links". I didn't try that but could be that after that virtualbox could be run as a regular user.

Speculation: The controversy is that users with admin group seem to be unable to create symlinks even after granting the permission unless they use "run as admin". Maybe symlink privilege gets filtered out for regular runs when user belongs to Administrators. Any ideas?

Let me know if it helps or if there's an easier way!

@ahtik is on twitter!