Hacker News new | ask | show | jobs
by selectodude 2042 days ago
WSL1 hasn't gone away for those who prefer it. But we're talking about an extra gigabyte. It's still cheaper than a full VM.
4 comments

It's even cheaper to only use what you need with msys2!

bash inside mintty gives me all I need, with minimal overhead.

Eventually, I'd like to see bash inside Windows Terminal made easily available - complete that with busybox, and you cover 90% of the Linux usecases without having to download anything (a bit like how starting Terminal.app offers most of what you need on MacOS)

Add an option to install packages using msys2/pacman for the power users, and I believe most people would not waste time (or disk space, or ram) playing with WSL1 or WSL2 just to run the one thing they may need.

What makes you think the overhead between Cygwin/msys2 and WSL 1 would really be so great? They are both just translation layers after all.
WSL1 tries to do too much. WSL2 tries to do even more.

msys2 mostly cares about running your textmode software.

For example, someone talked about processes. Here's all that I see in msys2:

# ps xwau

      PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND

      480     479     480      18796  pty1      197611 14:13:13 /usr/bin/bash

      479       1     479      16872  ?         197611 14:13:12 /usr/bin/mintty

     1118     480    1118      16496  pty1      197611 17:00:32 /usr/bin/ps
Most of the time, I don't need to access Windows processes - and if I do, data can be exchanged through a file.
WSL1 also doesn't show windows proceses in 'ps', only the WSL processes. For example:

    shawnz@ShawnsPC:/mnt/c/Users/shawn$ ps xwau
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root         1  0.0  0.0   8936   184 ?        Ssl  Nov17   0:00 /init
    root         6  0.0  0.0   8936    96 tty1     Ss   Nov17   0:00 /init
    shawnz       7  0.0  0.0  18588  2708 tty1     S    Nov17   0:00 -bash
    shawnz     252  0.0  0.0  18880  1984 tty1     R    18:04   0:00 ps xwau
But in your example, I can already see you have a init system and multiple users - neither of which will be needed in most cases.
The "init" process is just a stub used by WSL, it is not a "real" init system. And Cygwin also allows the creation of multiple users within the Cygwin environment, doesn't it? It's just a matter of populating /etc/passwd. If you want to use WSL1 with a single user then you could just set the default user to root.
main draw for wsl2 for my team was IO performance. how is git on huge projects under msys2?
It's clear that they are not enthusiastic about delivering new features to WSL1. Consider how WSL2 now exclusively features CUDA support, Wayland support, loop mounts, Docker, etc.
Docker support is precisely the sort of feature that would have required significantly more work to support in WSL1 than WSL2.
Yes, admittedly loop mounts and Docker were an easy add for WSL 2 and would have been significantly more complicated for WSL 1.
Docker can also make use of Windows containers, and that is probably easier when everything is running on top of Hyper-V, as type 1 hypervisor.
Docker works fine with WSL1, I don't think I can use WSL2 at work as we're waiting on the next LTS version of Windows.
Docker can't be hosted on WSL1. You can use the Docker client on WSL1 to communicate with a Docker host running on WSL2 or Hyper-V, though (which is how Docker Desktop works)
I think WSL1 is there for transitional purposes and will be thrown away eventually. It was already incomplete, it didn't support forwarding any ICMP packets other than ping, so traceroute didn't work for example. I don't expect it to stay as an option for long.
At work we develop on Windows virtual machines, and WSL1 won't run on a VM. Fortunately WSL2 does, so at least I can enjoy Linux tooling I sorely missed.
Interesting, I would expect the opposite problem since WSL1 doesn't use virtualisation in any way. Do you have more details about the error you experienced?
Unfortunately I tried WSL1, didn't work, and left it at that for months. When WSL2 was out, it just worked and I had forgotten by then what kind of error WSL1 gave me.

I can only recall it was a dialog box, not a crash, and that it had to do about virtualization.