2017-02-17
HowTo: Running Vagrant with Symbolic Links enabled
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.
Update September 2019: I actually changed my mind about Vagrant, I use Docker now. And I have a free walkthrough to get started with basic Docker commands for absoluste Docker Beginners. You will learn how to have a development environment on Docker instead of Vagrant. Much faster, much easier :)
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:
- Run
vagrant up
as administrator - Add code to your vagrant file that Shared-Folders-Enable-Symlinks-Create is enabled
Run 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! require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us8.list-manage.com","uuid":"f5be3d1590467a2ab0745ebee","lid":"b00a1333a7"}) })