Curious on what you use, and how your experience might overlap with mine these days?
Curious on what you use, and how your experience might overlap with mine these days?
Any reason you specifically like NixOS on WSL?
My issues with WSL was more that it felt like an artificial barrier. The filesystem differences would cause slow churn if expensive operations crossed the barrier, so it just in general was things i had to think about. Wasn't a fan of that.
Pretty much the same reason I like NixOS on my Linux laptop and Nix-Darwin on my Macbook - single flake that I can use on all my machines so that they all behave in a predictable way.
I do most of my Rust development (with the exception of komorebi and whkd) on NixOS in WSL, using JetBrains IDEs running on Windows accessing projects in WSL and I haven't noticed anything causing churn, however I think this is probably language-dependent.
Generally I think it's a reasonable heuristic that any language which is a pain to develop with when source directories are mounted in Docker containers (JS/TS and the huge node_modules folders immediately jump out) will also have similar problems in WSL (though probably not _as_ bad).
Then install samba.
sudo apt install samba
Also install openssh if not already chosen during setup.Edit /etc/samba/smb.conf to uncomment/set these settings.
[homes]
browseable = no
read only = no
valid users = %S
Create a user for SMB, use the same username/password as your local Windows user for convenience. sudo smbpasswd -a username
Restart smbd, this command can vary depending on the VM OS/version. sudo service smbd restart
Mount the home directory (run this from the Windows command line.) You won't have to provide a password when authenticating, if you set the user/pw as I suggested above. net use z: \\vm-hostname\vm-username
I run git commands on the Linux side where all code projects live.You can go in the opposite direction (mount the Windows filesystem from within Linux) but I don't suggest that for the primary use case of code projects, it can introduce problems with permissions. But for one-off use cases I do sometimes mount the Windows filesystem in Linux. That requires following the VirtualBox instructions for installing "Guest Additions" and using the Shared Folders feature.
Run servers on the VM, access web sites/services on the VM hostname through the browser on the Windows side.
Not specific to this setup, but if you want to run a service on port 80 of the VM, run this command on whatever the actualy binary is for the server process. (Not a symlink.)
sudo setcap 'cap_net_bind_service=+ep' /usr/local/python-3.12/bin/python3.12This setup is simpler in the sense of not requiring a newish and ever-evolving layer from Microsoft. It's lame that Oracle owns VirtualBox now, but there's never been any pain with it so far.