40

A few days ago I found I can no longer create symlinks from Ubuntu in any directories that are shared with the OS X host.

ln: creating symbolic link `foo': Read-only file system

I'm able to create symlinks in non-shared folders and on OS X directly. I've also tried running disk repair, but no errors were found.

Setup:

  • OS X 10.6.6
  • Ubuntu server 11.04
  • Virtualbox 4.1.8
rlayte
  • 509
  • 1
  • 4
  • 5

3 Answers3

46

Another workaround is to run the following command on your host:

VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1

Or on Windows

VBoxManage.exe setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1

where VM_NAME is the name of your virtual machine (e.g Ubuntu) and SHARE_NAME the name of your shared directory (without the "sf_" prefix).

This will re-enable the previous symlink friendly behavior.

Note: On Windows, always restart the Virtual Machine AND VirtualBox GUI.

schisamo
  • 569
  • 4
  • 3
  • How do you run that on a Windows host? – Chris Pratt May 02 '12 at 18:40
  • 1
    @Chris, VBoxManage is located in the Program Files directory (e.g. C:\Program Files\Oracle\VirtualBox\VBoxManage.exe). That said, I have not been able to get the solution to work for me yet when hosting on windows (details at https://www.virtualbox.org/ticket/10085#comment:16). – studgeek May 16 '12 at 04:08
  • @schisamo can you confirm this actually worked for you on Windows/NTFS? I (and others) still get "read only file-system" as I describe in the ticket at https://www.virtualbox.org/ticket/10085#comment:16. – studgeek Jun 14 '12 at 20:19
  • Couldn't get this to work with a Windows host – OlliM Jul 02 '12 at 12:39
  • 2
    This solution helped. The only thing you mustn't forget is to change SHARE_NAME to your actual share name – n1313 Oct 03 '12 at 16:28
  • 1
    Restarting VBox GUI is also important – Jayesh Jan 03 '13 at 16:23
  • This worked for me (Host: Kubuntu 14.04 x64, Guest: Kubuntu 14.04 x86) though I had to switch to the "VirtualBox VMs" folder on my machine to avoid a "Could not find a registered machine named ..." error. – Autodidact Feb 09 '17 at 08:43
  • 4
    Tried this on Windows, afterward got "protocol error" when creating links. Running VirtualBox as admin seems to have resolved it. – Tahlor Sep 18 '17 at 18:21
  • Could you please explain in details: SHARE_NAME the name of your shared directory (without the "sf_" prefix) – numediaweb Jan 02 '18 at 15:10
  • 1
    worked as a ubuntu host after restarting the virtual machine – gebbissimo Jun 13 '19 at 16:34
  • Found on VirtualBox 6.1.4 too. Resolved with `Run as administrator` and the procedure explained in this answer for windows. – GabrieleMartini Feb 28 '20 at 15:24
  • ANy exmaples of SHARE_NAME? for windows host is it name of the folder in linux guest e.g. /home/myuser/shared_lin or windows host "d:\mystaff\shared_win" – Serge Dec 05 '20 at 20:21
13

On a windows host - run the virtual machine instance as an Administrator. I found this solved the problem.

-- I tried @schisamo's suggestion first - it may be necessary to do both. Apologies I would have added this as a comment but I'm so rep-poor I can't even comment ;-)

wardw
  • 230
  • 2
  • 4
  • running as administrator worked – Marian Zburlea Aug 13 '19 at 10:33
  • The combined solution worked for me. `Host OS : Windows 10 64 bit , VirtualBox version: 6.0, Guest OS : Ubuntu Xenial` . So, I ran the command as given in the accepted answer from my Windows host : `"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" setextradata net1mc1 VBoxInternal2/SharedFoldersEnableSymlinksCreate/shared3 1`. `shared3` is the name of the shared folder given while creating the share. Then, I restarted VirtualBox as Admin user, and restarted the VM too. After this, I was able to create symbolic links from the guest OS's shared directory. – Binita Bharati Nov 21 '19 at 05:28
8

This appears to be a bug in VirtualBox 4.1.8. Some people report that downgrading to 4.1.6 resolves the issue. See https://www.virtualbox.org/ticket/10085

mig5
  • 81
  • 1