Posted on 04/23/2021 12:18:11 PM PDT by ShadowAce
Microsoft has released the first public preview of Linux GUI applications on Windows 10 – so we wasted no time in taking it for a spin around the block.
The ability to run GUI applications on Windows Subsystem for Linux 2 is not new – enthusiasts have been able to run them via separately installed X server utilities for years – but the arrival of official support is still something of a game changer. The official support is more ambitious and better integrated than the various unofficial approaches.
The preview comes via the Windows Insider Program, by which developers and enthusiasts can get an early look at forthcoming releases. The latest downloadable build is 21354, but the version that supports WSLg is build 21364, so in our case it was a matter of installing 21354 from an ISO image, logging in with a Microsoft account signed up as an Insider, and then waiting while the later build came down from Windows Update. We also chose to run it in a Hyper-V VM. To do this, it is necessary to enable nested virtualization since WSL also uses Hyper-V. That requires a PowerShell command from the host machine.
Once build 21364 is up and running, it is a matter of running wsl --install
from an administrator command prompt. This does more work than before as WSLg is included automatically. There is quite a lot to it: with WSLg we were installing not one but two WSL2 VMs, one of them the user distro Ubuntu, the other a hidden system distro using Microsoft's own CBL-Mariner Linux. This distro describes itself as "an internal Linux distribution for Microsoft's cloud infrastructure and edge products" so its forthcoming arrival on millions of Windows 10 PCs is a considerable expansion of its role.
That system distro runs Weston, which is a reference implementation of a Wayland compositor. "Weston is the heart of WSLg," said Microsoft's Steve Pronovost, partner development lead. The distro runs a Remote Desktop Protocol server called FreeRDP which lets users connect using a Windows Remote Desktop client. Microsoft extended FreeRDP to support individual windows instead of the whole desktop, added support for per-monitor DPI scaling, and clipboard support so users can cut and paste between Windows and Linux applications.
WSLg diagram showing the role for RDP and that of a second, hidden Linux distro running Microsoft's own Linux
Weston in WSLg plays another small but significant role. It includes an RDP plugin which scans the user distro for desktop applications then adds them to the Windows Start menu complete with the command-line for launching them. In practice this makes a big difference to the user experience since Linux GUI applications are found and launched in the same way as native Windows applications.
With WSLg installed, we logged into Ubuntu, updated the packages then typed sudo apt install gedit
. Gedit is the standard GNOME text editor. Since Ubuntu in WSL is by default non-GUI, installing the first GUI application pulls down a lot of stuff, but it worked and Gedit duly turned up on the Start menu, where it was called Text Editor (Ubuntu). Once launched it appears in the taskbar with a penguin overlay icon and (in our case) an ugly "[WARN: COPY MODE]" prefix. What is copy mode? Possibly this indicates use of RAIL (Remote Application Integrated Locally) which is a means of displaying remote applications described here, rather than VAIL (Virtualized Application Integrated Locally). RAIL copies pixels over RDP whereas VAIL uses memory shared between the host PC and the WSL2 VM. WSLg is meant to use VAIL but perhaps falls back to RAIL in some circumstances. According to the docs, both RAIL and VAIL are now implemented in FreeRDP.
Despite the warning, Gedit worked well, with copy and paste working fine to and from Notepad. Getting more ambitious, we tried sudo apt install libreoffice
. This large application pulled down many more dependencies, but it worked and we found seven additional applications on the Start menu, these being the components in the LibreOffice suite. LibreOffice Writer opened on the Windows desktop and despite once again warning of "COPY MODE" performed well. We did encounter some slight glitches with clipboard support. Copying text from Word on the host PC (that is the host of the VM running Windows 10) raised a "not supported" error, though on a subsequent try it worked correctly.
The developer story for WSLg is particularly important, given that much of the initial impetus for WSL came from the need to support developers working on Windows but coding applications for Linux servers. Visual Studio Code running on Windows has good remote support for WSL, but what about running the Linux build of VS Code instead?
A quick sudo apt install code
did the trick, and there is a little less friction using VS Code in this way if the source code is on the WSL2 file system. Incidentally, saving documents in Linux GUI apps works as expected, displaying a floating Linux Save dialog which defaults to the home directory of the user on the WSL2 side. The Windows host file system is also available via /mnt/c/Users/tim/Documents, for example.
Getting the best performance from WSLg would mean running it on bare metal rather than in a VM, and installing a GPU driver that supports hardware-accelerated OpenGL on the WSL side. These are available in preview from AMD, Intel, and Nvidia – but will not help when the host machine is itself a VM. This is important since it means graphical applications will run with hardware-accelerated performance. It also enables general-purpose GPU development such as with Nvidia's CUDA language, running in WSL2. This is important for developing AI and ML applications, destined to be deployed to Linux servers, among other uses.
It is early days, but looks like good news for developers working on Windows, and perhaps for general users as well, once the technology makes its way into the majority of Windows 10 installations. It is also good for Linux enthusiasts not running Windows since the potential user base for Linux applications will become much larger. ®
Yeah I’ve been bouncing around different flavors of Ubuntu for about the same amount of time. Lubuntu, Xubuntu, Linux Mint etc. I love the Plasma desktop now that they have it straightened out. It was buggy for years. Not real big on many KDE apps and their kstupid knaming konvention.
Thanks to upchuck and ShadowAce for the pings!
I doubt they'd be successful at that. Instead I see this as a desperate move to remain relevant to software development.
Microsoft is playing catch-up with the software dev and dev/ops community. Linux became the preferred dev environment many years ago, not just because it's a better environment, but also when it became clear that Linux was going to take over the internet via "cloud" services and containers (docker, Kubernetes, etc.). Which it has done, in large measure. Windows simply cannot do what Linux does, and people want what Linux does.
Add to that Microsoft's dismal and utter failure in the mobile market, where Linux rules via Android.
Thus, running a Linux (dev) environment on Windows is a desperation move by MS to avoid Windows development being shunted into the corner completely by 2025 or so.
All that said, Windows will remain the majority user platform for a long time -- it's simply too entrenched to be forced out of hundreds of millions of homes and businesses. Windows applications will continue to be the default. But modern software development abandoned Windows years ago, and MS finally realized it.
I'm glad they did. I'd like to see Windows remain relevant for more than doing Excel spreadsheets in Accounting and playing video games.
My friend... You do not look around you and recognize the “MS extortion business model” that has now spread off to all tech and even non-tech markets?
They set the industry and market standard based on the proprietary “extortion” and “bait and switch” business model that has become the liberal business standard.
No... They will steal it and call it their own if they think they can get away with it, And this culture is just stupid enough to let them get away with it.
“Well if windows says I have to do this then I have to do this”. MS started this particular business model and these idiots are all falling for it. It is the new marketing standard. they sell stocks based on this new business model.
When I need to run Windows, which is almost never, I run Win7 in a virtual machine I built with QEMU and KVM on my Linux Mint computer. I think it’s safer that way.
WSL2 makes building and testing Docker
containers for Linux and Windows
possible on one machine. It’s a
perfect fit for my current assignments.
WSL2 makes building and testing Docker containers for Linux and Windows possible on one machine. It’s a perfect fit for my current assignments.That is pretty much the definition of "I use what works best".
Over the past 30 years I've used Linux, Windows, and MacOS (and even NetBSD) in turn as my primary workstation environment, and my personal home environment. Windows is terrific, until you have to get under the hood to do anything to it other than run for-Windows applications, at which point it becomes a battle. MacOS was much the same, although somewhat better than Windows. Linux was a battle from the get-go, because the desktop just wasn't ready for prime time. Yes, it's gotten much better, but it's still the case that I use my Linux workstation as a multiple-XTerm server with a browser 99% of the time.
The major thing stopping me from making use of this "Linux on Windows" stuff is that I absolutely refuse to install Windows directly on metal.
Let me be clear -- I don't disagree with any of the historical data you quote. Microsoft has been horrible and has not abandoned Embrace, Extend, Extinguish, although it's not as egregious or overt these days. But I honestly don't think they're going to be able to co-opt Linux as you predict. It's just too easy -- and far less expensive -- and most important, mission-critical -- to run Linux natively.
But suppose in 5 years Microsoft does manage to make Linux-on-Windows the default way that the world does Linux software development (Embrace). They will find a brick wall of resistance to the "Extend", unless they're somehow able to co-opt Linux Torvalds and he leads us all off the cliff like the Pied Piper. (Granted, strange things do happen in business.)
The ultimate brick wall is that no one -- no one -- is going to give up being able to run Linux standalone. It's how the internet works, it's how containers work, it's how cloud clusters work, etc. Those aren't Windows computers out there.
So if Microsoft tries to corrupt Linux it simply isn't going to work.
Copying ShadowAce for optional comment. :-)
I am making note and accepting the knowledge that both you and ace have over my own skill set. And I hope you are right my friend. But here are two words in the English vocabulary that scare the hell out of me. They are the words “Embrace” and “Trend”.
Look around you at what just those two words have created. This is not just about Windows or Linux... It is about the societal culture that will force acceptance of MS over all else because they contributed more than anyone else.
Rainbow OS forever brother! ? It is time for “embracing” blockchain P2P and ditch the top tier servers. If we do not start now the chance will be gone... This is why we have gone Zeronet and Qtox.
You really need to come drop in... We have CPU Engineers and more in there my friend. We are working on REAL solutions. I think you might just find it on another level.
timelessauthors.com
The proper way to run windows is as a VM under Linux.
I agree with your assessment. Windows is being completely destroyed everywhere but the desktop. The datacenter is absolutely owned by linux for many reasons, in every area except mail handling. Exchange still rules that in corporate environments, and that is one thing that I really wish we had a really strong Linux contender for.
MS is trying to bolt linux on to windows. I suspect (and hope) that they will ultimately fail in that because it is obviously exactly that: a bolt on solution, not something organic. It will be really interesting to watch over the next few years as entirely new classes of malware springs from the cracks between the two subsystems.
Frankly, I'd be more worried about his untimely demise. We're talking billions and billions of dollars here. That's real money, and people will kill for it.
"RAIL copies pixels over RDP whereas VAIL uses memory shared between the host PC and the WSL2 VM. WSLg is meant to use VAIL but perhaps falls back to RAIL in some circumstances. According to the docs, both RAIL and VAIL are now implemented in FreeRDP."
Everyone here is glad that the writer knows what he is talking about, because we (mostly) sure don't!
Valid point. But I would posit that they don't have to.
Without getting into the whole "Linux" vs. "GNU/Linux" kerfluffle, I would also note that while the name "Linux" has become synonymous with the operating system, not just the kernel, Old Man Stallman is having a hell of a time keeping -his- head above water, despite his crucial role in not only creating GNU but pushing the free-and-open-source movement.
By my reckoning, TPTB won't have to kill Torvalds outright. All they have to do is play off his famous penchant for abusive language and attitude, some politically incorrect statement, or some sexist/racist/etc. act in a past decade, and BINGO they cancel him.
That way he not only gets pushed aside, his legacy gets tarnished and he becomes an Enemy of The Party, and ultimately a Non-Person. Stallman, via his tone-deaf comments, is well on the way to that fate -- it's not hypothetical.
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.