GWSL: Run graphical Linux apps in WSL
github.com
github.com
Windows Terminal + Visual Studio Code + WSL2 is the bee's knees.
It's getting better all the time though - they tease usb passthrough might be doable as it's already supported with remote desktop
Once they figure that out I might just as well be able to switch over and stop dual booting. I hate dual booting more than I hate Windows, so it would be an improvement.
[1] https://github.com/microsoft/WSL/issues/2195#issuecomment-74...
WSL1 performance is better for CPU-bound problems
WSL2 only shines due to the VHDX approach. If WSL1 could use a VHDX or (gasp!) a native partition in a native linux format, it would smoke WSL2.
The problem with WSL1 is limited to disk IO performance, because the compatibility layer that's easy to do with system calls isn't so easy to do with the filesystem.
> We'd be back to square one, with things like containers being unusable again.
It's complementary. WSL2 when you play with containers, WSL1 when you don't.
Personally, I don't bother with containers for about 90% of the development cycle - and it's just for testing before being deployed to a genuine linux, not some VM.
Also, if you want to run servers with WSL (say, postgres), having containers is the last of your problems.
VHDX/partition would help significantly by not being NTFS and/or enabling a linux-style dentry cache.
No containerization: Agreed, this is a significant limit.
Background services work just fine, I don't know what you're getting at. I have cron and stuff going.
What's improper about the init system? I start services, I stop services, it seems fine.
No kernel modules: I feel like this is pretty niche.
I will say that Docker Desktop works MUCH more smoothly with WSL2 than the prior approach.
About the only issue I see now is about once a month I have to reboot because the magic localhost port mapping between docker, wsl-ubuntu and native host goes wonky. It's not so bad as long as I realize before diving into a rabbit hole to figure out why I can't connect to something.
I can do it fine in WSL1.
Wonder why it is never seen by WSL devs! Most of those trying to use WSL are running Windows, in a corp network, where a VPN is there by default.
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.
https://devblogs.microsoft.com/commandline/whats-new-in-the-...
They'll need to manage their own app store as I can't imagine they'll have gapps//shims out of the box, but that works in their favor if they wanted to do another mobile play.
When the new EU fair market regulation is accepted, they will be able to compete with an app store op Android (or iOS):
allow the installation and effective use of third party software applications or software application stores using, or interoperating with, operating systems of that gatekeeper and allow these software applications or software application stores to be accessed by means other than the core platform services of that gatekeeper.
Since they already allow alternative app stores (e.g. Steam) on regular Windows, not much changes for them in this respect. But they will also be able to compete with the Play Store and iOS App Store with their own store.
Source: https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CEL...
There is also a web frontend for it: https://www.samsung.com/us/apps/galaxy-store/
They own App Center so maybe its not that far away.
I'm slightly leery about it all, but definitely warming up to MS this past decade. WSL2 and VS Code have made my life much easier to say the least. Of course this is the intended effect, I no longer have the urgency to get into a full Linux environment this way.
On-Topic: glad to see this GWSL thing, as I'd been thinking about doing similar... getting X and pulseaudio working in windows, and configured right in WSL environment is a pain to say the least. If this eases that pain even if only for local logins, I'm pretty happy with it. I spent a couple days trying to get it all working... I could launch Ubuntu's Firefox instance, but couldn't for the life of me get audio working right and just gave up after a couple days.
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.
> 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 for sure.
WSL is nice to have and a million times better than DOS/Powershell but it's not at Linux/Mac terminal level yet.
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.
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...
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.
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.
This was terrible advice back in the 90s and still is. An attacker anywhere on the network can listen to your input devices, insert fake keypresses, view your screen, etc. Basically a total system compromise.
All without log entries.
The correct way to do this is to use MIT-MAGIC-COOKIE.
One the client host:
$ xauth -extract - $DISPLAY
Then copy the output.
On the host running the X server: $ xauth nmerge -
then paste the output copied previously.
Press enter and CTRL-D (EOF).
If you then check the output of "xhost" on the client, it should only say "Access control enabled."It used to be possible to easily scan what sites are running locally, even if js code was from a public website. [0]
If you're talking about using that exploit to allow access to the victim's machine from the internet: that won't work because listening interface for the x11 server is localhost, not the LAN interface.
Btw there is a typo, you need to use "nextract", it's too late to edit it now
PS C:\Users\user> _ (cmd.exe -C xauth -extract - $Display) | xauth nmerge -
first part to run via windows environment, second to pipe that to the wsl environment?Actual commands probably different, but should be something you could maybe trigger from inside .bashrc file.
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.
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...
I genuinely don't understand the point of Windows as it exists anymore.
* Games are developed on cross platform engines. I can't remember the last game I played that was Windows-exclusive.
* Business apps work in the browser or Electron, or are otherwise cross-platform. Things that aren't, could work with emulation
* Developers are using unix-like operating systems, and MS has leaned hard into that. Windows is incongruent with the rest of their developer strategy.
* The server ecosystem is almost entirely Linux based, apparently even on Azure
* By all appearances, Windows is now a service that upsells other services, and there won't be a Windows 11 as we would traditionally think of it
* The people who know what an OS is, prefer unix-like OSes by a vast margin. The people who don't, wouldn't notice the difference.
* x86 looks even less like the future than it did a month ago
So I don't understand what the holdup is?Also the value of Intel is all that legacy software. Without the legacy software, Intel could be just another ARM or RISC V competitor.
Longhorn was the codename for Vista, which just used the same NT kernel as before (with some feature improvements, just like in every new Windows release).
I also think you're underestimating the number of developers who know Visual Studio and Windows and nothing else (many of whom are the so-called "dark matter" devs).
On top of this, the NT kernel is actually pretty decent - despite the horror of the Win32 API. Personally, I don't want to touch it though.
A lot of people that where not in computing back then do not realize that Microsoft picked up a lot of great people due to market forces, they picked up a lot of talent from DEC including David Cutler and the cream of the crop from the OS2 team. This was the team that designed and built the original NT Kernel and it was by and large the best parts of VMS and OS2 coupled with those individuals learnings in building those other systems. I agree with you on the Win32 API and it is a shame that the NT Kernel gets dinged for it.
To some, that's not a relevant fact. Consider someone like me who plays only one game that's only for Windows and consoles. It's never been released on Linux and I had a terrible experience playing under Wine.
I got a KVM switch to play it on my secondary PC. I think there are a lot of people out there for whom one game or one app doesn't work or only works poorly on Linux, and they keep a Windows PC or dual boot just for that.
The Unity editor doesn't have full Linux support (its coming "soon"), for example. Neither do a lot of other tools.
Hopefully we'll get there.
You may not play them, but a significant number of popular[1] games are Windows-only.
[1] https://en.wikipedia.org/wiki/List_of_most-played_video_game...
People who want a Cola like drink prefer Coke.
Or even any other soft drinks than Cola derivates. They sell the most by far.
Why does Dr Pepper exist? Or Club-Mate? Or Tøyen Cola.
There is a concept called competition. People believe it drives innovation.
There is also nice to have variety and being able to pick something you like the best form a selection.
A single operating system dominating the entire world from PDP11 --> entirely is a bleak dystopia.
WindowsNT was lightyears ahead of Linux kernel when it come out. Async everything from the start. Better protection for hardware. Easily portable. x66, PowerPC, Alpha, Mips Able to run win32, OS/2 and a posix layer that could be extended into other adventures. Also the most modern operating out there in wide use.
It sadly has retrograded over time.
Both WindowsNT, Linux and BSD are all unsuited for the world we live in now.
I can't wait until some sharp minds are able to create the next generation operating system. It is taking far too long.
I loved the time of competition and variety Atari TOS/GEM, MSDos, VAX, OS2, OS/400, Sintran, Mac OS (System 1.0 -->), AmigaOS, WindowsNT, many flavours of UNIX, Sinclair BASIC
Those are just alternate operating systemsI have used myself over a life.
I want far more flavours, ideas, alternatives out there, not less.
Now, not only is my configuration and maintenance simpler but everything runs faster because all my operating systems are running on dedicated hardware.
And before anyone says "it's too expensive", it's really not terribly expensive because I get refurbed machines like this [0]. If I want a laptop I get something like this [1] and it runs Linux (or Windows of course) just fine.
The only expensive machine I ever buy is a Macbook, but even those I'll buy refurbished. The last Macbook Pro I bought is from mid-2015 and I got it for only $1049 (in 2017) with 6 months of AppleCare+ still attached to it, which got me a new battery for free from Apple.
[0] https://www.amazon.com/HP-EliteDesk-i7-4770-3-40Ghz-Renewed/...
[1] https://www.amazon.com/Acer-A515-55G-57H8-Display-i5-1035G1-...
https://woafre.tk/2017/02/08/wsl-wine-runs-on-it/
This is the (still working) Hacker News story:
I found the core x server it used but was unhappy with not being able to full screen windows on the fly.
So after firing out the Frankenstein build system I was able to modify the windows x server to allow alt enter to switch a window to and from full screen (no title bar over the start bar).
This one change was huge. And now gui emacs works perfectly in windoes, backed by wsl.
If anybody wants I can get the patch or, uh. Becausw windows and the Frankenstein build system requirements, share the binary.
1. [Pengwin](https://www.whitewaterfoundry.com/) - a customized Debian distribution with helpful scripts for setting up a dev environment
2. [X410](https://x410.dev/) - a customized X11 Server
They made all the setup really easy. I reuse some of the scripts from Penguin in the Ubuntu distribution.
One caveat for those who want to try WSL2, which is available if you subscribe to Windows Insider program, is the instability.
Some times, after an update, your WSL will not start. After some restarts everything is back to normal.
I blame it on being on the Dev release channel.
To be honest I thought I had to be on the latest and greatest to take benefit of WSL2.
I have not experienced WSL2 a not starting issue at all and I use it every day this year.
Also what benefit does Pengwin have apart from X server? I use the Ubuntu image and I've had no issues.
For instance I had a small issue with the scale of the applications. In Windows I have 250% (recommended) scaling applied.
``` export QT_SCALE_FACTOR=2.5
export GDK_SCALE=$(echo "(${QT_SCALE_FACTOR} + 0.49) / 1" | bc) #Round ```
One thing I do like is the 9p "interface" between Windows host and WSL, and the improvements they made to file sharing between the two.
Check this comment for more details: https://news.ycombinator.com/item?id=25455503
next task would be to support some kind of synaptic that would update windows's menu with linux apps...
My main problem are the cameras in the stalls.