-
Notifications
You must be signed in to change notification settings - Fork 834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
9p in WSL2 is unusable, please expose ext4 vhdx using Samba server instead #5103
Comments
Its going to be tough to cover the multiple topics on this one. 9p performance hangout is #4197. WSL2 uses a virtual network switch like Hyper-V. WSL uses p9 not SMB/CIFS for reasons. You can run Samba on WSL2, although you'll get better eyeballs in a Samba group forum than here. It isn't how I'd roll personally, but YRMV. For suggestions on best practices with MSVS and WSL you'll probably get better eyeballs where Visual Studio folks hang out, but maybe someone will chime in. Whatever is causing your |
I did some more work on this on Sunday. I configured a new VM in Hyper-V, installed Ubuntu 18.04 Server headless, then installed the Hyper-V Linux integration services using https://onpremisys.nl/2019/06/21/hyper-v-linux-integration-service-for-ubuntu-18-04. I adjusted the network switch configuration to enable RDMA and set Jumbo frames to 9k, and disabled Virtual Machine Queue (VMQ). I forced the Samba configuration on Linux to only ever use SMB3. This improves Samba performance even more, despite that Samba does not yet implement SMB Direct (RDMA) when Windows is accessing a Linux Samba server (the other way round, apparently, does now work). Re: the benchmarks on #4197, whilst the bandwidth is important, I think the real problem with 9p is the latency - compiling a large C++ project does a ton of random read i/o of small quantities, and 9p's high access latencies makes it a far worse experience for my use case than Samba, or WSL1. For my use case, going forth, WSL2 currently offers no benefits whatsoever over WSL1 or a hand configured Hyper-V VM. I'll thus be sticking to a combination of those in the medium term. I do however look forward to the WSL team considerably improving the shared Linux-Windows filesystem experience in the future, that's what I really need to work better than currently. A nice alternative is if Visual Studio ever began working well under wine, then I could run Linux as my main system, and compile and debug the Windows side of things entirely under wine. We'll see how things evolve. |
Please, take into account the following VERY POSSIBLE and VERY CHEAP laptop configuration:
|
My test system is a recent Dell XPS 13 with Samsung NVMe SSD. Its storage is very quick indeed. I ended up doing a little bit more work before giving up on WSL2:
|
My windows build number: 19041.207
My use case is a single source code checkout for a software project which is simultaneously built using both Windows and Linux using WSL. The key productivity gain WSL offers is being able to develop for both Windows and Linux by editing a single source tree from within Visual Studio, and running separate build directories for each platform from that single source tree.
Assuming that now that WSL2 is shipping into Release Preview and it would be production ready, I converted over an existing WSL1 image. I quickly realised that keeping the source tree on Windows and accessing it from Linux via /mnt/c was unviably slow. So I relocated the source tree from Windows into the ext4 vhdx, and tried it the other way round i.e. the single source tree lives within Linux, and Windows accesses it from \wsl$.
Windows accessing Linux via 9p is far faster than Linux accessing Windows via 9p, so that was better. Unfortunately, Visual Studio won't cmake configure from \wsl$ (I mounted \wsl$ as
U:\
):I noticed that accessing Linux from Windows via 9p is very noticeably slower than accessing a Linux running inside Hyper-V over Samba. So I installed a samba server inside the WSL2 Linux. Unfortunately, Windows does not appear to have a normal virtual network connection with Windows like a Hyper-V VM would have, and it cannot see the Samba server.
Can you therefore:
Make it possible for the WSL2 VM to have an ordinary, separate, network which performs standard DHCP IP discovery? I appreciate that this makes WSL2 more like Hyper-V, but in my opinion that is no bad thing.
Make it possible to replace 9p with a Samba served from the Linux VM? I'm not sure why you chose 9p, the SMB protocol would seem to me far easier to deeply paravirtualise between a custom Linux kernel and the Windows kernel. After all, the Linux kernel specifically implements oplocks in order to accelerate Samba! You (only!) need to wire together oplocks in the custom Linux kernel with those in the Windows kernel with a shared kernel page cache for filesystem content (which Samba already implements) to provide a superb shared-filesystem experience.
Assuming you're going to say no to my number 2 request, can you at least get cmake with Visual Studio working over a \wsl$ mount, and enable splitting of the network so the WSL2 network is completely separate from the Windows network so I can manually replace 9p with Samba?
Finally, I appreciate all of the above is a bit negative. I wish to send my thanks and gratitude to you and all the WSL team for WSL. It has transformed my personal productivity, and thank you so much for enabling that.
The text was updated successfully, but these errors were encountered: