Live data from Hacker News

GWSL: Run graphical Linux apps in WSL

github.com

51–60 of 132 posts

Re: GWSL: Run graphical Linux apps in WSL

#51
post #35

Earlier quoted context omitted.

Mac OS is the evolution of NeXTSTEP, so that is easily done anyway. Windows, well Microsoft did a big mistake of never managing the POSIX subsystem in a proper way. Linux took off thanks to GPL, BSD ongoing legal problems at the time, and Microsoft just doing the basic regarding POSIX support on Windows.

Linux took off because SCO was trying to get $500 per CPU for a Unix license on PCs that were selling for $1000 or in some cases less. Windows NT at the time was also priced similarly to SCO Unix. When Windows XP Pro came out at $250, commercial Unix was twice as expensive.

Commercial UNIX never had that problem, I was dual booting between Windows NT and Linux during my university degree.

Re: GWSL: Run graphical Linux apps in WSL

#52
post #14

Does this work with WSL, WSL2 or both?

VcXsrv works with both, IMO I would just use it directly. I've been happily using it to run GUI apps in both WSL 1 for WSL 2 for quite some time now.

Check this comment for more details: https://news.ycombinator.com/item?id=25455503

Re: GWSL: Run graphical Linux apps in WSL

#53

Earlier quoted context omitted.

> That's how I do it- mostly to run urxvt. > Off-Topic: I'm setting up a new machine, and wondering whether I should use WSL 1 or 2 (or both?). Is there a clear path forward for these systems? WSL 1 has served me pretty well. Most of the inter-filesystem interaction amounts to using rsync to back up directories. Otherwise it's just sshing into servers. I use virtualbox for off-line development. I would recommend wsl2…

Maybe I did something wrong, but for me getting a local X-server running, with X-forwarding from WSL1 was dead easy and something I used on a day to day basis. Getting the same working with WSL2 was a pain in the ass, and I eventually gave up. So if you like X-forwarding... I personally would recommend sticking to WSL1, unless that gives you other issues.

> Getting the same working with WSL2 was a pain in the ass, and I eventually gave up.

Overall it works the same as WSL 1, you just need to change DISPLAY=:0 to DISPLAY="$(/sbin/ip route | awk '/default/ { print $3 }'):0"

Here's a snippet from my bashrc that handles both WSL 1 and WSL 2: https://github.com/nickjj/dotfiles/blob/385007837ab787a2be2e...

Re: GWSL: Run graphical Linux apps in WSL

#54

Earlier quoted context omitted.

> That's how I do it- mostly to run urxvt. > Off-Topic: I'm setting up a new machine, and wondering whether I should use WSL 1 or 2 (or both?). Is there a clear path forward for these systems? WSL 1 has served me pretty well. Most of the inter-filesystem interaction amounts to using rsync to back up directories. Otherwise it's just sshing into servers. I use virtualbox for off-line development. I would recommend wsl2…

Maybe I did something wrong, but for me getting a local X-server running, with X-forwarding from WSL1 was dead easy and something I used on a day to day basis. Getting the same working with WSL2 was a pain in the ass, and I eventually gave up. So if you like X-forwarding... I personally would recommend sticking to WSL1, unless that gives you other issues.

Is "X-forwarding" being able to see and interact with linux GUI apps running inside WSL on Windows? I do this to run Cypress interactively within WSL2.

I have no idea what I did (i just blindly follow some guide on a no-name blog), but I got it all working fairly effortlessly. The only slightly annoying thing is having to start the server on windows if i restart my pc, but otherwise it was pretty easy.

Re: GWSL: Run graphical Linux apps in WSL

#55
post #53

Earlier quoted context omitted.

Maybe I did something wrong, but for me getting a local X-server running, with X-forwarding from WSL1 was dead easy and something I used on a day to day basis. Getting the same working with WSL2 was a pain in the ass, and I eventually gave up. So if you like X-forwarding... I personally would recommend sticking to WSL1, unless that gives you other issues.

> Getting the same working with WSL2 was a pain in the ass, and I eventually gave up. Overall it works the same as WSL 1, you just need to change DISPLAY=:0 to DISPLAY="$(/sbin/ip route | awk '/default/ { print $3 }'):0" Here's a snippet from my bashrc that handles both WSL 1 and WSL 2: https://github.com/nickjj/dotfiles/blob/385007837ab787a2be2e...

Thanks for that.

Re: GWSL: Run graphical Linux apps in WSL

#56
post #27

Earlier quoted context omitted.

VcXsrv binds to localhost by default, so unless you already have malware on your system the added risk is quite small I'd say.

What about javascript code on a harmfull website that does requests to localhost? It used to be possible to easily scan what sites are running locally, even if js code was from a public website. [0] [0] https://defuse.ca/in-browser-port-scanning.htm

The main impediment is that http request won't look anything like the x window requests, so the x server would likely reject it.

Re: GWSL: Run graphical Linux apps in WSL

#57
post #4

Isn't it officially coming anyway from Microsoft - https://www.theverge.com/2020/5/19/21263377/microsoft-window...

This will be a game changer if they flesh it out. Imagine Linux apps right alongside your windows apps with their own icons and everything. Windows Terminal + Visual Studio Code + WSL2 is the bee's knees.

Until they allow USB passthrough (which is more or less blocked by the fact that Hyper-V itself doesn't seem to have the feature), a whole bunch of my use cases are basically barred from WSL2. Shame, cause otherwise I really, really enjoyed using it - coming from a guy who's been on Linux for 99% of his time for ~15 years at this point.

Re: GWSL: Run graphical Linux apps in WSL

#58

Earlier quoted context omitted.

> That's how I do it- mostly to run urxvt. > Off-Topic: I'm setting up a new machine, and wondering whether I should use WSL 1 or 2 (or both?). Is there a clear path forward for these systems? WSL 1 has served me pretty well. Most of the inter-filesystem interaction amounts to using rsync to back up directories. Otherwise it's just sshing into servers. I use virtualbox for off-line development. I would recommend wsl2…

Well, except for the timekeeping problem (there are workarounds but they're annoying) and the significant networking issues (no bidirectional port forwarding so "localhost:8080" doesn't work with server in WSL and DISPLAY=:0.0 doesn't work with server on Windows).

Also if you connect to a VPN (like your corporate VPN using Cisco Anyconnect), you lose connectivity within WSL2...

WSL is nice to have and a million times better than DOS/Powershell but it's not at Linux/Mac terminal level yet.

Re: GWSL: Run graphical Linux apps in WSL

#59
post #4

Isn't it officially coming anyway from Microsoft - https://www.theverge.com/2020/5/19/21263377/microsoft-window...

The author of that article seems to be conflating GPU support somehow with GUI apps. GPU support is indeed coming to WSL2 and is available currently in Insider builds along with a special release of the Nvidia driver and some Linux support packages.

This, however has nothing to do with graphical applications or GPU acceleration of such. It’s entirely targeted to machine learning frameworks.

I do think Microsoft has said that GUI stuff is on the roadmap. I hope they can continue to force the hand of Nvidia on the ridiculous matter of not providing any kind of GPU virtualization on their consumer cards.

Re: GWSL: Run graphical Linux apps in WSL

#60
post #59
post #4

Isn't it officially coming anyway from Microsoft - https://www.theverge.com/2020/5/19/21263377/microsoft-window...

The author of that article seems to be conflating GPU support somehow with GUI apps. GPU support is indeed coming to WSL2 and is available currently in Insider builds along with a special release of the Nvidia driver and some Linux support packages. This, however has nothing to do with graphical applications or GPU acceleration of such. It’s entirely targeted to machine learning frameworks. I do think Microsoft has s…

You should be able to run Linux GUI apps via WSL2 on a preview build soon.

https://devblogs.microsoft.com/commandline/whats-new-in-the-...

Post reply on HN