Live data from Hacker News

Windows Subsystem for Linux: The lost potential

jmmv.dev

91–100 of 250 posts

Re: Windows Subsystem for Linux: The lost potential

#91
One of the things I really liked about WSL1 was the integration with Windows. This caused some bugs but made other task a lot simpler. For example editing a file that existed in the Windows file system with a Windows application and then actually processing it with a linux binary worked really well most of the time.

With WSL2 you are expected to only interact with files in the linux filesystem with linux. I'm sure this made a bunch of easier for the dev team but it kinda ruins WSL for me.

I still haven't figured out how to call a binary that exist in the linux vm from Windows or how to interact with the windows network from linux.

Re: Windows Subsystem for Linux: The lost potential

#92
post #72

> Can you imagine how cool it would be to manipulate Windows services from the WSL session? This was a little confusing, in some ways, because it came right after "being able to list out processes to kill". A Windows Service is a lot like a `systemd` service. In the scenario he envisions where you could see windows processes within WSL[0], it'd be possible to write a script that could invoke the windows-equivalent co…

In WSL1, you can't see windows processes in 'ps' or '/proc/[pid]' as if they were linux processes, but you could just execute the Windows tasklist.exe/taskkill.exe binary instead and parse the stdout. Actually, you could do the same with WSL2 also.

Re: Windows Subsystem for Linux: The lost potential

#93
post #83
post #67

Earlier quoted context omitted.

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…

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.

Re: Windows Subsystem for Linux: The lost potential

#94
post #56

WSL 1 (haven't tried 2 if they have some sort of magic for this, guess not) can actually run windows applications. So you can run "ipconfig.exe | cowsay" for instance. I'm not in front of a windows machine now but you could do stuff like list windows processes with a windows command, filter it with linux command and take the result to kill a process. All in a short line. And honestly, more integrated than that I'm no…

WSL 2 actually also supports that integration. It works by transparently sending the stdio over the network to/from the host instead.

Re: Windows Subsystem for Linux: The lost potential

#95
post #14

If you want a Linux-like environment on Windows that can see and be seen from the Windows side, there is Cygwin. It's not as deeply integrated as WSL1, nor has binary compatibility (you'll have to get binaries compiled for it or compile them yourself) but last time I checked (Windows 7, IIRC) it did the job.

I tried migrating to wsl (1) but there was just too many little things not working so went back to cygwin. WSL had issues with watching files, mounting some network drives and windows interop that I've never had with cygwin.

Re: Windows Subsystem for Linux: The lost potential

#96
post #93
post #83

Earlier quoted context omitted.

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 do…

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

Re: Windows Subsystem for Linux: The lost potential

#97

Earlier quoted context omitted.

Even within Explore to mount a remote linux server over ssh?

why would you need that if you have the command line functionality already? Windows has shipped with sftp for a while now. about the only think missing is a stand alone ssh client on the windows side but for that there is putty.

[deleted]

Re: Windows Subsystem for Linux: The lost potential

#98
post #95
post #14

If you want a Linux-like environment on Windows that can see and be seen from the Windows side, there is Cygwin. It's not as deeply integrated as WSL1, nor has binary compatibility (you'll have to get binaries compiled for it or compile them yourself) but last time I checked (Windows 7, IIRC) it did the job.

I tried migrating to wsl (1) but there was just too many little things not working so went back to cygwin. WSL had issues with watching files, mounting some network drives and windows interop that I've never had with cygwin.

Consider giving WSL1 another try sometime, the inotify bug in particular was fixed some time ago in WSL1.

Re: Windows Subsystem for Linux: The lost potential

#99

This is a really interesting article, and WSL 1 was a testament to Dave Cutler's vision for the NT architecture re: support for multiple operating environments (read 'Showstopper!' for more background). Also, as someone hacking with a custom OS kernel in their spare time, I found this quote illuminating when it comes to understanding the lower level: > A user-space process is a collection of binary instructions that…

Showstopper! was an excellent book. I found a new appreciation for dogfood after that.

Re: Windows Subsystem for Linux: The lost potential

#100
I have zero insight obviously but I still believe it was ptrace that broke the camels back. And yes, I had so much hope for WSL1.

> ptrace(PTRACE_TRACEME, 0, 0, 0) = -1 EPERM (Operation not permitted)

Issues also exist for PTRACE_O_TRACEEXIT, PTRACE_O_TRACEEXEC, PTRACE_OLDSETOPTIONS, PTRACE_SYSEMU.

Post reply on HN