5 ms·
I'm definitely interested in WSL for developing, but last time I tried it a while back (WSL2 just came out I think), there was basic functionality missing e.g.
by 600frogs 6y ago
I'm definitely interested in WSL for developing, but last time I tried it a while back (WSL2 just came out I think), there was basic functionality missing e.g. I couldn't write and run my own SystemD services. Has the situation improved since then?
When you say "proper Linux distribution", I assume that's still CLI only? Do you develop with e.g. emacs, vim on WSL, or do you have some IDE with remote running and debugging into WSL? Or have a missed a trick and in fact X/Wayland applications can be run on WSL?
- abdusco 6y agoIt's not full-on systemd, but you can run init scripts on WSL startup as of Insider Build 21286. https://blogs.windows.com/windows-insider/2021/01/06/announcing-windows-10-insider-preview-build-21286/ https://blogs.windows.com/windows-insider/2021/01/06/announc...
- Tenoke 6y ago>When you say "proper Linux distribution", I assume that's still CLI only? Do you develop with e.g. emacs, vim on WSL, or do you have some IDE with remote running and debugging into WSL? VScode directly connects to WSL. You can open folders/files with 'code <folder>' from the WSL terminal, save, run whatever from VScode etc. As for Docker, you can also use the GUI from within Windows that automatically connects to WSL but admittedly I almost never use the GUI.
- 600frogs 6y agoI did try VSCode remote running and debugging, but found it fiddly to work with and half-baked. Plus, I was sorely missing IntelliJ, so I quickly stopped trying it out - maybe I'd get used to it eventually, but it didn't seem worth the onboarding cost. The RDP and X410 solutions suggested in the replies to GP seem solid though.
- nickjj 6y ago> I assume that's still CLI only? If you install an X server on Windows you can run graphical WSL apps. It runs really well too. Years ago I used to run Sublime Text straight from within WSL. I've been using WSL / WSL 2 for a few years now for full time web development. A while back I made a video going over all the tools I use and how I have Docker, WSL 2 and a bunch of other things configured at: https://nickjanetakis.com/blog/a-linux-dev-environment-on-windows-with-wsl-2-docker-desktop-and-more https://nickjanetakis.com/blog/a-linux-dev-environment-on-wi...
- nwatson 6y agoI run VcXsrv X-Window on Windows (Multiple windows mode) and then from WSL2 Ubuntu I've run e.g. "terminator" and Jetbrains CLion C++/Rust GUI, Linux Version "~/bin/clion.sh &". It works very well.
- nickjj 6y agoYep, that's what I cover using in the video linked above too. VcXsrv is so good. Nowadays I mainly use it to share my clipboard between WSL and Windows so I can use native Linux tools that copy to the clipboard without resorting to any hacks.
- vetinari 6y ago> there was basic functionality missing e.g. I couldn't write and run my own SystemD services. Has the situation improved since then? No. WSL2 uses it's own, minimal (proprietary) init, which basically launches default shell for the configured user and that's it. No service management in sight, and no equivalent of systemd's user scope or user session either.
- meddlepal 6y agoYou can boot the WSL vm with systemd but it requires some fiddling. That said, I've been playing around more and more with WSL2 on a secondary machine as a current primary Fedora user (for about 10 years now) and I really haven't found a good reason why I would need systemd in the WSL2 VM vs the custom init.
- vetinari 6y agoIt is like Excel - most people use at most 20% of the functionality, but any competitor that implements only 20% is not usable. Most WSL2 users use it as shell to run occasional ELF/x64 binary that runs in console; for services, they would use Docker Desktop for Windows. Anything beyond that and you will quickly find out, that it is not really a standard linux distribution.
- aseipp 6y agoA major use case I have for WSL2 requires systemd, full stop (it's critical for the package manager I use.) It's pretty painful not having it available, and this is really something that needs improvement IMO. To be fair, this could be fixed in the software too (to some extent, not fully but working) which would also be a solution. But I suspect this isn't the only problem people encounter. There's a lot people use modern Linux for. In practice that hasn't been a roadblock for me, because VMWare Workstation 15.5 finally supports running on top of Hyper-V, so I can have both working at once. Moving everything to a single hypervisor API has some nice benefits...
- strictfp 6y agoOne possible solution to this is removing systemd from all distros. That way you won't need it for your package manager anymore.
- tyingq 6y agoThere's this for running systemd inside WSL2: https://github.com/arkane-systems/genie https://github.com/arkane-systems/genie
- e12e 6y ago> still CLI only? With openssh in windows, it's been quite easy to run an x server in windows, and use ssh with x forward for gui access. But rdp feels more native to windows, and both x and Wayland has rdp server backends - so you can do things like: https://www.nextofwindows.com/how-to-enable-wsl2-ubuntu-gui-and-use-rdp-to-remote https://www.nextofwindows.com/how-to-enable-wsl2-ubuntu-gui-... But apparently ms is working on a Wayland compositor allowing directly running gui apps - I don't think it's quite there yet: https://www.phoronix.com/scan.php?page=news_item&px=Microsoft-Writing-Wayland-Comp https://www.phoronix.com/scan.php?page=news_item&px=Microsof... https://github.com/Microsoft/WSL/issues/938#issuecomment-763098682 https://github.com/Microsoft/WSL/issues/938#issuecomment-763... Somewhat related: https://ltsp.org/ https://ltsp.org/ I'm not sure about the state of a non-x rdp server for thin clients though.
- 600frogs 6y agoThanks for the links, some interesting stuff there! I think my end goal is to have a contained development environment whilst not being forced to use specific tools (i.e. VSCode remote debugging, eugh) and not sacrificing compilation times by running in a VM that's too slow. From the look of it, if I were to set up the WSL2 Ubuntu GUI with RDP, that'd tick all the boxes, right? And as a bonus I'd be able to access files in WSL2 from Windows. Any idea how WSL2 interacts with VPNs? I've seen some mixed reports around the web but this is also a must-have for me, if I can't use a VPN in my dev environment it's game over.
- hazaskull 6y agoYMMV but for me personally with Dell Sonicwall it basically does not work (even workarounds that mess with MTU sizes are unstable). In my case the behavior is that general networking speed drops massively as soon as both VPN and WSL2 are active. I had to revert back to virtualbox, which does not have such problems and as a bonus allows me to run proper systemd (another thing missing in wsl)
- 600frogs 6y agoInteresting, that might be a dealbreaker then. Have you found significant slowdowns in working in a VM vs native, both in terms of compilation and day-to-day work, or has it been negligible/unnoticeable? P.S. thanks for making an account just for this reply :)
- meddlepal 6y agoThere's definitely a few quirks. My biggest annoyance right now is https://github.com/microsoft/WSL/issues/5762 https://github.com/microsoft/WSL/issues/5762 . Note this only impacts calling the Linux go toolchain from the Windows side (via the /$wsl/ path). Its not an issue inside WSL... but it comes up when you want to say configure Windows IntelliJ/GoLand to use the Go compiler hosted inside of the WSL VM. > When you say "proper Linux distribution", I assume that's still CLI only? Do you develop with e.g. emacs, vim on WSL, or do you have some IDE with remote running and debugging into WSL? Or have a missed a trick and in fact X/Wayland applications can be run on WSL? You can run X apps just fine in WSL2 as long as you have a display server running on the Windows side. I use X410. Important to note, Microsoft is working on native Wayland support long term. For what it is worth, I run IntelliJ/GoLand from inside of WSL and use X410 to render the GUI. This works great.
- 600frogs 6y agoYour set-up sounds exactly what I'm after - from my comment to a different reply: > I think my end goal is to have a contained development environment whilst not being forced to use specific tools (i.e. VSCode remote debugging, eugh) and not sacrificing compilation times by running in a VM that's too slow. Are there any other gotchas to working like this? As it happens I'm a go dev using GoLand so your go-specific issues are of interest to me. I'm not too bothered about not being able to use Windows GoLand as I'd be just using it from WSL2 anyway, but I'd be interested to know if there are any other pain points. Any issues with VPNs, if you're using them?
- meddlepal 6y agoI haven’t tried a VPN yet, but I have heard of some possible quirks due to how the networking is handled between Windows and Linux in HyperV Edit: Im switching from Fedora to a WSL setup for work in the next week. Ill report on issues I encounter in that migration. I suspect VPN will come up because one of the key reasons im switching off Fedora to Windows+WSL is due to corporate VPN requirements.
- 6y ago
- rcarmo 6y agoRe: CLI, there is ongoing work on getting graphics support for over a year now: https://lkml.org/lkml/2020/5/19/742 https://lkml.org/lkml/2020/5/19/742