Vagrant shared folder and symbolic links under Windows 10
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)
-
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']
-
Right click on GitBash icon and 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.
-
Related videos on Youtube
Kevin Horst
Updated on September 18, 2022Comments
-
Kevin Horst over 1 year
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?
-
das-g over 7 yearsWhat happens when you issue that
ln -s
command? Do you get any error messages? -
Kevin Horst over 7 yearsI 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"?
-
Don't Root here plz... over 7 yearsNothing has changed in the symbolic links part of Windows 10.
-
Ryan about 4 yearsFor me, running as administrator was not enough, and I still got "Protocol error" when trying to create symlinks. Here was what worked: stackoverflow.com/a/60741351/470749
-
-
Kevin Horst over 7 yearsthis doesn't work for symlinks as described above
-
Ramhound over 7 years"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 over 7 yearsI wouldn't have known it was an answer to this question, since you literally indicated, it wasn't an answer to the question.
-
velop over 6 yearsTo 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. -
UpTheCreek almost 5 yearsI use both these steps, and still have symlink failures when doing npm install for certain packages.