ln -s keeps saying me that file system is read-only, however it is not.

➜ touch file
➜ rm file
➜ ln -s ~/.bashrc ~/virt/.bashrc
ln: failed to create symbolic link `/home/ice/virt/.bashrc': Read-only file system
➜ mount | grep virt
none on /home/ice/virt type vboxsf (rw,nodev,relatime)
➜ cat /etc/fstab | grep virt
VIRT    /home/ice/virt  vboxsf rw   0   0
up vote 33 down vote accepted

In Virtual Box 4.1.8, creating symlinks using a guest-OS in a shared folder has been disabled for security reasons.

For more information, check out this ticket: VirtualBox Ticket 10085 Disabled Symlinks To re enable, you can try running this command:

VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1

where SHARE_NAME is the name of your Shared Folder.

Alternatively you can downgrade to 4.1.6 and that should fix the issue.

  • Ok. Thank you. Now I have ln: failed to create symbolic link `/home/ice/virt/.bashrc': Protocol error – defhlt Jul 10 '12 at 10:59
  • Well, my bad. I was trying to create link to file in the guest OS's filesystem. which makes no sense, obviously. Vice versa it works: ln -s ~/virt/file ~ – defhlt Jul 10 '12 at 11:10
  • 2
    Very good solution, but this is reported to not to work anymore in recent 4.2 releases. Whenever I'm creating a symbolic link on a shared folder (independent of the destitnation) I get ln: failed to create symbolic link 'linkname': Protocol error It's just sad this hasn't been addressed properly. Any new work around verified to work in 4.2.6+? – gertvdijk Feb 12 '13 at 14:46
  • 3
    @gertvdijk if you're running a Windows host, you may want to run VirtualBox as administrator, it needs special privileges to be able to create Windows-style symlinks. – Ezequiel Muns Feb 28 '13 at 13:28
  • 2
    Don't forget once you have run this command to restart your virtual box machine – Jason Apr 27 '14 at 0:46

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.