8

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?

3 Answers3

2

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.

0

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.

0

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