glxinfo -B
:
glxinfo
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Microsoft Corporation (0xffffffff)
Device: D3D12 (NVIDIA GeForce RTX 3070 Laptop GPU) (0xffffffff)
Version: 21.0.3
Accelerated: yes
Video memory: 15138MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.3
Max compat profile version: 3.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA GeForce RTX 3070 Laptop GPU)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 21.0.3
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 3.1 Mesa 21.0.3
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 21.0.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
One of these steps is obviously specific to the (Lenovo laptop) hardware it was tested on.
You will need to adapt it to your hardware.
wsl --install -d Ubuntu-20.04
sudo apt update; sudo apt upgrade
wsl --shutdown
bash
sudo apt install gedit mesa-utils
wsl --shutdown
bash
glxinfo -B
Some extra packages are needed to show the correct output with glxinfo
, those look like they were installed as a dependency of gedit. (perhaps mesa packages)
https://github.com/damiongans/ubuntu-wsl2-systemd-script
Clone that repository on the Windows host side, then change basic.target
to multi-user.target
in start-systemd-namespace
and enter-systemd-namespace
.
To enable systemd
in WSL 2, run bash ubuntu-wsl2-systemd-script.sh
on the Windows host side.
The next time you run bash, it’ll show a line about enabling systemd.
After this run sudo systemctl set-default multi-user.target
in WSL 2.
/tmp/.X11-unix
Create /etc/rc.local
and put the following content in it:
#!/bin/bash
ln -s /mnt/wslg/.X11-unix/X0 /tmp/.X11-unix
Then make it executable with chmod +x /etc/rc.local
.
Now either run that ln
command manually or restart WSL 2 as shown above.
Edit /etc/ssh/sshd_config
and set PasswordAuthentication yes
.
Enable ssh with “sudo systemctl enable –now ssh”.
Now you can install xpra server in WSL 2 and the xpra client on Windows.
You can see the WSL 2 IP address with ip a
in WSL 2.