Hacker News new | ask | show | jobs
by davb 2627 days ago
I noticed file IO was slow too. My solution is to do most of my work in headless Linux VMs, using WSL as the interface to manage and connect to those VMs. This way I get the bash shell and ssh client I love but get isolated environments for my projects/clients. I run samba on the Linux VMs, with mapped drives on the Windows host so that I can edit files using VS Code. Outwardly it might look a little convoluted but I get isolation, performance, convinience and an ultra smooth host OS experience.

I say this coming from around a decade of running Linux or MacOS on the desktop. This just works.

1 comments

What do you use as your VM software? I take it VMWare has a pretty decent IO performance to host's files through HGFS when VirtualBox isn't as performing.
I'm actually using Virtualbox. In my case, the guest doesn't see the host's files - it's the other way around. 80% of the file operations happen within the VM, with the rest being in VS Code on the host (via a mapped drive pointing to the a samba share on the guest). This lets me preserve file permissions and allows me to backup or migrate my entire project by just copying the VM disk images. It also gives me all the performance I need (and with a ton of ram, my database workload rarely hits the disk, which is a fast nvme ssd anyway).

I'm not running a Windows Insider build, and the current version of WSL doesn't accurately represent the posix permissions on files seen via the /mnt/c mount (DrvFs). The next version resolves this by storing posix permissions and other meta data. In my case, being unable to manipulate the permissions causes us some problems. It makes a lot of sense to work on the files within the VM, in a native ext4 volume.