Technology

The most effective a part of Home windows 11 is a redesigned Home windows subsystem for Linux

the-most-effective-a-part-of-home-windows-11-is-a-redesigned-home-windows-subsystem-for-linux

Enlarge / Installing and using the Windows subsystem for Linux is easier and more productive on Windows 11 than it is on Windows 10.

Jim Salter

In our main test for Windows 11 published earlier this week, we covered most of the new features and design decisions in Microsoft’s newest consumer operating system – and it makes sense to characterize the overall impression there as “lukewarm”. The good news is that we still hadn’t covered the best part of Windows 11: Linux.

For years, the Windows Subsystem for Linux has made life easier for Windows 10 developers, system administrators and hobbyists with one foot in the Windows and one foot in the Linux world. But the WSL, practical as it is, has been hampered by some things it couldn’t do. Installing WSL has never been as easy as it should be – and getting graphical apps working has been possible in the past, but also a pain in the ass that required some rather obscure third-party software.

Windows 11 finally fixes both problems. The Windows subsystem for Linux isn’t perfect on Windows 11, but it’s a huge improvement over what came before.

Install WSL on Windows 11

  • You can’t install WSL from a standard CMD prompt – you need an elevated prompt.

    Jim Salter

  • In an elevated CMD, wsl –install is sufficient. A restart later you have WSL with integrated audio and graphics support!

    Jim Salter

Microsoft has traditionally made installing WSL more of a chore than it should be, but the company finally got the process right in Windows 10 Build 2004. Just open an elevated command prompt (Start -> type in cmd -> click Run as administrator). , type wsl –install at the command prompt and you’re good to go. Fortunately, Windows 11 continues this process unchanged.

A simple wsl –install with no further arguments brings you Hyper-V and the other basics of WSL along with the current version of Ubuntu. If you’re not a fan of Ubuntu, you can use the wsl –list –online command to see what other easy-to-install distributions are available. If you prefer a different distribution, you can install it with e.g. wsl –install -d openSUSE-42 instead.

advertising

If you’re not sure which distro to choose, don’t worry. You can install as many as you want by simply repeating wsl –list –online to enumerate your options and wsl –install -d distroname to install what you want.

Installing a second distribution does not uninstall the first one; it creates a separate environment, independent of others. You can run as many of these installed environments as you want at the same time without worrying that one will mess up the other.

WSL now supports graphics and sound

In addition to the simple installation, WSL offers support for graphics and audio in WSL apps under Windows 11. This is not exactly a premiere – Microsoft introduced WSLg in April with Windows 10 Insider Build 21364. But Windows 11 is the first production Windows build with WSLg support.

If this is your first time hearing about WSLg, the short version is simple: you can install GUI apps – for example Firefox – from your Ubuntu (or other distribution) command line and they’ll work as expected, including sound. When I installed WSLg on Windows 11 on the Framework laptop, the iconic browser would automatically appear when running Firefox from the Ubuntu terminal. The YouTube headline also worked perfectly, neither with frame drops in the video nor with glitches in the audio.

If you want to know how WSLg works, we can also help you get started here: Microsoft has decided to go into the future and use the Wayland protocol instead of the aging X11 / xorg. In order for everything to work, the graphical user interface had to be created on the Weston reference compositor for Wayland, which is connected to XWayland to support X clients, with FreeRDP providing the connectivity between the native Windows system and the X / Wayland apps, which run under WSLg.

If you want to dig deeper into the hairy details of WSLg’s architecture, we recommend Microsoft’s own April 19th devblog post on the very same topic.

What can I do with WSLg on Windows 11?

  • We did not install Firefox on Windows 11 – only within the WSLg environment!

    Jim Salter

  • This is my preferred use for WSLg – a local copy of virt-manager that manages virtual machines hosted on remote Linux servers.

    Jim Salter

One of the most frequently asked questions about WSLg can be phrased as follows: “Why bother?” This is because most of the GUI killer apps in the Linux world aren’t actually Linux-specific – the vast majority have already been ported directly to the Windows platform. And for these apps, it makes more sense to run the Windows native ports frequently.

advertising

With this in mind, there is an obvious “killer app” for WSLg that we are enthusiastic about – and that is virt-manager, the virtualization management tool developed by RedHat. virt-manager is a simple tool that optimizes the creation, management and operation of virtual machines with the Linux Kernel Virtual Machine.

With virt-manager you can view a simple list of your VMs along with the current disk, network and CPU activity. You can also manipulate your virtual “hardware” – for example by adding or removing RAM, “hard disks”, network interfaces and more – and starting, pausing or stopping it. Creating and destroying VMs is as easy as managing them – and finally, virt-manager allows you to drag a graphical console directly into any VM that behaves just like a physical display connected to a bare metal machine .

If all of this only worked on the local host, it would be pretty useless under WSLg. Nested virtualization is one thing, but generally not something you want to do in production. However, virt-manager allows you to manage the VMs on any computer that you can SSH to, not just the local host. In practice, I use this remote management function to manage many dozen hosts (and several thousand VMs) both locally and remotely every day.

But…

Unfortunately virt-manager has never been ported to Windows and this seems unlikely. But it’s going like a champion under WSLg. In the screenshots above you can see my framework laptop with virt-manager under WSLg, which is connected to my Ubuntu workstation via SSH. The Ubuntu workstation has a multitude of VMs installed and running – and virt-manager on my Framework laptop can manage them all, including the Hackintosh VM and the Windows Server 2012 R2 VM with console windows open.

The icing on the cake of this virtualization pie is how well these console windows work – I had no issues getting flawless YouTube playback on my Hackintosh VM console, complete with working, glitch-free audio. Ironically, this is a better remote control experience than I can handle with my real Macbook Air – which is unbearable for spreadsheets as it’s limited to VNC over Wi-Fi.

0 Comments