22

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

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

1 Answer 1

34

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.

9
  • Ok. Thank you. Now I have ln: failed to create symbolic link `/home/ice/virt/.bashrc': Protocol error
    – defhlt
    Jul 10, 2012 at 10:59
  • 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, 2013 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. Feb 28, 2013 at 13:28
  • 2
    Don't forget once you have run this command to restart your virtual box machine
    – Jason
    Apr 27, 2014 at 0:46
  • 1
    This does not work on Virtual box 5 Apr 7, 2016 at 5:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .