Note
If you want to use pure WSLg, you can try the new WSLg (XWayland) tutorial or the WSLg (Wayland) tutorial.
In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).
The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc) and tigervnc-standalone-server.
For this setup, I will use Ubuntu (20.04, 22.04 and 24.04 are working), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the [Sample
This turned out to be easier than I thought it would, especially after struggling with Ubuntu.
Both procedures use a common debian.env file to hold environment variables applied in the script.
When installing Debian always be sure to select an apt mirror when prompted, if you don't you'll regret it.
In a file, debian.env:
I did PCI passthrough on Archlinux and Debian with the old PCI-stub method (this was pre-4.0 era). And later I did PCI passthrough on the 4.1+ kernels on Arch and Ubuntu (16.10 I think?).
This is my attempt at doing the same on Nixos.
| Guide: | |
| 1. Install Armbian_5.24.161216_Orangepizero_Ubuntu_xenial_3.4.113.img onto a uSD card using Win32DiskImager or Ubuntu Disk Image Writer | |
| 2. (Optional) Mount the uSD in Ubuntu Laptop and expand the partition using GParted. | |
| 3. Delete everything from uSD except /boot, /lib/modules and /lib/firmware. | |
| 4. Mount openwrt-15.05.1-sunxi-root.ext4 on Ubuntu using loopback interface on /mnt/openwrt |
| #!/bin/sh | |
| # | |
| # FOR USE IN OPENWRT | |
| # This script creates a guest network fully isolated from the main one. | |
| # Tested on a Xiaomi AX3000T router; should work on any OpenWRT-powered router. | |
| # | |
| # Ensure the Wi-Fi interfaces retain their default names (radio0 and radio1). | |
| # | |
| # Info about OpenWRT support on AX3000T: |
All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.
Instructions how to install Debian using debootstrap. Below instructions were verified to work with debootstrapping Debian 11.
In the following gist I'm going to guide you through the process of installing and booting an entire linux distribution with full desktop environment just like you would have with a classical VM, but with much better performance and much worse isolation :)
The reason why I did this was mainly because it's cool, but also to test new distros with decent graphics performance without actually booting them on my PC.
If you "try this at home" just keep in mind a container is not as secure as a VM, and some of the option we're going to explore will weaken container isolation from "a bit risky" to "totally unsafe" depending on what you choose.
Also, we're going to use systemd-nspawn for containers as it's probably the best fit for our use case and can also boot any linux partition without needing to prepare an apposite container image.
Less go!
| #!/bin/bash | |
| # Ubuntu Installation Script with LUKS-encrypted BTRFS, systemd-boot, and Secure Boot | |
| # Author: Claude (modified and improved with apt speed enhancements) | |
| # Usage: sudo bash script.sh [install_device] [username] [hostname] [locale] [language] [timezone] | |
| # Passwords can be provided via environment or will be prompted securely. | |
| set -euo pipefail | |
| # Log file for the installation process | |
| LOGFILE="/var/log/ubuntu_install_script.log" |