Skip to content

Instantly share code, notes, and snippets.

View crramirez's full-sized avatar

Carlos Rafael Ramirez crramirez

View GitHub Profile
@tdcosta100
tdcosta100 / WSL2GUIWSLg-XWayland-en.md
Last active April 8, 2025 20:33
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 April 8, 2025 20:35
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.

@krisalyssa
krisalyssa / readme.txt
Last active September 12, 2022 20:31 — forked from rkttu/readme.txt
Ubuntu 20.10 + WSL 2 + XRDP PulseAudio
# Credits
# https://c-nergy.be/blog/?p=13655
# https://askubuntu.com/questions/844245/how-to-compile-latest-pulseaudio-with-webrtc-in-ubuntu-16-04
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list
# https://unix.stackexchange.com/questions/65167/enable-udev-and-speex-support-for-pulseaudio
# https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
# https://gist.github.com/rkttu/35ecab5604c9ddc356b0af4644d5a226
# First, you should install XRDP and X11 Desktop Environment first.
@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:

@rkkoszewski
rkkoszewski / gist:aa531cee7126edf329b76bdd0546f502
Last active December 31, 2024 12:32
Notes for installing XorgXrdp and Xrdp with GLAMOR support
THIS ARE MY NOTES OF BUILDING AN INSTALLING XORGXRDP AND XRDP WITH GPU ACCELERATION
TESTED ON DEBIAN 9.13
-- Build XorgXrdp with GPU acceleration ("script" - to be adjusted to your needs) : --
## << BUILD AND INSTALL SCRIPT START >> ##
#!/bin/bash
# Install Latest XRDP with XORGXRDP
# README
SYSTEMD_EXE="$(command -v systemd)"
if [ -z "$SYSTEMD_EXE" ]; then
if [ -x "/usr/lib/systemd/systemd" ]; then
SYSTEMD_EXE="/usr/lib/systemd/systemd"
else
SYSTEMD_EXE="/lib/systemd/systemd"
fi
fi
@rkttu
rkttu / readme.txt
Last active January 26, 2025 22:58
(Deprecated) Ubuntu 20.04 + WSL 2 + XRDP PulseAudio
# For those of you looking for this GIST: I don't maintain this code anymore. I recommend using WSLg, which is included starting with Windows 11.
# Please refer to https://gist.github.com/CraigCottingham/fad000cc2ec4678203acf62c4ad2ab23 code that forked this GIST.
# Credits
# https://c-nergy.be/blog/?p=13655
# https://askubuntu.com/questions/844245/how-to-compile-latest-pulseaudio-with-webrtc-in-ubuntu-16-04
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list
# https://unix.stackexchange.com/questions/65167/enable-udev-and-speex-support-for-pulseaudio
# https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
@ChrisTX
ChrisTX / nanosleep-wsl.patch
Created March 13, 2020 17:15
WSL clock_nanosleep patch
diff -Naur glibc-2.31/sysdeps/unix/sysv/linux/clock_nanosleep.c glibc-2.31-wsl/sysdeps/unix/sysv/linux/clock_nanosleep.c
--- glibc-2.31/sysdeps/unix/sysv/linux/clock_nanosleep.c 2020-02-01 12:52:50.000000000 +0100
+++ glibc-2.31-wsl/sysdeps/unix/sysv/linux/clock_nanosleep.c 2020-03-13 12:30:30.737587300 +0100
@@ -31,7 +32,25 @@
struct __timespec64 *rem)
{
int r;
-
+ struct __timespec64 current_realtime, actual_req;
+ actual_req = *req;
@natefoo
natefoo / 00README.md
Last active December 3, 2024 08:20
Linux Distribution Detection

Distribution Detection

I am working on adding support for building and distributing (via PyPI) Python Wheels with C Extensions to the Python wheel and pip packages. The discussion on Distutils-SIG continues, but I believe it is fairly certain that some effort to correctly identify Linux distributions will need to be made. I've begun efforts to add this support to wheel.

How you can help

If you have a Linux distribution or version of a listed distribution not in this gist, or one of the ones I have not directly verified, I could use the following:

  • The contents of /etc/os-release, if it exists
@jstangroome
jstangroome / Send-NetworkData.ps1
Created September 28, 2014 03:17
A simple PowerShell implementation of the most basic functionality of Netcat
function Send-NetworkData {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]
$Computer,
[Parameter(Mandatory)]
[ValidateRange(1, 65535)]
[Int16]