Skip to content

Instantly share code, notes, and snippets.

View onomatopellan's full-sized avatar

onomatopellan

View GitHub Profile
@lzlrd
lzlrd / wslg-guide.md
Last active April 27, 2025 17:55
How to get WSLg working with OpenGL, Vulkan, and CUDA on (Official) Arch Linux and Ubuntu WSL Instances.

WSLg with OpenGL, Vulkan, and CUDA on (Official) Arch Linux and Ubuntu WSL Instances

Note: I haven't documented CUDA here. I'm lazy (and haven't tested on Arch). See https://documentation.ubuntu.com/wsl/en/latest/howto/gpu-cuda for that on Ubuntu.

Context

microsoft/wslg#1312:

So I got this working on both Ubuntu, and Arch. First, start with a fresh install (of archlinux from https://gitlab.archlinux.org/archlinux/archlinux-wsl or Ubuntu from wsl --install Ubuntu or https://apps.microsoft.com/detail/9pdxgncfsczv).

Arch

@tdcosta100
tdcosta100 / WSL2GUIWSLg-XWayland-en.md
Last active June 4, 2025 08:24
A tutorial to use GUI in WSL2/WSLg replacing original Xorg by Xwayland, allowing WSL to work like native Linux, including login screen

Full desktop shell in WSL2 using WSLg (XWayland)

Note

If you want to use Wayland in WSLg in a simpler setup, you can try the WSLg (Wayland) tutorial.

In this tutorial, we will setup GUI in WSL2. No additional software outside WSL (like VcXsrv or GWSL) is required. You will find this tutorial very similar to the one that replaces Xorg with Xvnc. Indeed, it's pretty much the same tutorial, with some few changes.

The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc), and after that, replace the default Xorg by a script that calls Xwayland instead.

For this setup, I will use Ubuntu 24.04, and install GNOME Desktop. Unfortunately older versions of Ubuntu lack some fundamental things, so we cannot reproduce it in older versions (at least not fully). Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the [Sample screenshot

@tdcosta100
tdcosta100 / WSL2GUIWSLg-Wayland-en.md
Last active June 4, 2025 15:21
Using full desktop shell in WSL2 using WSLg (Wayland)

Full desktop shell in WSL2 using WSLg (Wayland)

Note

If you want a more complete experience and already tried the Xvnc tutorial, maybe you should try the WSLg (Xwayland) instead.

Warning

This is a work in progress tutorial. Things done here may break existing functionality, so be careful!

In this tutorial, we will install and use a full GNOME Desktop environment in WSL2, without any external software. The only requirement is a working WSLg installation. At the moment, the instructions are only for Ubuntu (20.04, 22.04 and 24.04) distros and GNOME, but you can request me to test other distros and desktop environments.

@shigenobuokamoto
shigenobuokamoto / network-mirrored.service
Last active May 18, 2025 20:22
/etc/systemd/system/network-mirrored.service
[Unit]
Wants=network-pre.target
Before=network-pre.target shutdown.target
[Service]
User=root
ExecStart=/bin/sh -ec '\
[ -x /usr/bin/wslinfo ] && [ "$(/usr/bin/wslinfo --networking-mode)" = "mirrored" ] || exit 0;\
echo "\
add chain ip nat WSLPREROUTING { type nat hook prerouting priority dstnat - 1; policy accept; };\
@vhanla
vhanla / wsaclientdetails.md
Last active July 10, 2024 21:57
Windows Subsystem for Android - WSA Client interesting params and stuff

WSA Client (wsaclient.exe) is the manager UI application for Windows 11's Windows Subsystem for Android platform and here I collect interesting stuff that I found in wsaclient.exe

  1. One instance application.

wsaclient.exe is the only application that runs, and handles params for different actions, like uninstall, launch APKs, restart, etc.

To check and block other instances, it uses MUTEX strings and it is this one (it might change in future versions)

Mutex = CreateMutexExW(0, L"{42CEB0DF-325A-4FBE-BBB6-C259A6C3F0BB}", 0, 0x1F0001u);

@xquangdang
xquangdang / rn-with-wsl-wsa.md
Last active March 22, 2024 14:39
Develop React Native app with WSL and WSA

Develop React Native app with WSL and WSA

Requirement

  • Windows Subsystem for Linux 2 (WSL2)
  • Windows Subsystem for Android (WSA)
  • NodeJS install inside WSL2

Steps

WSA

@machuu
machuu / WSL2_VPN_Workaround_Instructions.md
Last active April 8, 2025 07:50
Workaround for WSL2 network broken on VPN

Overview

Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active.

The root cause seems to be that WSL2 and the VPN use the same IP address block, and the VPN routing clobbers WSL2's network routing.

This problem is tracked in multiple microsoft/WSL issues including, but not limited to:

@mwoodpatrick
mwoodpatrick / README.md
Created December 28, 2020 16:14 — forked from djfdyuruiry/README.md
WSL 2 - Enabling systemd

Enable systemd in WSL 2

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

    cd /tmp
@lamhoangtung
lamhoangtung / install_nvidia_docker_offline.md
Last active December 8, 2022 02:46
How to install nvidia-docker offline for Ubuntu 18.04
param(
[Parameter(Mandatory)][string]$vmName
)
$InformationPreference = "Continue"
$ErrorActionPreference = "Stop"
try {
$vmPartitionAdapter = Get-VMGpuPartitionAdapter -VMName $vmName
if ($vmPartitionAdapter) {
Write-Information "Removing Partition Adapter. Checkpoints work."