Hacker News new | past | comments | ask | show | jobs | submit login
WSL2 can now mount Linux ext4 disks directly (hanselman.com)
237 points by ingve on Nov 9, 2021 | hide | past | favorite | 312 comments



WSL2 irritates me for a reason that is not common. It uses this thing called the "Host Compute System" which should theoretically allow one to launch any OS in the same sort of lightweight VM as WSL2. Of course, there are modifications to guest OS (kernel, init for talking over Hyper-V) required, but it should be doable.

However, Microsoft does not properly document how to use the HCS to achieve this. I've dived as deeply as I could into the docker shim code for HCS, but wasn't able to figure it out. It's an old story with Windows. Some cool feature buried under poor documentation.

Every time I hear someone say "Microsoft has changed", I mutter to myself "nope, same old MSFT with better PR".



I'm sure that now that OP has found out he is wrong, he'll update his tired anti-MS rhetoric, right? Right? (cue Star Wars Padme meme)


Have you actually looked at the samples ? You have no information about what is actually required on the guest OS side to make it launchable by HCS. It launches an OS (Windows) that already knows how to interface with HCS.

As I said, the docker hcs shim might help one figure everything out, but that's not documentation.

Edit: removed unnecessary flaming


He may be partly right. The sample code is 4 years old. But the documentation is recent (at least the url linked by gp) :

After 2021 june 27 : https://web.archive.org/web/20210627204757/https://docs.micr...

Before 2021 june 27 : https://web.archive.org/web/20210414223813/https://docs.micr...


As far as I could divine a few years ago from the code in this repo, a deep dive into the OCI (Open Container Initiative) spec and the docker hcs shim should make it possible to figure this stuff out. I ran out of patience though and wish it was better documented.


Microsoft has changed, though. WSL2, VS Code are things I wouldn’t have expected from them 20 years ago. Azure, .NET core, and MSSQL all with first class Linux support was unimaginable.

Now, they do still have a long way to go, but change like this takes time, it’ll always be a story of two steps forward one step back, and, perhaps most importantly, doesn’t happen all at once in an org the size of Microsoft. Some teams/departments are going to jump onboard this way sooner than others.


A cynic would say they changed because Azure is now their revenue driver.

Strong developer relations are now life and death when Microsoft is pitching Azure to cynical developers choosing between Digital Ocean and their competitors.

Before it was Windows ecosystem lock in that brought home the bacon.

Now it's convincing corporate IT to choose Azure over AWS.


Once you document it you can’t change it. That’s why internals rarely get documentation and serious thought is given to what should be a public API.


Absolutely. I understand why they do it (I used to work there years ago). But that's also a knee-jerk excuse used by teams so that they don't have to deal with documenting something.

Their POV is understandable (if not wholly justified IMO), but then so is my irritation at the practice :)


You act as if they're alone in this. I just watched a livestream from the OpenZFS summit yesterday and they're having trouble with stable pages in Linux because there's almost 0 documentation. So is that "typical linux"? Are they trying to intentionally make life difficult for people that aren't in the internal kernel clique? Linus himself gave a completely uneducated rant against ZFS a while back, so should we assume ill intentions?

If not, why are you throwing MS under the bus?


>You act as if they're alone in this.

> So is that "typical linux"?

Where did I mention anything about any other OS practice, or "typical Linux" ?

>If not, why are you throwing MS under the bus?

Jesus man. Mild criticism about an obscure API, of interest to perhaps a literal handful of people, is "throwing MS under the bus" ?


>Where did I mention anything about any other OS practice, or "typical Linux" ?

whoosh. You said it was typical Microsoft to not document APIs and implied this is an MS problem. I gave you a direct example IN LINUX and asked you if that's "typical linux"? Because you seem to be saying that the problem is isolated to MS.

>Every time I hear someone say "Microsoft has changed", I mutter to myself "nope, same old MSFT with better PR".

That isn't "mild criticism about an obscure API" and painting it as such is just farcical.


Read Pirates of Silicon Valley. There's a history of Microsoft doing really really shady unforgivable stuff. No matter how much they've changed, the history's there.


I've read Pirates of Silicon Valley, I know exactly what MS's history is. I also know it was a completely different set of leadership and I don't judge current leadership by their predecessors actions anymore than I judge a person I've just met by who their parents are.

Nothing that OP complained about points even a little bit to the tactics used by Ballmer and Gates, it points to: this is a new feature with unstable APIs so it's not fully documented yet.


yeah, they are basically selling plain simple Virtual Machines as if they were a revolutionary technology. If you exclude the recent GUI features (which are orthogonal to WSL2), WSL2 is IMHO just marginally more convenient than running Linux on a classic Hyper-V VM and using SSH to access it.


I've been trying to figure out how to do this for months, as they use it for the Windows Sandbox but for whatever reason (licensing?) only allow you to launch one at a time. The HCS Go library doesn't have any documentation about the Krypton (micro-vm) style VMs.


Is Docker counting as a separate operating system? Doesn’t it use the same Linux kernel as WSL? Or do you mean Windows Containers in Docker?


Sorry just saw this now. Docker on Windows can launch guest OSes using the HCS interface. There is a bunch of code in docker that does so. It is the only public application I know of that uses the API.


Genuinely curious: what keeps developers (I'm assuming developers are the main audience for WSL) from moving to either Mac or Linux? What features Windows has that are missing from either platform?


Mostly because my Windows setup works for me and moving to Linux would be a large disruption for questionable benefit. Things about my Windows setup which (I think) are hard to recreate on Linux, ignoring the possibility of writing my own code/tool:

* AutoHotKey. Alt/Capslock + IJKL is a universal way to get arrowkeys - e.g. it works in Chrome/a note taking app/Terminal. I'm not against getting a QMK keyboard, but I'm not aware of any laptop keyboards which support QMK. Switching between the two will get real annoying real fast.

* 7+ Taskbar Tweaker. My taskbar hides window names for programs like Spotify/Outlook/Slack (programs which usually have 1 window), but shows window names for programs like Chrome/Terminal/VSCode (programs which usually have multiple windows).

* Logitech software. My mouse has buttons hooked up to F13-F20 (yeah, there's more past F12), which AutoHotKey listens for and does specific stuff depending on what program is currently in focus.

The above are relatively important for my computing happiness, and I'm not entirely sure what I'll gain from moving to Linux.

If you can can address any of these points, please LMK! My reasons not to move to Linux have been growing fewer and fewer, but I've yet to find reasons to move to Linux.

Edit: Actually now that I think about this... I can just setup the mouse on a Windows box and it should just keep sending F13 etc. to a Linux box. So now I only have 2 reasons keeping me on Windows: AutoHotKey and an easily customizable Taskbar. The latter reason will also likely prevent me from upgrading to Win11.


Your second point really depends on the window manager/taskbar you want to use (they don't have to be the same program).

Your first and last points can be trivially achieved by mapping those keys via xmodmap - for instance:

    ! keycodes of your right and left alt keys
    keycode 108 = Mode_switch
    keycode 64 = Mode_switch

    ! remap the i key to emit Up when pressing Alt+i
    keysym i = i I Up Up
You can use the 'xev' utility to quickly find out the keycodes of keys on your system (just hover the window, press your button, and read the keycode). But all that is only necessary if your desktop environment doesn't ship with key mapping functionality already.

If you're on wayland instead of Xorg, then you'll have to use xkb to set this up.

There's also a bunch of AutoHotkey-like tools, but they're probably not necessary for something as simple as you're describing. The first that come to mind are AutoKey, SikuliX and IronAHK (a cross-platform rewrite of AutoHotkey, but I think it's discontinued).

Most desktop environments ship with functionality to (at least) run a command when you press a certain key. Others, like AwesomeWM, are way more powerful.


Thanks for this! I have some stuff to google now. Great to hear that what I want is "simple" - I think it's pretty basic too :)

My AHK stuff is a bit more complicated - my scripts total about 5000 LOC, but a lot of that is inflated cause it also doubles as a window manager. It does a bunch of other minor stuff, e.g. Alt-IJKL also combos with Shift for selection and Ctrl for word skipping, but I'm sure xmodmap and other tools you mentioned can handle that.


That sounds like AwesomeWM might be a good fit for you. A lot of the 'window manager' is essentially Lua, which doubles as the configuration language. If, upon pressing the F12 key, you want your windows to perform a choreographed dance before organizing themselves into neat rows ordered by name, it is the window manager for you. Since all the interesting parts are written in Lua, you can easily modify it to look and behave like anything reasonable - and most unreasonable things - you can come up with.

Alt-IJKL, when remapped at a low level like that, should behave exactly like arrow keys and combo with Ctrl/Shift like you would expect. You don't have to do anything extra.


There are absolutely reasons not to switch to Desktop Linux, but support for weird custom configs is a reason to use Linux. Xmonad and other tiling window managers have been ported to back to windows and os x, they're so important to users. Someone's already mentioned how to use xmodmap to get global custom key bindings.

Now, whether it's worth it to you, who has already learned autohotkey's syntax, to move to Linux, I can't say. Linux is a game of differently confusing config files from Windows and sometimes it's about the devil you know vs the one you don't.


I don't use desktop Linux anymore, just a comment: if it's a techie oriented tool and automation related, Linux probably has it in some form (more likely 5000 different forms), and it's probably best in class.

Where Linux suffers is support for many big commercial applications (MS Office for obvious reasons, Adobe software, etc.) and hardware support (which can be hit and miss, depending on your luck).

But if you're thinking: "how could I automate whatever desktop action operation?" Linux for sure can do it. I have no idea right now how you'd it, but I'd be shocked if it couldn't. There's sooo much configurability.


Just a few thoughts from a random dev who's been daily driving Linux for ~2 years after ditching Mac/Windows:

- AHK is kinda tough to replace on Linux, since you're kinda stealing the display manager's job. Since there are now two display managers in use (the older x11 and newer Wayland), you'd need to find a solution that works for you. It seems to be pretty easy on x11 though[0], and if Wayland doesn't offer similar functionality I'll be quite surprised.

- Taskbar manipulation is handled by your window manager, and you can typically get pretty granular with it. I don't have the exact same setup as you, but I do have a second taskbar on my second display specifically for Spotify/IRC.

- AFAIK, Linux was the progenitor of the extended function row :)

In conclusion, your sticking points are probably going to continue to be sticking points for the foreseeable future. I hope that doesn't discourage you from enjoying Linux though, even through WSL.

[0] https://wiki.archlinux.org/title/X_keyboard_extension#Caps_h...


Oh fantastic. Your link eventually led me to find "Vim-like Layer for Xorg and Wayland", which is pretty much what I want. https://cedaei.com/posts/vim-like-layer-for-xorg-wayland/

Now I just need to learn Vim :D


Which mouse are you using?

I'm currently looking for a new mouse and trackball that I would use with AutoHotKey (yeah I'm windows fangirl - what can I say, it's just way more productive than Linux)

I read good things here about the Logitech MX Anywhere S2 so I'm thinking about getting one.

The more buttons, the merrier!


I use two actually - the G700 when at my desk, and G604 when travelling. I really, really like the G700 - I've bought a total of four of them now. Unfortunately Logitech's stopped making them, hence the 604, which is actually not bad. I still prefer the 700's shape/heft, but it's a minor thing. You likely have smaller hands so the 604 will probably suit you fine. The 700(s) has a terrible battery life (like literally 1 day), but the 604 can go months without a recharge (if on bluetooth). Both have toggleable smooth/segmented scrolling, a tiltwheel, a cluster of thumb buttons, a high DPI, and can do FN13+ keys as mentioned. I forgot how I got FN13+ keys onto the 604, but here's the `profile.dat` that I use for my 700s: https://pastebin.com/Sp50Bnpn The process for getting it on to the 604 may or may not be similar.

The thumb buttons do stuff like CtrlW/AltF4 (depending on the program), toggle between maximize/restore, minimize, media play/pause, and summon media player. Pretty basic stuff:

    #IfWinActive ahk_exe chrome.exe
    F14::
    WinGet MX, MinMax, A
    If MX
    WinRestore A
    Else WinMaximize A
    Return
    F13::SendInput ^+t
    F15::WinMinimize,A
    F16::SendInput ^+{Tab}
    F17::SendInput ^{Tab}
    F18::SendInput !{Right}
    F19::SendInput !{Left}
    F20::SendInput ^w
    F21::Media_Play_Pause
Oh, and one of my more favorite AHK things:

    RButton & WheelUp::Send {Volume_Up 1}
    RButton & WheelDown::Send {Volume_Down 1}
    RButton & F17:: Send {Volume_Mute} ;; aka right click + mousetilt = mute


> You likely have smaller hands

If you add the qualifier "than you", yes, it's not a very risky prediction given the difference between genders in the hand size distribution and the demographics of HN users: https://geogebraintheclassroom.blogspot.com/2015/11/introduc...

Objectively, I usually get glove size 6 to 6.5, but I do consider my hand quite big. I guess I could plug the numbers from http://www.fownesbrothers.com/press/2016/5/10/glove-size-doe... in the distribution above to compute my percentile and see if my perception is accurate.

All this to say, I'll have to be careful to adjust the recommendation by size, as mouse (or trackball) size is an important factor in comfort, and my perception may not be accurate.

> Oh, and one of my more favorite AHK things:

Chording!!! Yes!!! Extending the idea to mouse keys is very inspiring!!

FWIW, like many people I have Caps and Enter using that: Caps and Enter are respectively Esc and Enter when used alone, or Left and Right control when used with other keys.

But wait, it goes further:

- my Shift keys behave as Page Up and Page Down when used alone,

- my Alt keys behave as Home and End when used alone,

- my Control keys behave as Insert and Delete when used alone

In practice, this puts the edit keys very close to my fingers, even on laptop-style keyboards.

I don't always use these alternatives, but I've noticed a tendency for modern keyboard to remove these edit keys, so I want to have a solution ready for when I can't find good keyboards anymore.


I have no idea what glove size I am... but yeah I'm a dude.

> I've noticed a tendency for modern keyboard to remove these edit keys...

The teeny tiny arrow keys on modern laptops is actually part of the reason why I have Caps+IJKL be arrow keys. I have a lot of opinions/feelings about arrow keys. (Why are the most commonly used keys so small??? /rage)

For me Caps + H and semicolon are home/end, Y/P are PgUp/Down, U/O are 4lefts/4rights, and 8/, are 4ups/4downs. The 4's are surprisingly useful, especially when navigating. Home and End combo with Ctrl to yield beginning/end of document, which is also nice. (so like Ctrl+Caps+H = beginning). Everything combos with Ctrl and Shift for wordskipping/selection which is really nice.

I haven't tried making modifiers do different things when used alone - that's a neat idea.


> I have no idea what glove size I am... but yeah I'm a dude.

My prediction wasn't very risky given the demographics of HN :)

> The teeny tiny arrow keys on modern laptops is actually part of the reason why I have Caps+IJKL be arrow keys.

I'm currently back to Lenovo, mostly for the wonderful keyboards that still have decent sized arrow keys and Page Up / Page Down nearby on both side of the up arrow, so I don't feel this need, but the modern trend of teeny up/down next tothe HUGE left/right is concerning.

I might end up doing like just you. In fact, I might start adding shortcuts right now.

I'm thinking of doing a mapping with Alt, as my Caps key is chorded as Control, and I can't imagine doing without Ctrl-K or Ctrl-L, but. Did you have any specific reason to go with IJKL instead of WASD?

> Everything combos with Ctrl and Shift for wordskipping/selection which is really nice.

It's wonderful to meet fellow minded people :)

My AHK scripts work the same: to go to the beginning of a webpage, I press and hold right Alt, then press on left Alt to send a Home. To to go the end, I use the same keys, but in the opposite order!

It quickly gets into muscle memory!

> I haven't tried making modifiers do different things when used alone - that's a neat idea.

Here's my current implementation which still leaves much to be desired but mostly perform acceptably. Try it for yourself and see if you like it! I've found using less chording whenever possible made sense, and I find myself often scrolling down page by using the Shift key instead of space, as it's just more conveniently placed as a big button right where my thumb rests while holding my laptop

~LShift::

KeyWait, LShift

If (A_TimeSinceThisHotkey < 300 and A_PriorKey = "LShift") {

   if (GetKeyState("RAlt", "P") || ( GetKeyState("LAlt", "P")  && !(GetKeyState("CapsLock", "P") || GetKeyState("Enter", "P") ) ) ) {

           SendInput !{PgUp}

          } else {

           SendInput,{PgUp}

          }

 }
return

~RShift::

   if (GetKeyState("RAlt", "P") || ( GetKeyState("LAlt", "P")  && !(GetKeyState("CapsLock", "P") || GetKeyState("Enter", "P") ) ) ) {

     SendInput !{PgDn}

   } else {

    SendInput {PgDn}

         }

        }
return

*LAlt::

KeyWait, LAlt

If (A_TimeSinceThisHotkey < 300 and A_PriorKey = "LAlt") {

   if (GetKeyState("LShift", "P") || ( GetKeyState("RShift", "P")  && !(GetKeyState("CapsLock", "P") || GetKeyState("Enter", "P") ) ) ) {

     SendInput +{Home}

   } else {

    SendInput {Home}

         }

        }
return

*RAlt::

KeyWait, RAlt

If (A_TimeSinceThisHotkey < 300 and A_PriorKey = "RAlt") {

   if (GetKeyState("RShift", "P") || ( GetKeyState("LShift", "P")  && !(GetKeyState("CapsLock", "P") || GetKeyState("Enter", "P") ) ) ) {

    SendInput +{End}

  } else {

    SendInput {End}

         }

 }
return

Replace CapsLock and Enter by your own chording keys if needed, to allow composition.

If you end up improving on that, please send me your improved AHK script! My email is my username at outlook dot com.


TIL about A_PriorKey, thanks!

My own scripts are hardly prettier. AHK is not a great language, and I've put very little effort into learning its syntax. Here's my implementation Alt IJKL & friends: https://pastebin.com/F0xgWHH9 Same invitation to you. If you find a way to improve it, email me at my HN handle at gmail :D Note that it has explicit stuff to work with the AltTab window.

I daily drive a Thinkpad X1, but honestly these days Alt+IJKL is so ingrained into my muscle memory that I make grumbly noises when I try to use them on another coworker's machine and fail. Well at least I used to precovid.

> Did you have any specific reason to go with IJKL instead of WASD?

Ergonomics, primarily. I didn't want to twist the fingers of my left hand to try to hit Ctrl/Shift/Alt WASD while my right hand is sitting snickering. Oh. And I just realized I could have used the right alt + WASD. I went with LeftAlt because Caps is also on the left. You can certainly choose to go with RightAlt, though I would encourage you to try ESDF so you get to leave your fingers on the homerow. Also means you have a bit more room for QAZ if you wanna do anything fancy with them.

I suppose I could try and make RightAlt+ESDF mouse movement... but TrackPoint. Might be useful for when I'm at the desktop though. Anyway, being able to left click from the keyboard is surprisingly useful. (CtrlCaps for me.) Often times my mouse is exactly where I want it to be. Happens multiple times a day.

> To to go the end, I use the same keys, but in the opposite order!

That is fantastic.


Thanks for the tip on the G604.

I also have I think 6 g700s'!!

My favorite was the old Logitech MX with the autoswitching hyperscroll. But I couldn't live without hyperscroll at all anymore.

AHK is also super useful but I've only done a couple of things so far.


The keyboards in System76's new models (any with their custom EC firmware) support up to 4 programmable layers

idk if they actually work with QMK, but they use the same configurator as their custom keyboard for desktops, which can run QMK

The Plasma desktop environment lets you modify window behavior on a per-application or per-window basis OOTB, including having them skip the taskbar.


Not a developer but a system admin, running Windows with WSL because there are a few utilities that I need to use that are Linux only.

- Work, all of the servers and workstations we have are Windows, management tools are Windows only.

- Microsoft Office and Adobe Acrobat are just some of the programs that won't run on Linux. Our remote access tool won't run on Mac or Linux. I can technically RDP to a server but at that point I might as well be running Windows.

- It just works. I'm running a Surface Laptop 4 but we can buy any computer on the market and guarantee that Windows 10 will run flawlessly on it. Driver support is first class, and backwards compatibility is amazing. We can run 20 year old CAD software on 10 with no issues.

I must be the luckiest user in the world, using Windows 10 on all my devices and I've never had the issues other people report. My files have never deleted themselves, it's rock solid and fast, never crashes.


> I must be the luckiest user in the world, using Windows 10 on all my devices and I've never had the issues other people report. My files have never deleted themselves, it's rock solid and fast, never crashes.

You and me both: I tried very hard to use Linux, but I couldn't find any compelling reason to stick to it. Having zfs snapshots would be nice, but not given the various pains Linux entails on the UI.

AutoHotKey has no serious match on Linux, but it's not the main reason I stick to Windows: it's the terminal support.

I'm a heavy terminal user, and I found my experience seriously worse on Linux than on Windows, with no way to replicate something as good as mintty.

I seriously considered finding a way to make mintty work on wine, before giving up.

When Windows Terminal achieves sixel support, maybe we'll see a port of WT to Linux? That'd be fun :)

Like with Edge on Linux that may incentivize me to try Ubuntu again!


Gnome terminal is about to get sixel support anytime soon, as is Windows Terminal. There is a lot of discussion on how to properly support it in a way that doesn't break legacy applications that used it while, at the same time, providing a good experience for the new ones.

I never imagined that mintty would support Tektronix graphics, much less the dual-color storage tubes!


Why are you doing with Acrobat that require Adobe's Acrobat instead of either a "save as PDF" or a PDF viewer?


Work pays for it, I use it as a PDF editor as well as converting documents etc.


Why would I use Mac or Linux? The former seems hell-bent on torturing developers by breaking things constantly (making Control Center use port 5000 was a particularly nice touch lately) and drowning you in permissions dialogs, and the latter has almost no advantage to me, and plenty of disadvantages compared to WSL2. Windows is the only OS I know that has actually working High / Multiple DPI support for X11 apps (yes, seriously, try it), with zero fighting with nonsense DPI configs, and I can also run Windows apps too. Don't know why anyone would run anything else.


> Don't know why anyone would run anything else.

People who think FOSS is a positive force in the world and want an OS that aligns with their values.


That's fair but at the same time, Linux and Free Software is now in the hands of *way* more people because of WSL. If you want Free Software to grow, you need an audience and people who use it every day, and having an extremely Accessible way to do that for lots of people is only a Good Thing for Free Software


Because every time I try Linux Desktop, I spend hours fixing and configuring stuff. I just don't care and want to waste time with this. So Windows on the Desktop is perfect for me and then I just use WSL2 to be in my Linux Terminal environment.


This comes up repeatedly and I'd like to understand it better. I have bought computers from Dell and Lenovo mostly and they have worked flawlessly. I've been consciously avoiding Nvidia GPUs (and dGPUs in general) because they are overkill for developer work (unless I did an insane lot of local number crunching). My Fedora and Ubuntu installs have tended to work out of the box.

Would you like to describe what happened in more detail?


Spent the past 6 months on Linux before switching back to Mac.

I bought a new Dell XPS 13” with Ubuntu preinstalled. It was still a nightmare. Some of the hardware/driver issues I encountered:

- Laptop would constantly get stuck in suspend, often when plugging or unplugging my thunderbolt docking station. The only way out of this was to hold the power button for 10 seconds, which I had to do almost daily.

- Sometimes the laptop would randomly wake from sleep in my backpack, resulting in a burning hot laptop.

- The battery seems to drain very quickly even while in sleep mode. Possibly related to previous point but it seems to lose charge in sleep mode even if it doesn’t not spontaneously wake.

- Doesn’t seem possible in Gnome to run an external display at a different DPI from the laptop display. This meant I had to constantly switch DPI when I moved from external display to laptop mode.

- Couldn’t get my jabra Bluetooth headset to work. I could get sound, but it required switching the Bluetooth profile every time I connected them, and I couldn’t find a way to get it to remember the correct setting despite hours of searching. I also couldn’t get the mic to work whatsoever.

- Doesn’t seem possible to configure keyboard remapping on certain keyboards only (e.g. swap modifier keys on my external keyboard).

- Couldn’t get scrolling to work with my apple Magic Mouse, had to buy a new mouse. Maybe a minor issue but it works fine on Windows.

- Not a hardware issue but I had a weird issue where google chrome tabs could not be repositioned without the tab becoming “detached” and creating a new window. This was incredibly frustrating.

I don’t think Linux is ready to be used as a daily driver for people who care about getting work done and not tinkering. Maybe if you use a desktop with a couple years old hardware it will work, but latest gen hardware, laptops, or external devices are a recipe for pain.


Wow. Now I'm extra glad I never tried Dell preinstalled laptops. Guess Linux-only vendors have more skin in the game.


I am using an XPS that i installed Ubuntu on for dev work and I am facing many of the issues mentioned above.

Whenever i put the machine to sleep I do a check always assuming the risk that the app states I have, might never be accessible again. I still can't get hibernate working on it to make it all just work for me. But each rabbithole into making my life a little easier comes at a cost of so much time that I just don't find reasonable.

Windows has it's pain points but having WSL running makes life so much easier.


I didn't like the pain, so I switched to a company that supports Linux on its hardware. I'd rather have the team do the system integration work for me rather than debug hardware I don't have the time or the specs for.


Fedora 35 has newer kernels. It may be worth a try.


I always get the boring ones. XPS are thin and light, but the Latitudes are cheaper and better built.


This comes up repeatedly and I'd like to understand it better.

I recently spent days testing 'random' kernel parameters and config settings from various forums in a desperate attempt to get my Ryzen APU to run stably without tearing. I still can't get it to reliably wake from sleep.


Would be worth specifying the laptop and the APU so we can avoid similar pains and shame the manufacturer (or AMD) into fixing it.


The new laptop I got from the company had nVidia graphics. After hours of trying, I was still not able to set-up nVidia drivers, and I have ultimately given up.

But a lot of small things added up:

* full-disk encryption in combination with dual-boot is doable, but not easy

* most of the software is either late with updates, or worse. For many vendors Linux support is an afterthought, and it shows. Teams is almost unusable (at least was in April 2021).

* every system update carries the risk of the OS not booting up any more. These days it's easy to restore back, but still, it's a risk of wasting time that is not easy to accept in a professional environment.


> full-disk encryption in combination with dual-boot is doable, but not easy

Kinda. You can't configure it during install, but I think it would be pretty easy to set up LUKS afterwards.

> most of the software is either late with updates, or worse

It really depends on your distro. Many of the 'stable' options will try to hold back updates in order to prevent breakage, which is why I personally prefer a more cutting-edge, rolling-release design. To each their own, though.

> every system update carries the risk of the OS not booting up any more

Ironically, the thing that got me to switch to Linux was having my entire PC bricked by a Windows update. The bootloader and partition table appeared to have completely erased itself off my drive, so I pulled the trigger and just switched to Arch. I haven't had my computer refuse to boot since, but I have gotten some surprises when my desktop updates behind my back. YMMV, but I feel like every OS is horribly unstable these days. At least Linux obeys my commands when I ask them.


"I've been consciously avoiding Nvidia GPUs (and dGPUs in general)"

This may already be the problem for many. On windows this tends to work without worry.


"because they are overkill for developer work"

WebDevs are not the only developers in the world.


I am not a web developer. I would love to have a GPU that allowed me to compile my code faster, but, so far, it's not the case. I don't do 3D visualization or games either, so, for me, the tiny, cheap, and very compatible iGPUs work just fine.


My guess is people buying hardware for their Windows, and then try to install Linux, and some of the hardware doesn't end up working, or is weird in some way.

I personally had very good luck, all of the random laptops I have tries ran the current Linux well, and on desktop I had even fewer problems, especially because I have checked Linux compatibility before buying.


MacOS is less intuitive to me than windows and I can already run Linux in Windows to get a good desktop + dev experience. I don't see the value in learning a third OS.


I just recently switched jobs and moved from macOS to Windows (by choice). I agree. I disliked trying to learn all the weird macOS CLI quirks. I just wanted to use Linux where I feel at home. If you run VS Code from the WSL2 honestly it’s pretty close to being on full blown Linux if you squint your eyes a bit. It’s also nice running a non crappy port of office as macOS office is a giant mess.


I won't move to Linux, because ultimately I've realized I want people who keep developer perfectionism in check.

For a semi-recent example, a lone Debian developer decided that Which should longer be used, and a huge fight ensued ( https://lwn.net/SubscriberLink/874049/bf89a969ed3dde87/ )

In a large corporation, their boss would swing by and tell them customers need that tool, and it can't be removed willy-nilly.

And I won't move to Mac, because of the missing link in Apple's product lineup. I'd move over in a heartbeat, if they had a midrange tower, beefier than an Mini, less expensive than a Pro, and sans monitor (iMac)


> In a large corporation, their boss would swing by and tell them customers need that tool, and it can't be removed willy-nilly.

Vastly more arbitrary and intrusive changes routinely occur in large corporations, where community complaints are often ignored rather than addressed by quickly reverting the offending change.


Such as? I'm predicting most examples would be things where it's only some small subset of the community, who would be much better served with a competing product.


For anyone interested, I have written the 'which' for Windows (cmd.exe) some time ago: https://metacpan.org/release/DOLMEN/Win32-App-which-1.030/so...


Yes there was some drama about removing which, but they (very quickly) decided to keep Which around. The same exact thing can happen in large organizations. The difference is, in Debian everything is out in the open so we see the massive email chain. In a large org that would all be behind the scenes.


>And I won't move to Mac, because of the missing link in Apple's product lineup. I'd move over in a heartbeat, if they had a midrange tower, beefier than an Mini, less expensive than a Pro, and sans monitor (iMac)

There's been some rumours of such a model, although not too frequently, although it's unknown to what price point it'd set.

https://www.macrumors.com/2021/03/01/fan-favorite-power-mac-...

I imagine they will release a Mac Mini (Pro) at some point with the same M1 Pro/Max internals at the new MacBook Pro, except inside a desktop computer. There's no doubt that it'd be beefier, but it might lack some of the Mac Pro features such as internal expandability (although it's still a question mark as to how internal expandability will work when the Mac Pro becomes an ARM machine).


It looks like the bigger iMacs will get optional bigger CPUs. I haven't heard about the Mini, but it has space and thermals to spare after ditching x86 space heaters, so an M1 Pro or M1 Max would still fit neatly.

As for the MacPro, my guess is Apple will keep the chip count to one, but add more performance cores while moving some accelerators outside the CPU package. Video encoders/decoders aren't as bandwidth-hungry as GPUs.


> In a large corporation, their boss would swing by and tell them customers need that tool, and it can't be removed willy-nilly.

Didn't the bosses at Microsoft recently[1] nerf an already-implemented free/community .Net feature (edit: Hot Reload) so it could be a Visual Studio exclusive? Yes, they reversed course after a getting blowback, but I don't think your assumption about bosses championing for (all) customers is correct.

1. https://www.theverge.com/2021/10/22/22740701/microsoft-dotne...

2. https://www.thurrott.com/dev/258605/microsoft-backs-down-fro...


The answer lies in your post itself. Free/community != customers. Customers by definition spend money on something.


I am too eagerly awaiting an M1 Max based Mini with 64 gigs of RAM. Or an iMac Pro with one. I find the 16GB limit a bit constraining for a computer that should be useful for at least half a decade.

I also totally didn't notice the Debian thing, but I have moved a couple scripts I use to have `command` instead of which for detecting whether a given executable is available or not (those scripts need to run unmodified on Linux and macOS) and `command` is the POSIX way to do it.

I'd strongly suggest flagging avoidable non-POSIX approaches whenever possible. POSIX still is the standard and, if you play nice, you'll be able to run a script everywhere, from MINIX to AIX to zOS's POSIX environment (an EBCDIC Unix!). So far, shellcheck has been ruthlessly teaching me to write better shell scripts.


The entire contents of Merriam-Webster fail to adequately explain how little I care whether or not I can run my scripts on MINIX or AIX.

"The script you wrote last week for Debian no longer runs on Debian, but if you follow this guide, you can run it on an PDP-11!"

Yay..


If you wrote it for POSIX, you can be sure it’ll run today and continue to run unmodified for the next 50 years.

Software needs to be durable.


I doubt that bosses of large corporations keep the customer's needs as their priority. As far as my experience goes, people in power are just as human in either structure, and they can, and do make decisions that some don't agree with.

Also, there are Linux distros that are maintained by large corporations, like Oracle Linux. Not every distro is governed the same way.


There are enlightened companies out there:

“How much time would a $4,000, top-of-the market machine like the M1 shave off from each build? How much total time over 2 years? How much “value” does this time mean per engineer?

With the M1, the answer is a no-brainier. The $4,000 per engineer spent will bring back so much more productivity versus top-of-the-market Intel ones, including the 2021 one.“

https://9to5mac.com/2021/11/08/heres-why-twitter-uber-and-mo...


Windows with WSL gives you both a "real" Linux (closer than the bsd stuff on Macs), and the support Windows gets (My mouse is still annoying to use on Macs even though the software is fully supported). I can use the same machine for gaming without shenanigans.

Its the best of all worlds. The only friction now is that Microsoft has been making the UX for Windows gradually worse with every patch in Win10. Some of it got better in Win11. If I could get a Win7-esque UX, but with the features of recent versions and with WSL2, it would be the perfect OS for me.

Now instead I bounce between all 3.


I run a Linux workstation, but keep a Windows laptop. I find the MacBook Pro keyboards have too low travel distance and that aggravates RSI (I have an early Intel model that has an amazing keyboard, but is practically useless). Most of the laptops that ship with Linux have the same restriction for me. To get a laptop with decent key travel, I usually end up with a Lenovo that ships with Windows on it. I've tried dual booting, but outside of Pop_OS!, I haven't found a distro that can switch between the two video cards sensibly. I couldn't get i3 running on Pop_OS!, so I largely just stick with Windows there.

I suppose that's a long-winded way of saying that running Windows on a laptop is just way more practical for me. But I do all of my development on a workstation.


> I find the MacBook Pro keyboards have too low travel distance and that aggravates RSI

I liked the keyboards that came before the Magic Keyboard line (the one you mention on the early Intel). OTOH, I also liked the butterfly (shame it's so unreliable), so it may be that the short travel of the Magic ones is mitigated by the good tactile feedback of the butterfly.

> To get a laptop with decent key travel, I usually end up with a Lenovo

That's true. Unfortunately, around here (Ireland), the intersection of good keyboard feel, US ANSI layout, and no deliberately Linux-hostile dGPU (looking at you, Nvidia) is a very small set.


For bigger orgs, MS Office is still a barrier for standalone Linux. The online versions aren't the same. If you share files with Windows/Office users, nothing really works other than the real deal.


Their employer who provides and provisions the developers' workstations.


I'm using a Windows loaner until my Mac is provisioned. They had a supply-chain snag at some point.

This is kind of why I asked - there is nothing in Windows that calls my attention in a "Oh wow! This is good!" way. Quite the contrary - the upper crust of Windows 10 is polished, but every now and then I see dialogs that render text differently, with different widgets that don't quite work the same way as the rest. It's a bit like running xedit on a Gnome desktop.


People are used to the suckiness that comes with Windows, to the point that they don't notice it as much. I often shook my head at my Linux setup at the time I switched too. But now when I go back to Windows, it's the same head shaking again, because I'm now used to an other system's idiosyncracies.


Yeah you're right, Windows isn't great for developing, although it isn't as bad as it used to be. But employers love it because they can run all their monitoring spyware on it, it integrates with Outlook and Office, plus they might have some legacy software that you have to use that runs only on Windows.


That's true. All my corporate issued Macs come with so much spyware they probably are heavier than normal Macs ;-)


Because Linux and the Linux ecosystem are at odds with my philosophy of computing.

1. The Linux kernel virtually enforces all drivers will be upstreamed into the kernel itself. That means that if I want new drivers, I need to update my kernel. If that leads to other things breaking (perhaps even other drivers), that's going to annoy me greatly. On Windows, I can update each driver in isolation.

2. The Linux ecosystem heavily favors centralized updating. If there's a critical security update for systemd (and let's face it, when is there not), I have to pick it out of a huge list of software updates for software I barely use. I rarely use Firefox and yet, when there's a critical system update, I have to expressly un-check the box or I'm in for a big Firefox update.

3. Most distros have a manual, "nag-based" update model, while I prefer the system to intelligently auto-update for me, during off-peak hours. I mostly use modern software which saves to the cloud, so if my PC reboots to install the latest Windows updates in the middle of the night, it's not a big deal. All of my browser tabs are still open, my AutoCAD files are auto-saved, etc.

4. It's very difficult to figure out if specific hardware will support Linux until you buy it. Obviously, Nvidia is a no-no. But even certain Asus gaming motherboards will have wifi issues depending on which sub-model you pick. Often someone says that a piece of hardware works, but they didn't notice slow wifi or something, but I will.

5. I like the power of money. By being a paying customer, I know that companies are competing to make a good product for my purposes. The Linux community heavily favors open-source software, so there's no profit in porting software to Linux. I realize I'm in the minority on this, but what can I do other than stick with Windows and Mac?


There's a huge human factor, which Microsoft, as a business, exploited very successfully. For many, Windows is the default because that's what you see on other's PC, taught in schools, used in many office environments. And as a tool, it works good enough for them. And change is hard. For many, the FOSS principles are sympathetic, but not compelling enough to change.


Microsoft Office (the Mac version isn't 100% compatible with the Windows version) and (for Linux) Adobe Creative Cloud and similar apps.


I've been using on full-time basis all of these 3 major OSes (Windows, Linux, OSX) in my career - here's my insights:

- Linux - love this system (command line especially), but it tends to have some weird issues from time to time that I need to handle, also doesn't have that great app support that I would have (also: games)

- OSX - for some time I've been in love with this OS, but then something happened in my mindset and its close nature and customization boundaries makes me hate it. Also lack of gaming is bad for me.

- Windows - until WSL happened I wouldn't even consider using it full time. But since we've got it I'm in love - can use my beloved terminal, apps and games. I've also bought a Surface Book 2 device that I've fell in love with (design, performance (at least for my needs), keyboard etc.)


I may be in the minority here, but I actually like the windows desktop better.

The window manager in osx is just terrible for me, resizing and laying out windows is awful compared to Windows in my experience.

The 4 finger swipe thing is great, but Windows has that now as well, and recent Linux desktops.

I like the flat square design of win 10, I love how well wsl2 works, I love how easy my complex multi monitor setup is to configure, and how great the auto window layout stuff works across monitors and then also works when I unplug and carry the laptop away.

99% of the development I do is for Linux, it's vastly superior for hosting web servers, etc...

But for a productive and enjoyable desktop experience, nothing beats Windows.

(I also do a lot of development on mac M1 - super fast nice little machine, but the window manager is still sub par for me).


Because it's going to run better and smoother on linux in almost every case than on WSL. There is nothing really attractive about windows to me right now so I have no reason to recommend to my employer for us to ditch Linux for Windows. However if you're already a majority Windows shop,this may be enough to keep you for dropping it for greener pastures in Linux. Never forget that everything that Microsoft does is to earn a profit. Their current corporate theory is they make more money by supporting Linux/unix capabilties rather than oppose them like they did in the 90's and oughts.


Photoshop! After over a decade of using it, most of the things I do there became muscle memory and I have absolutely no reason / incentive to learn different software (other than being able to use Linux). Ruining it in Wine proved to be a horrible experience - after a couple days of bruteforcing a setup that started, the graphics performance sucked so bad that it was nearly unusable.

I ran Windows -> Hackintosh for 2yrs (until it exploded after an update) -> Linux for 2yrs (until it exploded because of NVIDIA drivers ruining my stability) -> back to Windows after they released WSL2.


I don't think this is a solution since you're likely a power user, but https://www.photopea.com/ is surprisingly good. It also retains photoshop's keyboard shortcuts, so my muscle memory is satisfied. It's noticeably slow when doing complex stuff - but for my casual purposes it's great.


It's great stuff, that's how I survived most of the time I ran Linux. Whenever I had to do anything more complicated, I grabbed my old MBP and shared the files between the PCs. Nothing beats alt-tabbing into a Photoshop instance running at 5+ FPS, though :)


I used Linux for a while and now use WSL2. The main reason is that on my hardware Windows works out of the box and Linux doesn't.

Without specifying some boot parameters I can't even boot an installation USB stick on Linux, there are some mode settings issues or something like that. And while that is fixable I couldn't get fractional scaling to work well on Linux, and I absolutely need that with my new display.

I would like to use Linux more, but I'm not very motivated to play around with hardware issues. This obviously can vary a lot depending on the exact hardware you use.


Was this from a Linux vendor, or was it Windows hardware that you hoped would randomly work with Linux? System integration takes teams of folks months or years, even for Windows. I'm not sure why you'd decide to try your own hand at that if you don't want to deal with hardware.


> Without specifying some boot parameters I can't even boot an installation USB stick on Linux

Would be worth mentioning the specific model so that a) we can avoid buying it and b) maybe shame the manufacturer into fixing it.


Linux for laptop just isn't great in my experience. My desktop is Linux, and all is well.

But on all my laptops, I find things to just be to much of a PITA. Eg: hibernate, is way too buggy to depend on. Half the time something prevents hibernate, and my laptop is dead and/or over heated when I pull it out of my bag. The other half the time everything is bugged out when it comes out of hibernate.

I found that when I'm traveling, I'm happier with a very underpowered laptop, which has great battery life. I don't even use wsl. GitHub codespaces has been working well enough.


I have two laptops. MacBook Air 2013 and a thinkpad (I think w540?) and both run Linux perfectly. Way better than either macOS or Windows 10.


All these reports would be useful with the maker and model of the affected laptop. I tend to pick the boring models and they mostly work, but knowing which ones work so badly (like the XPS 13 people mention) would be extremely helpful.


Drivers are a big one, it depends from device to device, but on average the hassle for connecting things on Windows is much less than the hassle for connecting things on Linux.

MS Office also to a degree, it wouldn't be a deal-breaker if the rest of the company wasn't also using MS Office (I've never purchased it for personal use), but the MS Office experience tends to be more polished, especially if you are dealing with documents originally written for MS Office.


I really do despise the hotkeys on OSX.

The way you shift windows around on two seperate 27" monitors is vastly inferior without multiple widgets is vastly inferior to the other two.

I actually would have to spend far, far more time having to customise OSX when I start up at a new place on contract now WSL has landed.

WSL also serves a very important purpose in corporate IT.

You just don't always get a choice, company often only supports one OS. WSL helps a ton with pain points related to VM provisioning in a "no OSX" shop.


Some people are not fashion victims, and do not mind being called "uncool" and "boomers" for running Windows and not moving to Apple as the fashion of the day demands. I faced intense pressure to switch from Windows to Apple in a tech company, because I made the team look "unprofessional" with my Windows Lenovo.

As for Linux, it's terrible for anything else besides programming. Lack or low quality software and generally stuff just not working.


You don't get to chose in most sizable organizations. Control and compliance are the terms IT/infosec will use to justify their painful requirements.


I develop Windows software. Pretty simple.

Or, to pull it back another level: every business uses Windows. Those are our customers.


Do you write desktop apps? Many years ago, after writing a VB6 desktop app that had to work over the LAN (2 "clients") and having it barely work by reading an Access db file over SMB[1], I switched to browser-based apps thereafter (C#/IIS) as it was a natural fit for networked apps that require sharing of state.

1. In fairness, it was my first paid job and I didn't know what I was doing, but it worked(tm)


As an individual I'm on Mac, and Linux for my server needs.

As a business I work with clients that run Windows for their own reasons I have no control over. I've found it easiest to develop on Windows for those clients and I welcome the option to have easy access to some tools I like via WSL2.


Lot of choice of hardware (vs macos), Visual Studio, and Windows has a great desktop experience IMHO


Our prod desktops use critical Windows-only software, so we have to use Windows too.


Games.


Mac is closed and walled ecosystem with questionable UI/UX running on heavily overpriced mostly unrepairable hardware (also closed).

Linux has point blank bad hardware support and UI/UX and missing parts of software here and there.

Windows is just working out of box on almost any hardware.


for me is Visual Studio


One thing I’m interested in is the ultimate form of dual boot: that you can have a regular Linux distribution installed that you can boot directly, or you can run it inside Windows. Is this going to let that happen, or is this heading in that direction?

(I understand that at this stage you can’t mount anything on the Windows installation disk, so I suppose that for now it’d need to be two physically distinct disks at the least.)


I did that about 10 years ago, with virtualbox and «raw disk image» or whatever the feature was called. One physical drive per OS. Worked great for me at the time. No idea if this still works. (Win7 and debian at the time)


It works with Hyper-V if you have a whole separate disk for the VM. You can't pass just single partitions to the VM like you can with KVM on Linux.


I just recently used raw disk images with qemu on Debian to remotely install an other distribution on an other partition and then I rebooted into it.


Should be enough from a FS perspective yes, although:

(1) the WSL distros don't have systemd

(2) they ship with a custom kernel that doesn't support custom kernel modules

First point is trivial to fix but (2) may be painful. You could even share the desktop environment as WSLg uses X11/Wayland.

edit: apparently compiling modules is (kinda) working with wsl2: https://github.com/microsoft/WSL/issues/4425


I used to run systemd in WSL through https://github.com/arkane-systems/genie and it worked pretty well. Not sure about modules but I found compiling my own kernel with some more features (ext4 encryption support) pretty easy.

(That being said, I'm extremely happy to run Linux natively now and no longer use Windows anywhere)


(2) shouldn't be that painful since Linux distributions are generally perfectly happy with you booting off of different kernels at random.


You can install SystemD-enabled WSL instances with distrod[0], and they have future plans to allow dual-booted physical Linux distro on a separate disk to run as a WSL instance.

[0]: https://github.com/nullpo-head/wsl-distrod


And I want to do the exact opposite - basically what VMWare is able to do with Bootcamp installations. Then I could run Linux as I usually do, but not have to maintain a VM for Windows development (MSVC etc). If you try running VirtualBox with raw disk mode and attempt to boot Windows, activation will complain. I guess VMWare has some sort of special access that it can convince Windows Activation that things are okay.


This is quite banal to achieve. Just put Linux on its own disk and create a Hyper-V VM with the physical disk attached. If the disk has its own ESP, is it that simple, just remember to use UUID everywhere and Linux will happily boot wherever you try booting it from. I've got an external SSD with ZFS + Archlinux that you can easily run via USB live or that it can be run as a VM via KVM/Hyper-V, and it runs flawlessly everywhere, with KDE Plasma, VS Code, Firefox, ... Performance is very good, thanks to Linux being way less I/O intensive than Windows, and USB 3.1 is actually faster than a SATA disk, so it doesn't suffer that much from booting from USB. I even had a Windows VM on that disk and it worked fine.

Linux is way more flexible than Windows in this regard, you can install every single driver (i.e. both NVIDIA and Mesa at the same time) available and it will just load only the right one at the right time.


I absolutely love doing this, usually in the other direction: external USB3-or-better hard drive which can boot by itself or be loaded into QEMU on linux/window/macos. Excellent way to treat operating systems like browser tabs.


I did the reverse a while ago. I had a Windows dual boot that I could run inside a qemu vm. Was pretty useful but I ended up only using the vm so the dual boot wasn't necessary.



I guess that's what MS is aiming for, although as someone who has been using WSL at $JOB for the past 3 years I think they still have many rough edges to work on.


You can do this with Hyper-V _but_ the disk cannot be "online" under Windows. Also, both disks might need to have boot loaders on them.


The one last thing that has kept me from moving all my development to Windows is mounting drives encrypted with `cryptsetup`. Does anyone know if `cryptsetup` now works in WSL2?


Yes, there is support for LUKS disk encryption

https://devblogs.microsoft.com/commandline/servicing-the-win...


Get ready for windows and windows viruses to mess with your linux partitions located on the same computer...


Sadly, that's yesterday news.

See here: https://security.stackexchange.com/a/249484

> ... a newly discovered ransomware variant exhibits the ability to detect and compromise partitions (including hidden partitions), a behavior not thought to have been seen before in ransomware.

with a link to original source:

https://www.fortinet.com/blog/threat-research/newly-discover...

quote from that link:

> At the time of discovery, FortiGuard Labs researchers believed the ransomware was seeking out partitions to find possible hidden partitions setup by systems administrators to hide backup files. But further analysis confirmed an even more advanced technique. The DarkSide Ransomware variant seeks out partitions on a multi-boot system to find additional files to encrypt.


Malware implemented ext4 support before Windows did, lol


I'm still trying to understand the use case. I've been at this for 27 years (or 40, depending on where you want to start), and I just can't understand why anyone cares about WSL2. If you need a Linux VM, I have no idea why you wouldn't run a full-blown VM software like Fusion or VitualBox, and have total control over the emulation, but I guess that comes down to preference. Who here is writing software which runs on Linux, yet needs to be running Windows while they do it? What sort of application is that? What's that software development cycle?


You can launch into a WSL shell in seconds without having to wait for a VM to spin up. WSL doesn't run the full slew of linux processes and uses the same memory space, so both CPU and memory utilisation is much lower than a VM. You don't need to contend with all the fiddly configuration parameters and config of VM software, and it integrates into the Windows environment by default, again without fiddly configuration.

If you're doing sysadmin work or web development, and need to run Windows software as well or are on hardware with better Windows support, it's hard to see why you wouldn't use WSL.

To your point on total control of the emulation, not everybody needs that. If your use case means you need a real Linux OS environment, then sure, WSL isn't for you.


> WSL doesn't run the full slew of linux processes and uses the same memory space, so both CPU and memory utilisation is much lower than a VM.

Well, I thought this was the case with WSL, but that WSL2 changed this, such that it's really just a full-blown VM now. Are you saying that you're still using WSL 1, or have I misunderstood the nature of WSL2?


WSL2 still runs instantly. I haven't been bothered with waiting. I tried wsl --shutdown and then opening wsl - didn't take a second. Cold boot may have been longer, but I don't remember being bothered with startup times. However older powershell console startup time did bother me for sure.


Neither :-). WSL2 runs a full-blown machine but the startup process is considerably different from that of a real machine with a real Linux installation, so when you "start up" a WSL2 shell, it's spawned in seconds, you're already logged in and so on. It's essentially the WSL1 presentation format but with a different back-end.


Though my Ubuntu VM on Hyper-V with multipass giving the Microsoft Terminal integration started up basically just as fast, to be honest.

But the deeper integration and lighter underlying OS for WSL2 is better, especially for Docker dev container usage with VSCode.


> You can launch into a WSL shell in seconds without having to wait for a VM to spin up.

Start VM in background at boot time and ssh in milliseconds when necessary.

> WSL doesn't run the full slew of linux processes

I don't know what linux processes are you talking about, but minimal Linux ram consumption is something like 50 MB, that's hardly noticeable.

> uses the same memory space

RAM ballooning is available in VirtualBox or Vmware for years.

> CPU utilisation is much lower than a VM

I don't think that's true. There's no inherent CPU utilization in Linux (and WSL2 is VM).

> You don't need to contend with all the fiddly configuration parameters and config of VM software, and it integrates into the Windows environment by default, again without fiddly configuration.

And that's probably the main reason why WSL is so popular. Installing VM software, creating virtual machine with proper configuration, installing guest tools, configuring it to start/stop at host OS boot/shutdown, configuring shortcuts for ssh is out of reach for most developers and power users. WSL just simplified that process. Probably could be implemented with some wrappers around VBoxManage years ago, but nobody understood the problem.


Interesting; different perspectives I suppose; not the OP, but for myself too VM always seemed an easier and cleaner solution:

1. Isn't WSL2 now actually a VM too? My biggest deal breaker with WSL2 is that it moves my main Windows into now a parent VM over the Type 1 hypervisor; making everything else in my main Windows just that little bit wonkier. Worse, this information isn't as readily easily grokkable as I feel it should be. I.e. if somebody isn't comfortable installing a clean, separate VM in Virtualbox, they may be even less aware of consequences of moving their main Windows installation into a VM now.

2.Re fiddliness: Installing Ubuntu into VIrtualbox has always seemed trivially easy; and there's any number of downloadable pre-built images from safe sources. Whereas figuring out how to access Windows filesystem from WSL2 and vice versa; let alone installing GUI tools - always seemed completely opaque to me with any number of half-built, quarter-supported guides and solutions out there. And I never seem to know or guess correctly what subset of Linux functionality will or will not work, normally or differently.


I think #1 (running Windows itself via HyperV) is just the direction Windows is going anyway, and WSL2 is just one of the features that require it. Another one that requires it is the "Windows Defender Application Guard" which can isolate browser instances and other stuff.

https://techcommunity.microsoft.com/t5/virtualization/hyper-...


> moves my main Windows into now a parent VM over the Type 1 hypervisor

Are you sure about this? It seems unlikely that NT would change significantly depending on whether or not it is hosting a WSL2 guest. I've never noticed anything different about my Windows since using WSL2.

> Windows filesystem from WSL2 and vice versa

/mnt/C/

\\wsl.localhost\Ubuntu


WSL2 is architecturally designed to run under Hyper-V, so when you activate WSL2 on your machine, Hyper-V runs on bare metal and your Windows installation just becomes another VM running inside it next to the WSL2 Linux environment. Unfortunately this is imho not explained as well as it should be, because, while most of the time most people won't notice any difference, there is a measurable impact with regards to performance (in games, for example). It depends on your specific setup how bad it gets, and in most cases it's more of a theoretical performance hit than a noticeable one, but it is still there.


It downclocks my ram to 800mhz if I enable vt in bios. My new cutting edge system turns into a pentium 4. Apparently this is a bug with windows 11. Hope it gets fixed


As I said, it is NOT documented well; and even when you do confirm that WSL2 engaged Hyper-V, the ramifications are even more poorly explained.

But yes, everything I've read and experienced indicates that:

1. WSL2 IS a VM and it necessitates installation of certain portions of Hyper-V, which as Type-1 hypervisor, means your primary windows partition is no longer bare-metal but rather now a parent virtual machine.

2. This has impact on running other Type 2 hypervisors such as VirtualBox or VMWare etc; as well as some types of performance-intensive applications and games.

https://docs.microsoft.com/en-us/windows/wsl/faq


It is true for any system that has Hyper-V enabled and should work perfectly fine. Same as if you have a Windows VM guest or a traditional Linux VM. WSL2 uses and manages a small VM under the hood so enabling it will cause this change to the windows boot process if it was not already so.


Yeah it actually does. Crazy, I know.

They’re also doing the same for Windows 11 by default now too I believe.

> In addition, if you have Hyper-V enabled, those latency-sensitive, high-precision applications may also have issues running in the host. This is because with virtualization enabled, the host OS also runs on top of the Hyper-V virtualization layer, just as guest operating systems do.

https://docs.microsoft.com/en-us/virtualization/hyper-v-on-w...


Can you give some more info about your first point, where your main Windows is moved into a parent VM ?


Sure:

1. https://docs.microsoft.com/en-us/windows/wsl/faq

"The newest version of WSL uses Hyper-V architecture to enable its virtualization"

A little bit of detail on impact, but incomplete/generic.

2. https://docs.microsoft.com/en-us/windows-server/administrati...

"Hyper-V features a Type 1 hypervisor-based architecture. "


https://docs.microsoft.com/en-us/virtualization/hyper-v-on-w...

Has some basic info, worth a read.

> In addition, if you have Hyper-V enabled, those latency-sensitive, high-precision applications may also have issues running in the host. This is because with virtualization enabled, the host OS also runs on top of the Hyper-V virtualization layer, just as guest operating systems do.


That's just how Hyper-V (Microsofts VM hypervisor) works, it's a type 1 (bare metal) hypervisor, where everything else runs in a VM.


> Probably could be implemented with some wrappers around VBoxManage years ago, but nobody understood the problem.

I'd say vagrant did something in that area.


I think the biggest advantage of WSL2 is being off the radar - corporate IT support will just be "oh its a Microsoft product, install approved, add to whitelist in all security monitoring products".

Rolling your own implementation with vmware poses the exact same security and compliance risks, but its way more likely to put a spotlight on you.


From a legal perspective it’s probably best to avoid any Oracle IP.

(I still agree with your overall point though.)


Processes like systemd. Does the average developer or sysadmin really pare their Linux down to 50mb?

Look, if you want to tune your VM exactly to your liking then use a VM. It will give you a lot more control.


> You can launch into a WSL shell in seconds without having to wait for a VM to spin up.

Serious question: how long does it take to spin up a VM on Windows then? Does it take seconds?

(Not disputing your other points.)


For a "cloud image" I have in virtualbox (so no gui) for testing cloud-init/ansible, about 15-20 seconds.

WSL1 takes about a second, and I'm pretty sure most of that is the init script that spits out network/update info.


>I have no idea why you wouldn't run a full-blown VM software like Fusion or VitualBox

Integration etc. It's just much faster and easier to pop up a terminal window straight into a shell on WSL than it is doing the same through a third party virtualization system.

>Who here is writing software which runs on Linux, yet needs to be running Windows while they do it?

Me ? Enough people that it justifies putting time into WSL and adjunct software (Windows Terminal) ?

There's certainly enough software on Windows that I need, especially on the audio/video front but also stuff like Visual Studio for my C# code. And there's UNIX software I equally need (headless vim and anything that runs on the CLI). It's a near perfect fit for me.


Even just the fact you can run windows binaries from wsl2 is a killer feature, its nice being able to run something like tasklist.exe and process the stdout in bash.

Sure you could write a similar script in Powershell or cmd, but its a headache I don't need.


I hadn't even thought of that, though I did start the odd Windows .exe from the WSL. Is it usable for actual Windows sysadmin stuff (I mean as the main shell, as opposed to Powerwhell) ?


Anything that uses stdin/stdout will work fine


> Who here is writing software which runs on Linux, yet needs to be running Windows while they do it?

I do, because desktop Linux is a pile of burning garbage. Do we really have to reiterate this point every time?

Never been happier in my job then the day I realized I can run my full Linux dev environment on Windows.

If you folks like spending your free time configuring Linux or virtual boxes on Windows, feel free to do so. But please don't act like "you just don't understand". I don't wanna debug the OS in my free time, I would rather go hiking.


Some of us are also unwilling to put up with Microsoft's increasing app-ification of the OS, and are willing to put up with a little jankiness in order to ensure we are on a free software stack.

And we still have time for hiking.


Well good for you people.

For me, when I buy a new laptop and half the drivers aren't working, that's an immediate deal breaker.

I literally won't allow myself to get into that situation again, not for love or money.


I'd you buy a Linux laptop and it's not working out of the box, you should return it.


> desktop Linux is a pile of burning garbage.

Purely subjective. I personally think that Windows is a pile of burning garbage, YMMV obviously.

My own desktop linux experience in the past ~5 or so years has actually been better than my Windows experience. Nowadays, I use a mix of Linux and OS X with a lot more time spent on Linux[1] and I'm very happy. The only thing I consider perhaps installing Windows for some day is games, but between SteamOS and Proton, even that is very low on my priority list and if I did want to do it, I'd probably install it in a VM with GPU passthrough rather than running it directly.

I've been using Linux in various capacities (at home, not just on servers) since maybe 2006 or 2007, sometimes as my primary system, sometimes dual booting, sometimes in VirtualBox, but I've pretty much switched away from Windows entirely (last time I had a Windows install was 2015) and while I have a Macbook I use, my primary machine is a Dell XPS running Linux. I wouldn't even consider using Windows anymore, I've never been happier than when I left it behind for good.

> If you folks like spending your free time configuring Linux

I see people who don't use Linux say this, but its just not true. I spend exactly zero time configuring Linux, outside a half a day of initial setup (which, when I used Windows, is also how long I'd spend setting that up after an initial install) and much of that is largely because I can configure it to suit my particular tastes, not because I have to, outside installing a some stuff from the package manager (but again, I'd have to install the software I want on Windows too). Sure I spend more time on the commandline doing this than you might on Windows, but I prefer the commandline so it feels largely a choice rather than a necessity. I spent just as much time "fiddling" with drivers and settings on my last install of Windows as I have with my current install of Linux. I actually have a very low tolerance for dealing with shit not working.

> I don't wanna debug the OS in my free time

I've had more bugs in my last year of using Windows than I have in my previous year of using Linux. I've had to debug more Windows issues on family members laptops than I've ever had on my current Linux laptop.

I personally don't want to deal with all the live tiles and advertisements that Windows had on my mothers laptop. With Linux, I have nothing that I don't want (and if a distro installs stuff I don't want by default, its usually trivial to remove).

[1] As of about 2 years ago, prior to that the split was reversed, but that was largely due to my work at the time.


I should add that the only times I do end up "tinkering" with my Linux setup is when I do very out of the ordinary stuff, that is either not easily done in Windows or would require an equal amount of tinkering. For example, much of my "first day" setup is because I like a keyboard-centric environment, so I set up Sway (with a semi-non-standard config) and related things. Manjaro lets me set up a number of environments with good defaults, if I stick with those, then my initial setup is just down to installing the applications I need (which you also have to do in Windows). Its only when I want to do non-standard out of the ordinary or highly customised stuff to suit my preferences that I may need to tinker, but if I have a non-standard workflow on Windows, I also have to tinker. To get a tiling-WM style keyboard first experience under Windows, I also had to tinker and configure and install stuff, and, at least last I used Windows, I never quite had the control to get the workflow I wanted, so I actually spent more time tinkering (and then giving up and going with the closest match I could get) than I do on Linux, where the tools are replaceable and configurable enough to get pretty close to what I want without too much work.

So I only tinker when I choose to, in order to customise things that are either not possible in Windows, or would require just as much (or even more) tinkering on Windows. That's not a con for Linux, if anything its a pro. Its purely optional.

The only parts where people may spend time tinkering with Linux that I'd consider a con is to get unsupported hardware to work, but that's only easier on Windows if the hardware comes with Windows drivers. If there are no good Windows drivers available, your out of luck and no amount of tinkering will likely get it working. But its been years since this has been something I needed to do on Linux (but I also do a quick search online to check that my hardware has Linux drivers before buying hardware, but those 5 minutes are hardly "tinkering").

Interestingly, I recently bought a cheap drawing tablet and it actually works better on Linux than it does on OS X when using the official drivers (but Linux default tablet drivers support basic functionality out of the box and the OSS Digimend drivers may be getting support soon to, going by the github issues).


I installed Linux for a couple old ladies. Debian (Mate) on old desktops so they could browse the web and write. Zero issues. Fast and dead stable. They love it.

And installation was a no-brainer.

One service call, dead power supply, in 6 years.


My non technical girlfriends main PC is a 2011ish iMac running Mint. She loves it, zero issues, has never even needed me to look at it. Surprisingly stable for how old a machine it is.

Reckon I’ll swap in an SSD at some point because the decade old spinning rust has to be on its last legs at this point.


> Reckon I’ll swap in an SSD [for the] decade old spinning rust

I don't know if Mint's arrangement will be as sensitive to it as Windows, but when we swapped an old SSD of mine into a friend's laptop the boost it was enough to quickly take it from “this thing needs to go in the bin after a meeting with a lump hammer” to being her main workhorse.


> Who here is writing software which runs on Linux, yet needs to be running Windows while they do it?

Anyone whose job also involves writing Word docs, PPT presentations, Excel spreadsheets and Visio diagrams, and communicating via Teams. The web versions are very much second-class citizens to the Windows applications.

> desktop Linux is a pile of burning garbage

That's not my experience at all. I have two nearly identical Dell XPS13 laptop. My Windows 11 laptop is considerably more unstable than the Ubuntu 21.10 one.

Now I'm in Windows most of the time, I am constantly reminded of little Win annoyances...

For instance, inability to rename an open file.

Or updates. Updates on the Ubuntu one take a few seconds, and rarely need a reboot. Updates on the Windows one take more like 20 minutes and always need a reboot, which itself takes 5 minutes or so.


> For instance, inability to rename an open file.

That depends on whether the app that opened a file holds a lock or not. For example you can rename an open file in notepad or VSCode.


Its an architectural difference by locking filename rather than the inode, and its one of the most annoying "features" of Windows.

Maybe there are some apps that release the lock, but 99% of windows apps lock the filename, and its part of the "reboot after installation" dance for a lot of things.


I agree! Which is why I dislike Windows as well: I’ve lost too much of my life to debugging it’s arcane issues.

Even macOS is starting to grate at times the last few years for similar reasons. I don’t think I like any desktop OSes these days, but running Ubuntu requires the least effort for what I do (and basically no debugging, at least for the last few years), so between it and my Mac it’s been a bit better.

I just had to forcibly uninstall wireless drivers to attempt to upgrade them (with multiple reboot cycles in between, yuck) all to attempt to fix wifi issues (following advice from Metabox’s support team) on my Windows laptop.

It didn’t work. Still garbage. Works great under Ubuntu though.


At this point, all three platforms are their own unique dumpster fires. Everyone has carved out their little living spaces in the corners of their preferred dumpsters, and denigrating others because they prefer this dumpster instead of that dumpster isn't really interesting or productive.

The only winning move is not to play. Throw your computer in the trash, go for a hike, and never come back.


Thank you. I use Windows and Linux daily for development and both provide equal amounts of FFfffffuuuuu....!! moments.


For me personally, it's just ease of use. I can open a terminal, type `wsl` and it "just works".

I use a mac for my job by at home I have a Windows PC and using WSL has been great to use for my side business/projects.

I have no need for "total control" over the emulation. I much prefer linux to the windows command line and this gives me that.


> I have no need for "total control" over the emulation.

A lot of people are saying this, and I guess I just have a mental block. Full-blown emulation was the only game in town for 20 years. Plus there was the 6 years I ran lots and lots of KVM's. I suppose I'm just used to it.


Of course if you are so used to it you may not see the benefits, it's like those people who have crafted their vim/emacs environments and do not appreciate IDE advancements.

But if you think about the occasional user, the new user, the one who does not have such an experience it's like sky vs earth.

In VMs you have to think about a lot of things. Mounting external filesystems, bridging the network, starting and stopping the machine, GPU integration, copy/paste, guest additions, headless vs screen (what screen? do you need a VNC instance?) and so on. It's overwhelming and even dangerous (did you do "rm -rf /directory" withour remembering you mounted your whole host filesystem there? oh my..)

All this stuff is greatly simplified with a lot of Microsoft engineering time that went behind it. Linux processes are very integrated with Windows ones, you install everything with one command, it "just works", and, being target at programmers, all the developing tools stuff work seamlessly.

So yes, for a lot of users it's a huge deal


All of our solution architects on Windows Systems that require Unix Utilities run WSL - none of them even considered running virtualbox/vmware. I can think of a couple reasons. The first is that there is zero learning curve to installing Ubuntu - they have a hundred things they need to learn, and futzing with virtual machines/installing linux is one less thing they have to deal with. The second is seamless integration between their windows applications and linux file system.


>If you need a Linux VM, I have no idea why you wouldn't run a full-blown VM software like Fusion or VitualBox,

If anyone is confused about the benefits of WSL2 like the above statement, here's a video demonstrating the automatic integration of Linux+Windows. A deep link to get past the install & setup:

https://youtu.be/A0eqZujVfYU?t=5m46s

tldw: The difference is WSL2 is more tightly integrated with Windows.

E.g. the WSL2 "Linux" environment can automatically "see" Windows drives and likewise, Windows can see into Linux mount points. You can immediately type "ls /mnt" and see the C: drive of Windows without any setup. In contrast, with full VMware/VirtualBox, I'd have to type in something like:

  sudo mount -t cifs -o username=administrator //mywindesktop/c\$ /mnt/win-c
Of course, entering a command isn't a big deal for technical folks but with WSL2, you don't even bother with the ceremony of it. Also, network ports are automatically set up, so Windows & Linux can communicate with each other. It's lightning fast and seamless, unlike a full vm. Another UI convenience with WSL2 is normal Ctrl+V paste works unlike a Ubuntu vm where I had to mentally pause and remember to press Shift+Ctrl+V.

I stopped running a full Linux VM unless I need the extra isolation for investigating malware.


Windows is better as a Desktop, Linux is better as a server, WSL lets you work with both, seamlessly.

So I do most of my development on Windows, but deploy to Linux servers.


That does not seem to address the question. WSL2 is a VM with a custom init and graphics implementation, but still a VM. So why WSL2 and not vmware or virtualbox or ... ?


WSL2 works seamlessly within the same OS that transparently handles managing the VM. It's better integrated where I use shell scripts in dev projects built using Win dev tools, have both Win command-line and bash open in Windows Terminal, JetBrains IDEs or VS Code. VS Code and Jet Brains also lets you seamlessly open projects in WSL and build with Linux tools, needed for our Ruby Jekyll site.


Seamless cross-system access to files and programs.

Show me a VM that allows me to access the entire host and client filesystem seamlessly without barriers.

WSL allow you to do just that and for that alone it's very useful. You can automate tasks using Windows-only software (compilers, etc.) with Linux userland tools and run both Linux and Windows software without resorting to Wine or similar translation layers that come with their own quirks and drawbacks.

Want to test whether your software package works on Linux as well? No problem, just open a terminal and compile on Linux in the same file system without having to deal with shared folders and configurations.

That's the major selling point for me.


> without having to deal with shared folders and configurations.

Does that work that easily on WSL2? I thought that was mostly a WSL1 things, and thus I have not upgraded yet.


WSL2 can still communicate across file-systems, though it's not particularly advised. For that specific task WSL1 is probably faster.


Its fine for most day to day tasks, for example I have a simple "~/d" symlink to my windows "Downloads" folder that I can use to fetch files I've downloaded in windows Chrome.


It's serviceable for one-offs, but you can't do any really high throughput stuff with that since it's going through a network protocol. For example you really need to keep your git repos on the WSL fs, rather than in the Windows tree. The upside is that they thought about it and Visual Code integration is seamless.


Luckily most of my is pretty segregated - either its all on Linux or all on Windows.


One killer feature is WSL2 can run windows binaries.

I've made an "open" alias to emulate the mac behavour, eg. you run "open fred.docx" inside WSL2 and it will open the document in word.

I've also made a "pbcopy" clone, and have a bunch of other scripts that simplify mundane tasks.


It's the same thing but : cheaper, faster, easier.


> Windows is better as a Desktop

Warning opinion ahead... W98SE was better as a desktop back then. Nowadays, I prefer Linux any day. Reinstalling a Windows machine is a total nightmare, reinstalling a Linux takes me 1.5h at most.


When it comes to things like HDR, floating point scaling, hardware accelerated browser, DRM (netflix etc) it seems linux on the Desktop still "not there" At least what I gather from user reports on /r/linux

Of course if you don't use any of these features it's not that big of a deal.

I'm happy with my windows 7 that got upgraded to win 8 that got upgraded to win 10 + wsl1. ~5 year old installation by now.


I don't have an HDR display, but the rest of the items you list are 'there' at least on Wayland.


Except DRM where Amazon, Netflix et al. just decide that Linux doesn't get HD streaming, but Windows does (one might claim that Linux is maybe better to circumvent DRM since it's the hacker OS, but there is no material difference between a non-secure-boot non-TPM Windows and Linux here; both allow the user to run kernel code and permit effectively full control of the machine).


Just a few days I have been told:

> To achieve an effective resolution of 1920x1080 you're looking at a scaling factor of 1.5, and it just doesn't work well. It also increases battery drain on a system that already has battery life issues.

But I don't know the details. hardware acceleration in browser I think is somewhat new? Last half year or so, is it now by default? You only have stereo and max HD on linux with most streaming providers. No surroundsound.


> W98SE was better as a desktop back then.

Other than nonexistent USB drive support, it is a great desktop back then. I have many fond memories tinkering with Win98SE. I upgraded to WinME (stupid stupid move...) then went back to 98SE, then upgraded to WinXP pre-SP1 and hated it. So I went back to 98SE and remained in 98SE until WinXP SP2 came out. I felt 98SE was the last version (Perhaps 2000, again I only used it in high school) that caters on the interactivity between the people and the computer.

Now... it is like "screw you, we decide what is BEST for you and you have to suck it up". I do miss using 98SE and looking back of how it is a security nightmare because I deleted like drwatson.exe and few system files to get more space back for my Diablo II. You can imagine my reaction when it failed to boot up Windows next time. Ahh so much memories.


I just meant the desktop. It was consistent, free from spy-ware, not too bloated, responsive.


I have the opposite experience, but maybe it's just because you and me know the quirks of each system.


I like working with linux but linux as a desktop is still a nightmare outside of dev environment bubble.


Linux isn't a desktop, it's a kernel.


Windows is a package that also contains a desktop, and a kernel (since W'95 at least), and a whole bunch of other stuff.

Think you got what my colloquial ass I meant.


Windows is "better" at enterprise, big companies give windows machines to thousands of employees. Big contracts, vpns, proxies, active record, etc. Microsoft sells a "working-integrated" (or maybe easy to setup) solution. Developers work best under Unix envs, most tooling is built around unix. Thus, having a usable dev environment on windows becomes easier with WSL2. That's where I think WSL2 fits well.


My corporate desktop is behind. We're running a build of Windows 10 that doesn't even support WSL2. We're going to have to wait until next year's hardware refresh to get Windows 11, but I don't know if they'll allow us to enable it. All it would take is for one person to point out how it's basically another machine running on the same hardware, and my IT department would probably freak out and demand that we install all the anti-virus and "endpoint protection" software on it.


Windows Defender for me was late to the party when scanning source code... it detected it but little bit too late. If your IT dep ever freaks out, tell that someone on the internet was actually protected within WSL + Docker: https://news.ycombinator.com/item?id=29159990#29160902


I've always used Windows to develop Linux (previously Unix) server applications. Have done since 1996. Originally I used Windows because it was the only way to have a laptop. I like to code on airplanes and so on. Subsequently, I never saw a reason to change -- Macbooks are much more costly than Windows and "weird" if you're used to Windows. The flavor of Unix supported in macos is not the same as Linux. Linux on the laptop was never a serious solution because none of the Windows apps that I use would work. Also historically many hardware features (power management, WiFi, ...) didn't work well.

I began this journey before VMs on the desktop existed, and although I have used VMWare and VirtualBox, I found them cumbersome vs my preferred approach which was to make the Windows shell work like Unix (then Linux). For most of history I used Cygwin for this. You click a button and get a shell where you can run your build, utility commands etc, and you can use Windows native IDE such as IntelliJ.

I'm now a heavy WSL2 user. For me it is : Cygwin that works perfectly (since it's running a real Linux kernel and distro).

Yes, underneath it's a VM but the implementation is extremely fast and well integrated. I still get to click a button and have a shell I can run my build in. Filesystem access in both directions works. Docker even works. I no longer need to worry that yarn behaves oddly when running on Windows.

I don't (for this purpose) want "total control", I just want it to work out of the box. I also want it to keep working when my NT kernel updates, which can't always be said for VirtualBox and kin.


The simple answer, is you just have to try it.

It's not a use case. It's linux. Fusion and Virtualbox are terrible in comparison. With WSL2(g) you get GPU acceleration, audio, X apps and whatever distro you want (and running them in parallel if you so wish). VS Code in WSL with Docker is great - much better experience than MacOS if you ask me - especially with an architecture change.


I also thought what you have described. However I have noticed that there are some advantages to WSL2. The biggest is that VS Code is so tightly integrated. It is truly plug and play. With virtual machines I had to constantly keep fiddling with ports and network interfaces and IP addresses. It really "just works" when you use VS Code with WSL2. Another is that Windows is smart about starting and stopping the Linux VM. I don't have to manage it. It starts up when you open a terminal or open your project in VS Code. It shuts down after some time if you don't use it. No memory usage, no CPU usage.


That's interesting. I've never tried it, but having it "just work" would indeed be nice, IF it always did the right thing. The first time it made a bad assumption that I had to tweak a config file to fix, I'd be running back to a "real" VM host. Have you ever had to do modify how it runs? (Maybe that's not even possible.)


> Have you ever had to do modify how it runs?

No I haven't modified its behavior beyond a few of the common preferences in the settings page.


I'm also not sure why I'd use WSL2 and there are at least three big problems I ran into with it straight after upgrading:

* It broke my ability to flash my ESP32 via USB (guessing WSL2 has trouble accessing USB devices)

* It uses significantly more RAM than WSL1

* There is performance problems when working on NTFS partitions, or at least there were when I tried it: https://github.com/microsoft/WSL/issues/4401


Corporately managed desktops/notebooks within Active directory with various security and automation settings applied. (If that sounds scary, to you, well... I have actually better piece of mind for my work laptop than home. As a bonus, I get to know the applied configurations as I was one of responsible to implement them). Yet, powering up wsl to start node application and fiddle around if necessary. To me it sounds great.

Ofcourse, node can be configured on windows too. But then you need different docker commands/builds and docker desktop now is not free for everyone, etc.

By the way, playing around with docker build for npm app within WSL, I happened to npm install the vulnerable ua-parser-js version. Security gave me a call and we were relieved that it was within windows-wsl-docker instance. So after validation, no compromise within upper layers. This was actually an eye-opener for me that, given the threats of npm and stuff, gave some serious bonus points for jumping into docker-fan-bandwagon.

Running VM takes more hassle (but is ofcourse an option). Setting up WSL and playing around was very easy. And you don't have to think about forwarded ports and mapping file system. And running "code ." within WSL felt good - vscode poped up locally but terminal/code is actually on WSL. And you get to browse your localhost on Windows that is actually on linux. Doable on VM, but then one needs to know how to configure ssh, passwordless auth.

If you are Linux-first user, yeah, maybe you don't see value. But think about it - this is also introducing windows folks to Linux!


>this is also introducing windows folks to Linux!

I highly doubt that. Nobody is playing around with WSL for fun, and it's more annoying to get into than just writing a USB and booting Linux directly. No, what WSL accomplishes is pulling people who need Linux due to its technical superiority away from Linux-proper. It's embrace-and-extend.


Linux is a nicer development environment, Windows is a nicer desktop environment. I use WSL2 full time for development (python/django, ruby/rails) and it's almost as nice as being on OSX. Almost.


You say that, but what you do like about the desktop environment on Windows more? Of course we don't need a battle of desktops, just curious about what you've tried and didn't like on the Linux side. (I abandoned Windows in 2000, and have hated the limitations Windows desktop I've tried since, up through Windows 10.)


I prefer WSL2 over OSX, just from the fact that apt is so much quicker and reliable than brew.


I use WSL2 daily for work. It's much better then using a fullblown VM, because it's much much faster to open and is completely integrated into Windows, and works seamlessly with Docker for Windows, which is now an order of magnitude faster compared to before. Soon, using VM applications like VirtualBox will make no sense at all for most use cases.


well... completely integrated is a stretch.

I'm currently wrestling with Ubuntu because IntelliJ will crash hard when opening a Java project on a WSL path.

When it doesn't crash (downgrade the jbr) it will fail to establish the RMI connection with the mvn process in Linux.

In a previous Scala project I also had to go Ubuntu native because the IntelliJ sbt plugin would run the Win10 jvm even when running in the WSL2 context.

So, yeah... there's enough differences to make it unusable for me.


Seems like you would have these exact same problems if you were running Ubuntu in a VirtualBox VM also?


Nah, I wouldn’t have tried to run IntelliJ from windows at all, or I’d have run Mingw or just booted to Linux.

Or just gone MacOS as I’ve done for 15 years. I tried out windows out of exasperation for Apple’s latest intel lemons and out of curiosity, wondering if the grass has finally grown on the other side of the wall. Nope, still the same


Virtual box is incredibly slow and graphically buggy on even a beefy windows machine. I was very happy when I moved to wsl2 from an Ubuntu VM run through a virtual box window.


> Who here is writing software which runs on Linux, yet needs to be running Windows while they do it?

Lots of developers: NodeJS, Ruby, Python, Data Science folk... They typically deploy on Linux in production so often want Macs to get a POSIX-ish environment on their development environment (sadly, too few developers run Linux on their laptops).

Yes, VirtualBox is helpful. Many people use automation on top of it, too e.g. vagrant. But WSL2 arguably improves the dev experience by making it a standard, "out of the box" affair.

I see WSL2 as a way for Windows to compete better against Macs. It definitely isn't going to convince Linux fans to switch. But they can ask you to consider: you can now get a newer `bash' out of the box with Windows than macOS. Which OS works better for POSIX-stack development?


I don't know if it's too late for that group. Macs are fashionable and I think people will feel they're being treated poorly if given a Windows laptop instead.

You're right on with WSL2 providing a standard usable environment though. Windows and Mac developers both need a ton of handholding to get started and WSL2 makes it a lot easier to hand them a wiki page and expect fewer 1:1 calls to tweak setups.


> Which OS works better for POSIX-stack development?

Linux. The one you're _actually_ using. Skip the proprietary ad company desktop and use what you're wanting to.


I don't want a full VM with a full desktop experience with all my development related applications to be a separate experience from the rest of my non-development computer use cases. I like that I can very quickly open a single terminal, open my local install of VSCode that I do some non-Linux specific development in as well, open my normal day-to-day browser to look at docs, etc and just have it. It's the same computer and the same environment that I do everything in. I don't need two sets of keybindings, two sets of applications, two terminal configs, a whole new desktop env etc just to write some non-Windows software. It's just VSCode using my exact same config and keybindings, my normal browser, and my same terminal emulator.


I am often happy to give up full control in exchange for convenience. WSL2 works fantastic for very quickly getting a Linux box up and is pre-configured for interoperability with Windows. Sometimes I don’t want to mess around getting these types of tools up myself.


> I just can't understand why anyone cares about WSL2

It works seamlessly with Docker Desktop, the MS terminal has built in support to switch between WSL 2 distros and you don't need to set up an X server to run what feels like a native Linux terminal emulator from Windows like you would if you manually ran a VM.

All of these are advantages over rolling your own VM. Around 6-8 years ago I used to run a self managed Linux VM on Windows with VMware Player and Unity mode. Current day WSL 2 is better in pretty much every way for general purpose web development and wanting to use the command line from Linux.


I believe the question is who actually needs a Windows machine. Office also runs on Macs and, unless you need to do some fancy spreadsheeting, LibreOffice is there for you. If not, the web-based Office or their Google counterparts can do a lot through the browser. WSL is still much slower than a native install of Linux on the same hardware.


I prefer to work on windows. My hardware just works, all of the programs I need just work, and it has better integration with the shell I prefer (powershell). The only time I ever need Linux/Unix is when some Unix dev decides to not use cross platform tools in their project (e.g. posix shell).


While I have been cautious, avoiding bleeding-edge CPUs and dGPUs (and Nvidia), I haven't had a computer that didn't work with Linux in at least 15 years. I am always curious what hardware doesn't work that is essential enough to use Windows.


I am. Work laptop is Windows, but I'm writing code that runs on Linux VMs. The software cycle is the same as using Linux (but granted, I've always kept my development process in terminals)

I started out in a virtual machine before wsl2. I want a terminal that interacts with the Windows environment (easy copy paste, mouse support in terminal, no lag of running graphical environment in terminal), so I was sshing into my virtual machine. wsl2 skips that step. I was sshing into wsl until Windows Terminal since before that I was using some Chrome SSH app which had mouse support


This is MS trying to bring back developers to their closed platform. I wouldn't touch this with a 10m pole.


It's so that the next generation of developers don't need to learn Virtualbox or any other virtualization stuff. I think the power tools are not en vogue in general. I have seen many of my software engineer colleagues doing their work with basic tools like Notepad and Windows Explorer.

So answer your question: this is one Microsoft's newer efforts to lock people into Windows. This is one of the ways which are not locking people in by force; this one works by inducing complacency.


Or, hot take here, they just want you to be more productive on Windows so you continue buying Windows. Surprise! That's how innovation works! You keep using the product if it's easier than the alternative.


There's an even better thing, for them, which is when people don't have a real alternative.


> Who here is writing software which runs on Linux, yet needs to be running Windows while they do it?

There are plenty of companies that are locked in to Windows for their workstations but have servers running on Linux. Many financial companies for instance. As a developer you have the choice of developing in Windows, in a VM or in WSL2. I personally find WSL2 the lesser evil of the three.


As others have mentioned, the preference for the Windows desktop environment, but also Microsoft are putting work into development tools that integrate into WSL quite well.

For example, VSCode integrates fairly seamlessly into WSL, so your app can be running in WSL but your editor in native Windows and they manage all the complexity of the host -> vm communication for you.


In a word, embedded. All our user facing software and development tools are Windows, all the code I actually write runs on Linux.


I often use WSL2 for my work on my Windows laptop. It supports Kubernetes, Docker that you installed on the Windows machine. You can also easily throw files, deploy web services, servers on WSL and access it from windows browsers. I can use my MS Office at the same time without any problem. It is much better than using Ubuntu in my opinion


I hear you saying that you like to be able to run native Outlook and Teams while you work on things that need to deploy to Linux. Am I reading that right?


My use case is simpler.

Finally a proper terminal in windows that makes it a worthy dev environment.

wsl2 with docker surpasses the osx experience now as well.


Because a VM requires you to manage a window for the VM itself. WSL is more seamless. Speaking of seamless, VirtualBox has a "seamless mode", where guest OS apps can appear as normal host OS windows. However, if you're running a "full Linux distro" inside your VM, this isn't very useful, because you'll have this ugly and tricky-to-manage Linux GUI widget also (the dock on GNOME, or the taskbar on KDE). WSL also lets you launch Linux apps from the Windows start menu, which you can absolutely achieve with VirtualBox, but it'll be a manual effort of writing BATCH files.


What you see as an up side "total control" I see as a downside "Required Control". Why do I need to specify how many VCPUs it gets and exactly how much ram it gets? I don't really care, I just want a little Linux environment to fool around with.


And what do people do for versioning software on WSL2? My benefit with full-blown VMs is that when piece of software I'm writing needs specific packages, I can set them up and not affect anything else.

This goes beyond venv, virtualenv, nvm to having multiple database point releases installed, or underlying graphics processing libraries.

I like the speed and seamlessness of WSL2 but my nightmare on Windows and OSX has been the mismatch of versions which when you've 20+ projects over a few years starts to make keeping them all in running states a nightmare.

Is the WSL2 answer to VMs to use WSL2+Docker?


Yeah docker for repeatability. Has the advantage of making it much more reproducible for others. A dockerfile and docker-compose.yml are much easier to check into git than a full VM image.


yes, WSL2+Docker works well enough and a lot of tools have wsl and Docker integration so it's easy.

If you already use docker containers it's a win win.


I don't use WSL because it's linux, I use it just because it's a better prompt/shell environment for Windows.

I have a decent Windows for gaming (and to do the occasional actual Windows app development, but very rarely), so I use that for my work now (web development). The tooling is just better within WSL than natively in Windows.

I'm not sure about the actual overhead of WSL vs a full VM, but I've never experienced any problems with WSL and it's pretty seamless. A full blown VM running in VirtualBox just feels like a lot more overhead.


Reasons I installed:

* I wanted to work at the Linux command line without exiting windows/rebooting

* I didn't know anything about VMs. What options are available, cost, how to set them up etc..

* zero-knowledge to installation took 5 minutes.


Because for some reason people think Windows is a good desktop experience.


"Who here is writing software which runs on Linux, yet needs to be running Windows while they do it?"

Backend developers at .NET shops who were issued Windows laptops by their companies.


If your desktop environment is Windows, but an open source project you want to contribute to supports Linux more naturally, but Windows is more tricky to get up and running. It is easier with the support VS code has for the integration with WSL2. I can develop in a Windows environment, but run tests and build on Linux.


Some companies only support OSX or Windows workstations, in which case WSL helps (for the latter scenario).


For the most part I am with you, I would prefer either Linux or macOS if I want that sort of environment but I recently setup windows 10 with docker and wsl2 and it has come quite a long way since I first tried it. Like, I could actually see myself working in that environment.


For me it’s just a useful underlay for Docker development containers with VSCode.

Previously I was using Multipass with Ubuntu (on Hyper-V) but that had some weird issues annoyingly, that WSL2 just doesn’t. It’s basically seamless for me at this point.

But my use case is narrow as heck.


Linux affords the GNU userland: unencumbered and well-tested FOSS tooling. I use WSL the way I use Cygwin.

But if I had to choose between the too, I would favour the longevity of Cygwin.


Personally I use it for the command line tools / bash scripts that I can use with files on windows drives seamlessly. It's just convenient.


I use it to run Emacs with Magit quite nicely :)

    $> wsl --install -d Ubuntu-20.04
    $> wsl
    $> sudo apt upgrade
    $> sudo apt update
    $> sudo apt install emacs
    $> git clone https://github.com/.../.emacs.d.git
    $> emacs --daemon
Shortcut on desktop (with VcXsrv running):

C:\Windows\System32\wsl.exe bash -c "export DISPLAY=localhost:0.0 && export LIBGL_ALWAYS_INDIRECT=1 && export XCURSOR_SIZE=16 && setsid emacsclient -c"


It makes sense for ramsonware people. With WSL they can encrypt also your linux files so they can ask for more money.


WSL:

- starts instantly

- takes as much memory as it uses

- just works

No setup, No config, no fuss. It doesn't get any easier than this.


a linux VM is an isolated OS, WSL is fully integrated with Windows


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: