Skip to content

Instantly share code, notes, and snippets.

@nur858
nur858 / WSL2GUIWSLg-XWayland-en.md
Created June 2, 2025 01:31 — forked from tdcosta100/WSL2GUIWSLg-XWayland-en.md
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

#!/bin/bash
bombardier $COMMAND
FROM golang:1.8
RUN go get -u github.com/codesenberg/bombardier
COPY entrypoint.sh .
RUN chmod +x entrypoint.sh
ENTRYPOINT [ "./entrypoint.sh" ]
version: '3.4'
services:
sample-console-app:
image: sample-console-app
build:
network: host
context: .
args:
PROJECT_VERSION: 1
dockerfile: Sample.Console.App/Dockerfile
@nur858
nur858 / Dockerfile
Last active August 9, 2022 16:54
Multi-stage Dockerfile for .net core with SonarQube
FROM microsoft/dotnet:2.1-sdk AS build
ARG PROJECT_VERSION
ENV DOTNET_CLI_TELEMETRY_OPTOUT = 1
WORKDIR /src
RUN apt-get update && apt-get install -y \
openjdk-8-jre-headless
RUN apt-get clean
COPY . .
@nur858
nur858 / gist:a84d3ac53788b90b62f83364657549b5
Last active September 18, 2018 03:40
Creare SonarQube and PostgreSQL database and a network between them.
#!/bin/sh
docker network create -d bridge sonarqubenet
docker run --name sonar-postgres -e POSTGRES_USER=sonar -e POSTGRES_PASSWORD=sonar -d -p 5432:5432 --net sonarqubenet postgres
docker run --name sonarqube -p 9000:9000 -e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD=sonar -e SONARQUBE_JDBC_URL=jdbc:postgresql://sonar-postgres:5432/sonar -d --net sonarqubenet sonarqube:latest
@nur858
nur858 / docker-compose.yml
Created September 18, 2018 03:22
sonarqube-docker
version: '3.4'
services:
sonar-postgres:
image: postgres
container_name: sonar-postgres
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: sonar
ports:
- "5432:5432"