Convert your windows WSL2 into a usable operating system with GUI
With GUI on your Linux you can install and use any Linux software of your choice without dual booting...

The Windows Subsystem for Linux (WSL) was announced at //Build 2016 in April 2016. It enables users to run a GNU/Linux environment including most command-line tools, utilities, and applications directly on Windows. This eliminates the need to dual boot your PC/laptop just to gain small Linux functional needs.
It is ideal for scholars who are trying to learn Linux functionalities, commands and other Linux OS based features. Installing Linux on windows can now be done easily by installing Linux like an app thanks to WSL, no more dual booting.
Dual booting is fun, don't get me wrong. Its just that it’s not a straight forward task especially if your a beginner…sure once you get the hang of it, its easy-peasy but sometimes you just want to get things running fast…not fight grub rescue.
So WSL is all wonderful, a life and time saver. It's like a small heaven on earth. However our heaven has its shortcomings. WSL only gives you Linux terminal access. It doesn’t offer any graphical user interface whatsoever which begs the question: What's the fun in that ?
I personally started researching about the topic because I had used VM’s before they worked fine however I wanted to go fully native...you know like a pro😎.WSL takes lesser resources compared to VM’s its not perfect but it gets the job done.
For this guide you will require WSL installed. Here is a nice tutorial on how to install WSL on windows 10. If you don't have it installed already. We can’t test all available Linux WSL distros available so for this guide I will be using Ubuntu as my distribution of choice.
I’ll cover 2 parts:
Part 1: Windows 11 GUI with WSLg
Part 2: Windows 10 GUI with WSL and VNC Server
Part 1: Windows 11 GUI with WSLg
If your using windows 11, WSL now comes packed with WSLg (Windows Subsystem for Linux GUI). WSLg enables Linux GUI apps installed on WSL to be accessible on windows as native apps. They are not that native yet, WSLg utilizes RDP technology to remote access the Linux GUI app.

Installing WSL on windows 11
In order for WSL to work on windows 11 two windows features have to be enabled.
- Windows Subsystem for Linux
- Virtual Machine Platform

After enabling the two features and rebooting the PC. Your now ready to use WSL.
Update WSL
wsl --update

Install Ubuntu distribution on windows 11 WSL
Method 1
Installing ubuntu wsl distro on windows 11 using CMD.
wsl --install -d Ubuntu

Method 2
If the terminal method of installing is too confusing for you, you can install the WSL ubuntu distro from the Microsoft Store, just ensure the program features we talked about are enabled.

Installing Chrome on Windows 11 WSL
Once the installation is done you can launch ubuntu wsl by typing ubuntu on the CMD or through GUI when you search for ubuntu on windows search.
Run the following on your WSL ubuntu distro to install chrome browser.
## Update list of available packages
sudo apt update
## Google Chrome
cd /tmp
sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt install --fix-broken -y
sudo dpkg -i google-chrome-stable_current_amd64.deb
Once installation is done you can now access the Linux chrome installed on WSL when you search for it on windows search.

NB: If your pc does not have proper specs consider installing something light. Chrome is memory and processor intensive and may crash.
For more on WSLg follow the guide: https://github.com/microsoft/wslg
Part 2: Windows 10 GUI with WSL and VNC Server
Unlike windows 11 windows 10 does not come pre-installed with WSLg for this reason we have to come up with a different solution for the problem.
Configure VNC on Ubuntu
We’ll start by configuring VNC on our ubuntu WSL.
Before anything update the package list:
sudo apt update
Install XFCE desktop environment on our ubuntu WSL
sudo apt install xfce4 xfce4-goodies
After the XFCE installation, install TightVNC.
sudo apt install tightvncserver
To finalize the installation we need to set the password for the vnc connection to do that run the below command on the WSL.
vncserver
You will be ask to input a password and verify the password.
NB: The password must be between six and eight characters long. Passwords more than 8 characters will be truncated automatically.
Once your done you will be asked for an option to create a view only password. Choose no . A view only password gives limited access to the user using the password for instance with no keyboard or mouse access. Practical when you want to show someone a demonstration.
The process then creates default configurations and end gracefully.

Once that's all setup, we then need whenever we start or restart the VNC server to start our desktop environment if its not yet started.
To do that we need to edit ~/.vnc/xstartup
Run:
echo "startxfce4 &">>~/.vnc/xstartup
This will add startxfce4 & at the end.
Installing VNC Viewer and Remote connecting
On the main host (The windows PC) we need to install VNC viewer to remote access the WSL2 linux.
Download here
Notice: In the screenshot above after starting VNC server your given a a name to connect to it.

Its is mostly the computer name then a colon append by an number that gets incremented automatically i.e if :1 is in use it automatically creates :2 and so on. This removes the need for using an IP to connect instead we just use the name…let the PC worry about the IP stack.
We then create a connection using the VNC viewer to our WSL2 UbuntuOS.

NB: You will be required to input the password you created.
You can change the picture quality to high instead of automatic in the option section.
Start VNC using Script
On a regular Ubuntu PC we would use systemd to start, stop, and restart VNC as needed, like any other service.
However WSL2 works like a docker containers. It is impossible to setup systemd since it’s not yet supported.
NB : It is possible to make systemd work using systemd-genie for simplicity sake we’ll just use a script.
Why we need the script ?
Well we want our VNC server to automatically start at :1 every time we start the VNC server .
If the service is already running we want it to kill the current :1 servece running and start a new :1. This is helpfully so that our VNC viewer always connects at :1 .
Run :
nano ~/vncstart.sh
Add the following:
#!/bin/bash
vncserver -kill :1 > /dev/null 2>&1
rm -f /tmp/.X1-lock
rm -f /tmp/.X11-unix/X1
vncserver :1 -geometry 1366x768
Give the file execution rights.
chmod u+x ~/vncstart.sh
NB: If you were in another directory navigate to the home directory cd ~
Run:
./vncstart.sh
Notice: If you run the script several times it will always starts at the vnc server at :1 .
To start the VNC server always use the script.
Conclusion
With the GUI on your Linux you can install and use any Linux software of your choice without dual booting.
Its is not recommended to edit Linux files directly from windows. however with the GUI you can install a code editor of your choice to make changes to a files as you wish.
Below is a sample of my installation:
