Porting a macOS Clojure Dev Setup to Windows WSL2
blog.michielborkent.nl
blog.michielborkent.nl
I've been using WSL 1 + Docker for full time web development since early 2018 on Windows 10 Pro.
Upgraded to WSL 2 when it hit the stable release and it works quite well. The only thing that sucks is mount performance for files outside of WSL 2's file system but if your source code is inside of WSL 2's file system it's very solid.
This is with ~$850 worth of 6 year old hardware too (i5 3.2ghz, 16gb of RAM, 1st generation SSD, etc.). I never bothered to upgrade because everything I do around Flask / Phoenix / Rails / Node development + running Docker / VMs + etc. works great. I do video editing too.
If anyone is curious what it's like, I made a video where I went over all of the tools I use on Windows and WSL 2 to have an acceptable dev environment for Linux based development https://nickjanetakis.com/blog/a-linux-dev-environment-on-wi....
It covers both the Windows tools and how I have everything configured on the WSL 2 side of things (tmux, terminal Vim, etc.).
You could exclusively run npm commands inside of WSL 2 and never have to touch cmd.exe.
I only use it for Dropbox since my org files live there but I ended up installing the Dropbox CLI instead.
It kinda sucks though since WSL 2 doesn't have a proper init setup meaning I have to manually start Dropbox's daemon anytime I restart
Does using Powershell instead of CMD solve this for you perhaps (I mean, it does wrt UNC, but I don't know what else you're doing with it)?
This is the advantage of the development model behind Linux "drivers." People with serious commitment to code quality review them. They typically should work more reliably.
I usually don't complain about anything Windows, but certain OEMs (Dell, HP) clearly care only for hardware. I've been suffering through a comedy of awful drivers, culminating in using my phone to print.
I wish WHQL did more thorough testing.
- have an Ubuntu dev environment,
- while benefiting from Win's RDP
- AND also having access to native Windows for testing.
Because Clojure runs perfectly well on regular Windows, it's not like WSL is required. So otherwise the author would have to have a separate Windows install just for testing.I've been doing Clojure stuff on a pure Windows setup for quite a while and honestly I liked it more than my current Linux setup (only switched because of some linux kernel features I needed).
[0] note that ansi-term is (or used to be) broken on Windows tough , other than that pretty much everything works
Java/Clojure same deal. There's no problem with them on Windows. Running everything under WSL sounds like a big compromise to make to me. Though for Java/Clojure I could imagine you could still for most projects start your software from the normal java.exe as jars generally don't have platform specific code. But in my codebase I do actually use a few libraries that are system specific.
(I guess maybe not WSL2)
Or let's say you have to compile something that you want to use as a child process in your software. If you compile that under WSL (correct me if I'm wrong[0]) it's not going to be easily accessible to normal Windows apps.
[0] I see that now there's some way to invoke wsl commands from regular Windows but not sure how that works exactly.
For most of the users doing a lightweight work, it might not be a problem but my repository is extremely huge and building on WSL 2 takes at least 5X more than natives Widnows or MacOS.
https://github.com/microsoft/WSL/issues/4197
edit: My use-case for WSL 2 is that I have codebase that only runs on windows / Linux. Switching between the two is cumbersome and VM takes a hit on performance. If I didn't need Windows then definitley no need to use WSL 2 and just go for Linux/MacOS
Also if we must be fair, Windows still has no way to reliably install Windows updates through SSH, because you apparently cannot elevate yourself, without even if you are logged in as administrator. I still need to RDP into my Windows instances while every other OS can conveniently be updated using just a few shell commands.
Also, most if not all compilers (GCC is a number 1 offender here) are much slower than Linux or macOS under Windows. It all depends on what you do, what kind of user you are and what kind of job you are trying to do. No one uses something worse on purpose, so there sure must be reasons why people still say installing Linux is worth it. WSL is good for those who would have run Linux in a VM anyway, but if you need Linux or if you're just used to it, it's still not enough.
This is not very accurate. Just the compiler/linker (which doesn't need the SDK to build and run programs, i.e. equivalent of getting just gcc) is about 300mb to download. Then, assuming you're talking about the Windows SDK, which as far as I'm aware you only need when targetting OS-specifics is abut 700mb.
If you are forced to use Windows (often corp IT are not competent enough or are simply not willing to spend extra resources on Linux support and are forcing Windows on users), then WLS2 is an option for running Linux. But I'd never pick it as a first choice.
And WSL2 is good enough for personal development that I use it on my desktop as well -- I don't want to waste time fucking around with drivers or dual booting for something I do infrequently anyways.
I've always found Windows to be the huge pain in the rear end, not Linux.
- `radeon` is in the box (for Fedora, I assume Ubuntu) and has worked on half a dozen different cards over the last decade. I've never installed `amdgpu` but it looks no more difficult than nVidia's proprietary drivers?
- Thunderbolt is a continuing problem, though TB3 is significantly improved IME. Docks and multi-monitor over DisplayPort MST are fine. Haven't tried PCIe extensions.
- Many-buttoned mice work better than they do on Macs, I'll tell you that much.
I bought a WiFi + Bluetooth PCIe card last month; it was one of those cheap Chinese no-brand cards that consist in an Intel WiFi chip slapped on a board. It worked instantly without installing anything, with just the drivers shipped in the Linux source tree that every distribution has. My mouse is a Logitech mouse with 5 buttons and it too works out of the box.
How long has it passed since the last time you installed Linux? It has changed a lot in the last 10 years; lots of things work flawlessly now. I haven't had to meddle with any driver since at least 2010, when my shitty ATi Radeon X1600 still only worked under FGLRX or when I tried to use a crappy Chinese WiFi dongle whose drivers were only distributed as source on a CD (damn you realtek)
Sometimes Windows Update can't automatically find an appropriate driver the first time a device is connected and I have to install one manually. Time lost: fifteen minutes, tops.
Linux:
Last time I bought a USB wifi dongle, I bought one with a Linux penguin on the box. It turned out that the driver was a realtek fork and I had to manually apply their patches and rebuild every time my kernel updated. Could never get DKMS working quite right. Time lost: two hours.
I have dual monitors, one running on an Intel integrated card, one running on NVidia. Either one can run on the open source drivers alone, but I cannot activate both at the same time. The Intel drivers output hot garbage when Nouveau is running. There's a "flicker free" mode which eliminates a similar problem, but the Intel driver appears to ignore my config in this duel head configuration. Time lost: eight hours.
WiFi device comes with CD but I have no CD-ROM. Then I try to google this no name brand and find the official website but fail.
I plug the device in Linux and figure out exactly the real chip used (many devices reuse same chips and put their own antenna and branding on top).
Now I know the real chip name but the guys that make it do not offer driver downloads to regular users, so I need to Google and find some driver.
Then the next problem, what website that offers driver downloads should I trust? I never heard of any of them, in the end I remember that many years ago I was downloading stuff from softpedia, decided that I already spent too much time on this and since it was my son PC I can risk it and grabbed a few potential drivers from there.
After that I needed to refresh my memory how to install drivers when you don't have a wizard and read a quick tutorial and follow it.
Conclusion, there are tons of hardware , as a Linux users in more then 15 years I can list only this issues(I am not using 4K or multiple screens setups):
- a few years back AMD catalyst driver dropped support for my 1 year old laptop (maybe the chip was older) forcing me to decide if I use older software or the crappy at that time open source software ( this costed AMD sicne I bought NVIDIA next time)
- for latest NVIDIA driver I just need to google , find and enable and official repository and now I can install from a list of drivers versions, I do not need to make an NVIDIA account to get updates.
- my Cannon printer was detect fine, I had to select a similar model from a dropdown and change a setting from RGM to CMYK (I had to google this)
- I had issues with microphones on cheap headphones, my solution was to buy USB headphones - they just work (including Microsoft ones) no driver installs
I never had to install an audio or network driver on Linux, on Windows I had issues with same hardware where installing drivers from Windows and not from the original CD would make the audio and network conflict (both were Realteck chips and Windows would get confused).
Btw I am not saying your experience is not happening, I am sure that some new hardware will be missing support and some other hardware might experience bugs, I added my experience to put things in balance.
Linux: Software setup is really easy. All hardware worked out of the box.
MacOS: Reading instructions, preparing installer etc. Got it "working" in a VM but without graphics accel, which makes it not really useful.
Time lost: A few hours more for windows, but quite comparable.
I hate getting jerked around by Apple but not as much as I hate driver issues.
I just said until they (contributors, obviously) have a better solution, I'll choose to pay for a desktop environment that suits my needs.
Oh, that is changing and very quickly.
Even Microsoft is on board, for some reason.
Honestly, Pop_OS! on the same setup is much smoother. Probably something to do with the HiDPI Daemon it has running.
The only flawless operating system on this 4k external setup has been macOS. Can't think of any problems and that's my daily system.
With regard to Win32 apps appearing blurry, I think that's a fair compromise considering Windows heavy focus on backwards compatibility.
Probably. It's Windows 10 build 2004 or something.
The mac I have is mid-2014 w/ Mojave (also Catalina), and I'm using the hdmi out. It seems to remember the display, moves the applications I had on it last time to it, with all the other details like wallpaper scaling settings. It takes maybe 1/2 second to display.
On other screens with different dpi basically the only apps that look right are the ones using the latest dpi aware api’s.
It's not perfect, but it's fine. WSL2 is also great for some use cases, but for anything JVM-based I expect first-class support for JetBrains tooling and that really doesn't work well. Keeps me solidly on a Linux desktop for now.
(Now it's a 3900X with a 2070S and surprise, still none.)
Here, 4k with Vega and Mutter/Wayland is flawless.
Even the Windows issues with HiDPI are non existent on Kubuntu. Really a good OS.
I personally use pretty much all the major OSes, and I think each one has its ups and down. I still think that Linux can potentially offer a much leaner and snappier experience than the other OS, because you can actually control what goes into your system and what runs and when. I also think that "easy" operating systems (and with them I also group distributions such as Ubuntu and similar) tend to give more advanced users an illusion of reliability that then sorely bites you in the back as soon as something goes awry. A few weeks ago I lost hours trying to understand why Windows was refusing to update to 2004, because Microsoft has hidden every single detail of how the system works away from the user.
I think that many people don't really know how to properly administer Windows systems, and that when things go south you still need to know what to do just like with every other OS.
It seems the highest MT score on Geekbench is the Mac Pro W-3275M with 19,189 points.
An AMD Ryzen Threadripper 3990X gets 24,049 points and costs less than $4000.