Post

How to use GUI Apps on WSL

This Guide still work with latest Windows 10 and windows 11 builds but you should consider using WSL2 instead of WSL1. WSL2 is faster and more stable than WSL1. WSL2 also support GUI apps without any extra configuration on windows 11. but you still need to install a Xserver on windows 10. I recommend GWSL

Requirements:

  • A Windows 10 build 16215+ device
  • Brain
  • Little time

Enable Windows substytem for Linux

  1. Open Powershell with administrator and paste:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

  2. Reboot your device

Install distribution from microsoft store

alt text

I’m gonna install debian

Install desktop environment and GUI

Install Desktop environment

  1. Open alt text
  2. Follow on screen steps alt text
  3. Type sudo apt update && sudo apt upgrade -y and enter alt text
  4. Install DE
    • sudo apt install xfce4 -y and enter - alt text

Install Xserver

  1. Download and install VcXsvr here
  2. Run Xlaunch
  3. Select “One large winow”
  4. “Start no client”
  5. Click next again
  6. you can save settings to easily open it later
  7. And done. You have something like this: alt text

Connect Susbsystem Xserver

  1. Type export DISPLAY=:0 and enter
  2. Type startxfce4 and enter
  3. Done! check your Xserver window! alt text

Make a batch script for easy launch

  1. Open notepad and paste:
@echo off
title debian
config.xlaunch
bash -c "export DISPLAY=:0 && startxfce4"
pause
  1. Save file WLSGUI.bat
  2. Put config.xlaunch and WLSGUI.bat in same directory
  3. Run GUI.bat

Here is my themed Xfce4 Desktop

alt text

This post is licensed under CC BY 4.0 by the author.