TLDR: Activate the Windows feature “Create symbolic links”, then symlinks within Vagrant/VirtualBox shared folders will work. How-to: SuperUser.com
For some of our projects, we are using Vagrant with VirtualBox on Windows. If you do the same, one thing you probably noticed is that you then cannot use symlinks within shared folders. This is especially annoying as dependency managers like npm and composer are sometimes symlinking a binary to from a package folder into
node_modules/bin/<binary>. While workarounds exist (such as
--no-bin-links in npm), this gets annoying & sometimes the workaround do not work.
Turns out - symlinks work just fine on a Windows host, but you need to activate the feature. You need to grant your Windows user the permission “Create symbolic links” (How-to: SuperUser.com. Please note: Activation has to be done by a user with admin privileges), log out and log in again ⇒ and symlinks within shared folders will just work (Vagrant automatically uses the feature, as documented in their docs) 😍
Maybe you can now remove some of these ugly workarounds (I certainly could) 😁
Note of warning: There is a reason this feature is not activated for standard users - security. Enabling this feature has some security implications (which, in my opinion, are worth it if you are developing software). Please see this Microsoft documentation entry for information about the symlink feature & its security implications.
- Generating a random string on Linux & macOS
- Caddy web server: Why use it? How to use it?
- Tailwind CSS: A Primer
- Versicherungen: Learnings
- Screen Recording on macOS (without any extra tools)
- WSL2 Cheat Sheet
- Install Docker in WSL2 (Ubuntu) without Docker Desktop
- Converting a Slack message to Markdown
- VirtualBox & macOS Monterey: Fixing 'Kernel driver not installed (rc=-1908)'
- Notes on Productivity