Photo by Tonik on Unsplash

WSL2 with GUI

Firstly, I want to mention the cover images of medium blogs. It is non-sense bro, it is ridiculous, it is just the reflection of aesthetics instead of functionality among modern society. Give up on that! This blog will never have a huuugggeeee cover image.

This is the story for the mortals that do not have built-in WSL2 GUI support on their magnificent Windows10.

Ok. Let’s go fellas. We will continue on the cmd terminal as much as we can. First of all, hit Windows+R and then copy and paste the following:

runas /user:Administrator cmd

After opening the cmd type

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartwsl --set-default-version 2wsl --install -d Ubuntu

It will wait a while but in the end, it should install it. After installation type on cmd

wsl --update
wsl --shutdown
shutdown -r

After restarting both WSL and Windows, open cmd again and type


It will ask for a username and password. Type the following for username and password:

just kidding! Type whatever you want. This is a free bla bla

After setting all that up you should download X-server for exporting the display. This can be done by copy and pasting the following URL into your browser,

After downloading and setting up the X-server you should be able to start a server for display between WSL2 and Windows. Now on ubuntu terminal type. By the way, while opening X server, just click next and yes to all. Default is fine, default is king!

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install x11-apps

Then we need to learn where should we direct our GUI-based tools. It is done by

display=sudo cat /etc/resolv.conf | grep nameserver | cut -f2 -d' ' 
export DISPLAY=$display:0.0

Now it should all be set.





Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Advancing the future of Cloud Computing with Crowd Machine

How To Learn A Programming Language

Workout your tasks with WorkManager — Advanced Topics

State of Enterprise GoLang in India

Changes in Yieldshield Testnet to Enable More Stable and Efficient Testing

How to find the smallest number in a list without min function in Python

Early praise for Release It! Second Edition

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abdullah BAŞ

Abdullah BAŞ

More from Medium

Using LCD and PWM in ESP32

Saving RTSP Camera Streams with FFmpeg

Install NVIDIA Driver 510.47.03 on Ubuntu / Linux Mint Via PPA

Buy Tipsonunix a Coffee

ESP32 Project 5: Output-Display & PWM