Problem: On a Windows host, Vagrant won't have symbolic links in the shared folder
If you are like me, you love Vagrant. One of the problems in recent months was that on my linux-guest system the symbolic links won't work. Long time I thought it's a limitation, but actually is just disabled for security reasons.
If you want to add symbolic links to your vagrant linux guest on a windows host inside the /vagrant directory you need to do two things:
vagrant upas administrator
- Add code to your vagrant file that Shared-Folders-Enable-Symlinks-Create is enabled
vagrant up as administrator
That's the easy part! If you have Mingw installed (comes with the git-bash) you just do something like this:
Add SharedFoldersEnableSymlinksCreate to your vagrant file
You'd have to add this part to your provider configuration:
config.vm.provider "virtualbox" do |v| v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"] end
A complete sample file for a Vagrant setup could look like this:
Vagrant.configure("2") do |config| config.vm.box = "scotch/box" config.vm.network "forwarded_port", guest: 80, host: 8080 config.vm.provider "virtualbox" do |v| v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"] end end
If you have any other tips, let me know in the comments!
Subscribe to Thomas'
From time to time I'm sharing more exclusive material via the Newsletter. For example free or super-discount coupons for quality courses, tickets, news, specials and many more cool things.
Put your email address in the field below to get all the exclusive content!