Enhancement Request: Allow synced folders on a WSL2 file system (ext4)
- Dominant language
- Ruby
- Stars
- 27.2k
- Forks
- 4.4k
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
**Is your feature request related to a problem? Please describe.**
Currently, Vagrant doesn't allow to have sync folders located on WSL2, the following error is returned
```
The host path of the shared folder is not supported from WSL. Host
path of the shared folder must be located on a file system with
DrvFs type.
```
However, this should be returned only when running Vagrant from WSL1. WSL2 uses actual ext4 file systems and it should be possible to have synced folders just like on a linux OS running bare metal.
**Describe the solution you'd like**
Not sure what's the best approach here but I was able to workaround this by changing
[this method](https://github.com/hashicorp/vagrant/blob/master/lib/vagrant/util/platform.rb#L42-L56)
to return `false` and building Vagrant from source.
Perhaps it should be split into `wsl1?` and `wsl2?` methods.
**Describe alternatives you've considered**
N/A
**Additional context**
N/A
Cheers!
Contributor guide
Research direction
Start in lib/vagrant/util/platform.rb at the method linked in the issue and trace how Vagrant detects WSL and validates host paths. The change should distinguish WSL1 from WSL2, preserving the DrvFs restriction for WSL1 while allowing ext4 paths on WSL2. Confirm the behavior against the reported error and the WSL2 workaround described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100