Maximum PC - USA (2022-01)

(Maropa) #1
Running graphical applicationsis impressive, so the next step

is to try and run a complete desktop. What are you waiting for?

YEAR OF THE LINUX

DESKTOP (ON WINDOWS)

HARDWARE-ACCELERATED WSL


WSL supports running with a virtual
GPU so that Linux programs can take
advantage of high-powered graphics
cards and run compute jobs (not games
at this stage) at near-native speeds.
There’s also a DirectML backend for
TensorFlow (see https://github.com/
microsoft/DirectML), enabling speedy
machine learning experiments on
Direct3D 12-supported hardware.
Further to this, in spring 2021 the
d3d1 2 driver became an official part
of the open-source Mesa 2 1.0 stack.
To make use of this, and speed up your
Blender renders or whatever, you might

need to update your Windows GPU
driver to one supporting WDDM 3.0.
Nvidia’s WSL CUDA drivers are
considered public preview and should
be delivered to Windows Insiders
through the normal Windows Update
channel. Otherwise, they are available
from https://developer.nvidia.com/
cuda/wsl.
Owners of AMD graphics hardware
can get the preview drivers at http://www.
amd.com/en/support/kb/release-
notes/rn-rad-win-wsl-support.
Intel’s can be found at https://bit.ly/
lxf282-intel-drivers.

Only Ubuntu LTSes are available
on WSL, they miss out on all these
developments. So you could install
Arch or some other distro. Or you could
avail yourself of Canonical’s Ubuntu on
Windows Community Preview. Read
more and follow the download links at
https://ubuntu.com/blog/announcing-
ubuntu-on-windows-community-
preview-wsl- 2.

GETTING AN ACTUAL Linux desktop running on WSL 2.0
on Windows 11 proved a little tricky. In fairness, WSL was
built to run applications, not to act like a conventional
virtual machine. It’s not really surprising that Gnome
and KDE won’t work. They rely on all sorts of daemons
and services running in the background holding all the
components together. Brave souls have managed to get
the Xfce desktop working nicely on Windows 10 with
Ubuntu 18 .04, but this didn’t work for us on Windows 11
with Ubuntu 20 .04. If you’re running Windows 1 0, then
you’d be well advised to try out running Xfce via the X 410
server. It should just be a matter of adding:
$ sudoaptinstall xfce 4
Then setting the DISPLAY environment variable
correctly. A major change in WSL 2 is that 127 .0.0. 1 in
WSL doesn’t refer to the real loopback interface in

Windows (where the X 410 server would be listening).
So we need to figure out the WSL address and update
DISPLAY accordingly. As per the instructions at https://
x410.dev/cookbook/wsl/using-x 41 0-with-wsl2 this can
be gleaned from /etc/resolv.conf on WSL, and then all
that’s left is to tell X4 10 to allow “Public” connections.
You will probably want to use Windows Defender
Firewall to restrict this (if your machine isn’t otherwise
firewalled). Then run xfce 4 - session within WSL.

TAKING A DIFFERENT APPROACH
While not technically in the remit of WSL, it’s still nice to
have a Linux desktop on Windows 11 —if for nothing else
than to show how the new-fangled desktop measures
up to something tried and tested. Since using a native
X server on Windows didn’t work, we figured we’d try
a different approach: using Windows’ own Remote
Desktop Protocol (RDP) to connect to a desktop running
within WSL2. To do this, we installed Xfce in Ubuntu
using the command above (note that in some situations
you may need to install xfce-terminal explicitly as
well), and then installed and started Xrdp:
$ sudo apt install xrdp
$ sudo /etc/init.d/xrdp start
Note the old Sys-V style init script. WSL doesn’t use
Systemd, which will surely be good news to some people,
but is also part of the reason you can’t use Gnome on
it right now. Anyway, we’re getting sidetracked. Start
Remote Desktop Connection in Windows and connect
to localhost: 3389. You’ll be warned that the identity of
the remote computer cannot be verified, but since the
remote computer here is, in fact, local this is nothing to

X41 0 is a well-
regarded and
occasionally
discounted
X Server for
Windows 10.
We need an
X411, though

Linux loves Windows


38 MAXIMUMPC JAN 2022

Free download pdf