I have a vagrant box with Linux inside under Windows 10 (VirtualBox 5.1.4, Vagrant 1.8.5). I'm working with the Git Bash as normal user. Inside the vagrant box I cannot create a symlink:

c:/path/to/my/vagrant-project/ vagrant up + vagrant ssh
/home/vagrant/my-shared-folder/ $ ln -s /any/path/to/linux/box/folder my-symlink-name
/home/vagrant/my-shared-folder/ $ ln: creating symbolic link `my-symlink-name': Protocol error

Under Windows 7 it was working with: How do I create a link in Windows 7 home premium as a regular user?

So, has anything changed under Windows 10?

  • What happens when you issue that ln -s command? Do you get any error messages? – das-g Aug 19 '16 at 12:20
  • I just added the error message to my question. I found out, that I have to start the Git Bash as administrator to get this running. Is there a way to extend the normal user with "create symlink permissions"? – Kevin Horst Aug 22 '16 at 10:35
  • Nothing has changed in the symbolic links part of Windows 10. – Don't Root here plz... Sep 10 '16 at 12:44

I was struggeling a long time with the same issue. Make sure that:

  • The VirtualBox Option "SharedFoldersEnableSymlinksCreate" is active for each Folder *1)
  • You MUST run the GitBash as "Admin" user because it seems that Usermanagement in Windows just allows the symlink creation for "Admin" users *2)

    1. You can do it manually from Windows command line (setextradata via VBoxManager) or via the Vagrantfile like

      virtualbox.customize ['setextradata', :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate//vagrant", '1']  
      
    2. Right click on GitBash icon and run as Administrator

      German version of "Run as Administrator"

    Afterwards you should be able to log into the vagrant box and create symlinks inside shared folders which showup in Windows explorer as .symlink files.

  • To my knowledge /vagrant in "VBoxInternal2/SharedFoldersEnableSymlinksCreate//vagrant" specifies the shared folder in which symlinks are allowed. v-root specifies the root of the vm. Furthermore symlinks are activated by default for v-root. – velop Aug 31 '17 at 12:25

There's already thread describing How to create a Symbolic Link on Windows 10.

I'm just quickly describing it once again. First Create a junction:

junction "C:\Documents and Settings\UserName\My Documents\My Dropbox\My Games" "C:\Documents and Settings\UserName\My Documents\My Games"

Create a directory symbolic link using mlink:

mklink /D "C:\Documents and Settings\UserName\My Documents\My Dropbox\My Games" "C:\Documents and Settings\UserName\My Documents\My Games"

Security settings to create a symbolic link can be granted here:

Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\

You can also download the junction and create by using the commands.

  • this doesn't work for symlinks as described above – Kevin Horst Aug 22 '16 at 9:08

If the symbolic links are created in the host (Windows) operating system using mklink with option /d and relative paths, then they are synced into the guest machine, also while running vagrant without admin privileges or any extra rights.

mklink /D somelink ..\..\some\relative\path

Vagrant: 1.9.1, VirtualBox: 5.0.32

PS: mklink still requires admin privileges

  • "This is not a solution to the original question" - If it is not an answer to the question that was asked, then why are you submitting it as an answer, to the question that was asked? Please take into considering that commentary should never be submitted as an answer. – Ramhound Jan 24 '17 at 15:01
  • I wouldn't have known it was an answer to this question, since you literally indicated, it wasn't an answer to the question. – Ramhound Jan 25 '17 at 16:12

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.