Live data from Hacker News

GWSL: Run graphical Linux apps in WSL

github.com

41–50 of 132 posts

Re: GWSL: Run graphical Linux apps in WSL

#41
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

A JS based exploit that hijacks the X Window System Core Protocol running on your localhost to inject key presses into your X server or steal screenshots? I mean it's possible, but it seems quite far-fetched except maybe if someone specifically targets you.

Re: GWSL: Run graphical Linux apps in WSL

#42
post #2

VcXsrv and a bashrc to set DISPLAY= automatically did it for me export DISPLAY=$(route -n | grep UG | head -n1 | awk '{print $2}'):0 and on the Windows side, start VcXsrv with the 'Disable Access Control' combo box checked. this will enable X clients from other hosts (WSL is another host, basically) to connect to the server without too much hassle. that's it.

And that is slow as hell, laggy scrolling etc. Hope the MS implementation works better.

Re: GWSL: Run graphical Linux apps in WSL

#43

Both Windows and Mac OS run Linux apps better than Linux does now. No greater testament to the humiliating defeat of open source than this.

Aside there being no truth to this assertion, last I looked even MS is publishing lots of open source software...

Re: GWSL: Run graphical Linux apps in WSL

#44
post #32

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.

> 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).

Re: GWSL: Run graphical Linux apps in WSL

#45
post #34

Both Windows and Mac OS run Linux apps better than Linux does now. No greater testament to the humiliating defeat of open source than this.

In what way do Windows and Mac run Linux software better than Linux?

Windows lets you run Linux apps at the same speed as raw metal Linux, but with good drivers for things like video cards, wifi, etc. Windows also gives you access to a more diverse selection of its own apps so you can get your day job done. As for Macs, you get nearly the same benefits as that but now you also get access to the best hardware money can buy, from the cpu right up. I'm sure Linux will be ported to Apple Silicon eventually, but one look at the history of Linux even on x86 laptops shows how it will suck with half-finished drivers, shitty UI and terrible touchpad semantics, etc. Linux will always be a third rate OS for desktops.

Re: GWSL: Run graphical Linux apps in WSL

#46
post #35

Both Windows and Mac OS run Linux apps better than Linux does now. No greater testament to the humiliating defeat of open source than this.

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.

Re: GWSL: Run graphical Linux apps in WSL

#47
post #42
post #2

VcXsrv and a bashrc to set DISPLAY= automatically did it for me export DISPLAY=$(route -n | grep UG | head -n1 | awk '{print $2}'):0 and on the Windows side, start VcXsrv with the 'Disable Access Control' combo box checked. this will enable X clients from other hosts (WSL is another host, basically) to connect to the server without too much hassle. that's it.

And that is slow as hell, laggy scrolling etc. Hope the MS implementation works better.

> And that is slow as hell, laggy scrolling etc.

It's not slow for me. Maybe you have something else running that's interfering with WSL (Defender, etc.)?

I've been using the VcXsrv set up for years (in WSL 1 and now WSL 2). It runs native GUI Linux apps really well. It's how I ran Sublime Text in WSL for a long time before I eventually switched to a different editor. I even ran i3 in it for a bit but gave up on that because it didn't work well with dual monitors. It was smooth as butter tho.

Re: GWSL: Run graphical Linux apps in WSL

#48

Both Windows and Mac OS run Linux apps better than Linux does now. No greater testament to the humiliating defeat of open source than this.

Aside there being no truth to this assertion, last I looked even MS is publishing lots of open source software...

All significant open source development today is done by folks who are not "scratching an itch" but cashing a paycheck, and the projects they release are things that would not have made them money anyway. The actual valuable stuff the trillion-dollar companies of today do is still overwhelmingly closed because secrecy is still a better way to engineer products that sell.

Re: GWSL: Run graphical Linux apps in WSL

#49
post #2

VcXsrv and a bashrc to set DISPLAY= automatically did it for me export DISPLAY=$(route -n | grep UG | head -n1 | awk '{print $2}'):0 and on the Windows side, start VcXsrv with the 'Disable Access Control' combo box checked. this will enable X clients from other hosts (WSL is another host, basically) to connect to the server without too much hassle. that's it.

You'll want to make sure clipboard sharing is enabled too. This way you can share clipboard data from WSL and Windows.

My VcXsrv config is public on GitHub at: https://github.com/nickjj/dotfiles/blob/master/c/Users/Nick/...

Putting it in that directory sets VcXsrc to start when Windows boots up. You would just replace "Nick" with your Windows user name and put it in that path. Then you never have to worry about starting VcXsrv ever again.

Also if anyone is using both WSL 2 and WSL 1, you need to set different values for DISPLAY depending on which version you use.

My .bashrc handles this at: https://github.com/nickjj/dotfiles/blob/385007837ab787a2be2e...

Re: GWSL: Run graphical Linux apps in WSL

#50
post #32

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.

> 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.

Post reply on HN