vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Fix WSL 2 Docker Volume Sync Issue

Open thed24 opened this issue 5 years ago • 8 comments

By adjusting the conditional check for the file system, we can also check for 9P systems, which is what WSLs server is classed as. After changing this, we no longer get the error regarding the project being stored on the incorrect filesystem, however there still is an issue with pathing, as it formats the source location according to Windows pathing standards, although we're using WSL. If WSL is enabled, we want to use standard unix pathing as Docker recognizes that when mapping it's volumes. These changes allow for dockers folder sync to work.

Please note as this is WSL specific, it requires the Environment Variable VAGRANT_WSL_ENABLE_WINDOWS_ACCESS to be set.

thed24 avatar Aug 04 '20 12:08 thed24

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Aug 04 '20 12:08 hashicorp-cla

Adjusted to use masters Ruby version. This should solve issue #11705 and #10576!

thed24 avatar Aug 17 '20 07:08 thed24

Thanks for this pr. I was struggling with getting vagrant to work in wsl2 as well. I've went a step further and added "ext4" to the filesystem list in lib/vagrant/util/platform.rb. This allows us to use docker and a wsl2 ubuntu-vm according to the docker "best practices" https://docs.docker.com/docker-for-windows/wsl/. this provides a nice performance boost.

As I'm not sure about the implications this might have to others I'm not going to add to this pr.

vafschoen avatar Oct 13 '20 15:10 vafschoen

@vafschoen I'm glad this PR was able to help. I might attempt to test adding that file system myself as that definitely does sound like a nice change!

thed24 avatar Oct 14 '20 03:10 thed24

Has this functionality or similar changes been incorporated into master yet? @chrisroberts

DominicCodespoti avatar May 31 '21 00:05 DominicCodespoti

Bump. Can someone please merge and release this ?

I'am using this pr as custom based on 2.2.10 version on my windows, no issues so far.

Thanks 😊

vafhornung avatar Jul 28 '21 14:07 vafhornung

This change is going to be reviewed as part of a batch of proposed WSL changes in an upcoming release. It's good to hear it has worked for at least one user, but we want to make sure it doesn't break anything else. Labeling this so it gets picked up when we make our WSL sweep.

phinze avatar Nov 18 '22 19:11 phinze

This change is going to be reviewed as part of a batch of proposed WSL changes in an upcoming release. It's good to hear it has worked for at least one user, but we want to make sure it doesn't break anything else. Labeling this so it gets picked up when we make our WSL sweep.

Any progress on this? :)

thed24 avatar Dec 07 '23 06:12 thed24