The Founder’s Guide:
How to Install Ubuntu Desktop With a Graphical User Interface in WSL2
The expanded tutorial with explanations and screenshots

“Attention: This article has been rewritten to simplify the process and include updates to the process. See updated article here.”
Download VcXsrv:
SourceForge is a web-based service that’s used to download open-source software and host open-source software repositories for free. It provides a centralized version control system to manage open-source projects. It also provides an easy way for end-users to download and install the software.
- Visit the official website
- Click “Download”

Install VcXsrv:
Visual C++ X Server (VcXsrv) is a display server that’s used in X Windows System to run Linux-based applications on the Windows operating system. It can display the graphical user interface of Linux-based applications and desktop environments that are running on a remote Linux-based computer.
- Open “vcxsrv-64.1.20.8.1.installer.exe”
- Click “Next”
- Click “Install”
- Click “Close”

Allow Access to VcXsrv:
The Allow Access option instructs the Windows Firewall to allow secure and insecure traffic on the specified networks for a specific program. It lets the program send data to and from the computer using various ports. This can be necessary for the program to work but it makes the computer less secure.
- Check “Private Networks”
- Click “Allow Access”

Open PowerShell:
PowerShell is a command-line shell and object-oriented scripting language that’s used to automate administrative tasks and configure system settings It can be used to automate practically anything in the operating system. It also replaced Command Prompt as the default system shell for Windows 10.
- Press “⊞ Windows”
- Enter “PowerShell” into the search bar
- Right-click “Windows PowerShell”
- Click “Run as Administrator”

Change the Execution Policy:
The Execution Policy is a feature in PowerShell that’s meant to prevent the accidental execution of malicious scripts. It only allows the user to execute commands by default but it can be changed to load configuration files and run scripts. It can also be changed for the current session, user, or machine.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
Set-ExecutionPolicy Unrestricted -Force

Open WSL2:
Windows Subsystem for Linux 2 (WSL2) is a Windows 10 feature that allows users run Linux on Windows without using dual-boot or a virtual machine. It has full access to both filesystems, GPU support, and network application support. It also provides access to thousands of Linux command-line tools.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
wsl

Install Ubuntu Desktop:
Ubuntu Desktop is a desktop operating system that’s known for being fast, secure, and free. It installs a metapackage that contains all the packages that make up the desktop environment which uses GNOME 3 by default. This provides a graphical user interface for the Ubuntu Linux distribution.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
sudo apt --yes install ubuntu-desktop

Set the Username Variable:
The Command Substitution $() is an operation that executes the command inside its parenthesis and stores the output in a variable to use later. It runs the command in a subshell, replaces that command with the output, and deletes any newlines. It can also be nested in other command substitutions.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
username=$(wslvar USERNAME)

Create the Ubuntu Directory:
The Make Directory (mkdir) command is used to create new directories. It can specify one or more relative or absolute paths with the name of the new directories to be created. It can also be used with the “Parents” flag to create parent directories as needed without overwriting a path that already exists.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
mkdir --parents /mnt/c/users/$username/.ubuntu/

Open the Ubuntu Directory:
The Change Directory (cd) command is used to change the current working directory to the specified directory. It can navigate to absolute and relative paths that start from the root and current working directory, respectively. It can also navigate to paths stored in variables and environment variables.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
cd /mnt/c/users/$username/.ubuntu

Get the Microsoft Public Key:
Apt-key is a program that uses key pairs to prevent users from downloading packages that contain malicious data. It stores the private key on the server that stores the packages and distributes the public key to users. It also uses the public key to verify the private key before packages can be downloaded.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
sudo apt-key adv --fetch-keys https://packages.microsoft.com/keys/microsoft.asc

Add Microsoft to the Source List Directory:
The Source List Directory is a directory that contains separate source list files for individual repositories. It stores information that’s used to download and update packages from a repository. It also supplements the main source list file that stores information about existing repositories on the computer.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
Ubuntu 20.04:
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/ubuntu/20.04/prod focal main" > /etc/apt/sources.list.d/microsoft-prod.list'Ubuntu 18.04:
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main" > /etc/apt/sources.list.d/microsoft-prod.list'

Update the Repositories:
The Update command is used to ensure the list of available packages is up to date. It downloads a package list from the repositories on the system which contains information about new and upgradable packages. It only updates information about the packages and doesn’t actually upgrade the packages.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
sudo apt update

Enter the Shell as the Root User:
Root User is an account in Linux-based operating systems that’s used for system administration. It can access all commands and files, modify the system in any way, and manage access and permissions for other users. It can also make the entire system inoperable in the event of a careless user error such as accidentally damaging or deleting an important system file.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
sudo --shell

Install Apt Transport HTTPS:
APT Transport HTTPS is a program that’s used in Linux-based operating systems to access metadata and packages in repositories that uses HTTPS Protocol. It enables package managers to download packages with end-to-end encryption. It also only gets used by APT based on whether the URLs were stored in the source list and source list directory as HTTPS or HTTP.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
apt install apt-transport-https

Download the GPG Public Key:
The GNU Privacy Guard (GPG) File is a public key that’s used in Linux-based operating systems to verify the signature in a message to prove the identity of its sender. It contains a very large string of numbers and letters which are used to encrypt a message that can only be decrypted by the person who possesses the associated private key. It gets generated by the GNU Privacy Guard program as part of the key-pair system where the public key is shared with everyone but the private key is protected and kept secret by the owner.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
wget --output-document /etc/apt/trusted.gpg.d/wsl-transdebian.gpg https://arkane-systems.github.io/wsl-transdebian/apt/wsl-transdebian.gpg

Change the Access Permissions:
Change Mode (Chmod) is a command that’s used in Linux-based operating systems to change the access permissions of files and directories. It specifies the desired permission settings and the file or directory to be modified. It can also specify the permission settings using octal notation, which uses the numbers 0 through 7, or symbolic notation, which uses a range of letters.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
chmod a+r /etc/apt/trusted.gpg.d/wsl-transdebian.gpg

Add Arkane Systems to the Source List Directory:
The Source List Directory is a directory that contains separate source list files for individual repositories. It stores information that’s used to download and update packages from a repository. It also supplements the main source list file that stores information about existing repositories on the computer.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
cat << EOF > /etc/apt/sources.list.d/wsl-transdebian.list
deb https://arkane-systems.github.io/wsl-transdebian/apt/ $(lsb_release -cs) main
deb-src https://arkane-systems.github.io/wsl-transdebian/apt/ $(lsb_release -cs) main
EOF

Update the Repositories:
The Update command is used to ensure the list of available packages is up to date. It downloads a package list from the repositories on the system which contains information about new and upgradable packages. It only updates information about the packages and doesn’t actually upgrade the packages.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
apt update

Exit the Root Shell:
The Exit command is used in WSL2 to close the current shell and return to the calling program. It maintains the session of WSL2 in the background which allows users to resume working where they left off when they reopen WSL2. It can also be used to log out of the root account and return to WSL2.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
exit

Install Genie:
Genie is a program that’s used in WSL2 to run services that require systemd. It creates a container, runs systemd as process id 1 inside the container, and enters it. This is necessary because WSL2 doesn’t support systemd but many programs rely on it to initialize, manage, and track services and daemons.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
sudo apt install --yes systemd-genie

Add Genie to the Sudoers Directory:
The Sudoers Directory is a directory that contains individual sudoers files that are loaded with the main sudoers file. It stores information that’s used to manage users that are given sudo permissions. It also must use the same syntax as the main sudoers file so it’s advised to edit these files with visudo.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/genie" | sudo EDITOR="tee" visudo --file /etc/sudoers.d/$USER

Create the Desktop Environment Script:
The Desktop Environment Script is used to create a Bash script that starts the Ubuntu desktop. It mostly sets the environment variables that are needed for the GNOME 3 desktop environment to work as expected. It also sets the display variable which appends a custom display number to the hostname.
- Copy the code from below these instructions
- Paste the code into PowerShell
- Press “Enter”

Download the Ubuntu Design Images:
Wget is a program that’s used to retrieve files from the internet using HTTP, HTTPS, and FTP protocols. It can perform recursive downloads, convert links for offline viewing of HTML, and support proxies. It can also perform multiple downloads, resume downloads, and download in the background.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
wget https://assets.ubuntu.com/v1/9fbc8a44-circle-of-friends-web.zip

Install Unzip:
The Unzip program is used to extract files from a zip file. It extracts the files to a new directory in the current directory by default but it can extract them to a specific directory by including the “d” option. It can also unzip multiple archive files by listing them sequentially or by using the wildcard character.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
sudo apt --yes install unzip

Unzip the Ubuntu Design Images:
Ubuntu Design is a company website that provides guidelines to help create professional materials, websites, and programs that use the Ubuntu brand. It includes the official logos, fonts, icons, and color palette. It also includes suggested practices for web, design, product photography, and screenshots.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
unzip 9fbc8a44-circle-of-friends-web.zip

Install ImageMagick:
ImageMagick is a program that’s used to display, create, convert, modify, and edit images in over 200 file formats. It can process large batches of images and perform precise modifications to a single image. It can also manipulate images from the command-line or a graphical user interface.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
sudo apt --yes install imagemagick

Create the Ubuntu Icon:
The Convert command is used by ImageMagick to convert images between file formats. It can perform a broad range of operations on images such as resize, blur, flip, crop, join, rotate, scale, and transform. It can also use 237 options to blend image-processing operations and create complex results.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
convert -resize 64x64 ./circle-of-friends-web/png/cof_orange_hex.png ubuntu.ico

Exit WSL2:
The Exit command is used in WSL2 to close the current window without terminating the process. It reopens the shell that was previously running and maintains the current session of WSL2 in the background. This lets users continue working right where they left off when they reopen WSL2.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
exit

Shut Down WSL2:
The Shut Down command is used to terminate the WSL2 distribution that’s currently running in the background. It can be used to restart WSL2 after installing an update which allows the changes to take effect. This is needed because closing the window doesn’t actually shut down the distribution.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
wsl --shutdown

Create the VcXsrv Script:
The VcXsrv Script is used to create a PowerShell script that restarts VcXsrv. It mostly searches for VcXsrv in the running processes and stops the processes that use a particular display number. It also starts a new VcXsrv process that reuses the display number and displays Linux programs in a large window.
- Copy the code from below these instructions
- Paste the code into PowerShell
- Press “Enter”

Create the Ubuntu Desktop Script:
The Ubuntu Desktop Script is used to create a Visual Basic script that runs the PowerShell and Bash scripts. It mostly restarts VcXsrv by closing all the running processes and starting a new process. It also launches the Ubuntu Desktop by configuring and starting the GNOME 3 desktop environment.
- Copy the code from below these instructions
- Paste the code into PowerShell
- Press “Enter”

Create the Shortcut Icon:
The Shortcut Icon is used to execute the Visual Basic script that restarts the VcXsrv process and starts the desktop environment. It gets created using a method from the WshShell object in Windows Script Host which specifies the path to the shortcut icon, shortcut icon image, and Visual Basic script.
- Copy the code from below these instructions
- Paste the code into PowerShell
- Press “Enter”

Open the Ubuntu Directory:
The Change Directory (cd) command is used to change the current working directory to the specified directory. It can navigate to absolute and relative paths that start from the root and current working directory, respectively. It can also navigate to paths stored in variables and environment variables.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
cd $HOME\.ubuntu

Launch Ubuntu Desktop:
File Explorer is a program that’s used to provide a graphical user interface to open files and programs. It can navigate through storage drives and display the contents of the directories and subdirectories. It can also open a specific directory by specifying a relative or absolute path from the command-line.
- Copy the command from below these instructions
- Paste the command into PowerShell
- Press “Enter”
- Double-click the “Ubuntu” shortcut
- Wait 180 seconds for Ubuntu Desktop to boot up
explorer.exe .\


Open Terminal:
GNOME Terminal is the default terminal emulator that’s used on Ubuntu desktop environment. It can run commands, work with files, interact with other computers, and perform administrative tasks and configurations. It also features multiple tabs, user profiles, and custom startup commands.
- Click “Activities” in the top-left corner
- Enter “Terminal” into the search bar
- Click “Terminal”

Disable the Screen Lock:
The screen lock feature in GNOME 3 doesn’t work properly. It locks the user out of the system which requires restarting Ubuntu Desktop to unlock the screen. It also occurs whether the system automatically locks the screen or the user manually does it but it can be avoided by disabling the screen lock.
- Copy the command from below these instructions
- Paste the command into Terminal
- Press “Enter”
gsettings set org.gnome.desktop.lockdown disable-lock-screen true

Install the Snap Store:
Snap Store is a program that’s used to provide a graphical user interface to find, install, and manage applications on Ubuntu. It can find featured and popular snaps using descriptions, ratings, reviews, and screenshots. It can also find snaps through browsing categories and searching for keywords.
- Copy the command from below these instructions
- Paste the command into Terminal
- Press “Enter”
sudo snap install snap-store

“Hopefully, this article helped you get the 👯♀️🏆👯♀️, remember to subscribe to get more content 🏅”
Next Steps:
This article is part of a mini-series that helps readers set up everything they need to start learning about artificial intelligence, machine learning, deep learning, and or data science. It includes articles that contain instructions with copy and paste code and screenshots to help readers get the outcome as soon as possible. It also includes articles that contain instructions with explanations and screenshots to help readers learn about what’s happening.
Linux:
01. Install and Manage Multiple Python Versions
02. Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT
03. Install the Jupyter Notebook Server
04. Install Virtual Environments in Jupyter Notebook
05. Install the Python Environment for AI and Machine LearningWSL2:
01. Install Windows Subsystem for Linux 2
02. Install and Manage Multiple Python Versions
03. Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT
04. Install the Jupyter Notebook Server
05. Install Virtual Environments in Jupyter Notebook
06. Install the Python Environment for AI and Machine Learning
07. Install Ubuntu Desktop With a Graphical User Interface (Bonus)Windows 10:
01. Install and Manage Multiple Python Versions
02. Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT
03. Install the Jupyter Notebook Server
04. Install Virtual Environments in Jupyter Notebook
05. Install the Python Environment for AI and Machine LearningMac:
01. Install and Manage Multiple Python Versions
02. Install the Jupyter Notebook Server
03. Install Virtual Environments in Jupyter Notebook
04. Install the Python Environment for AI and Machine Learning
Glossary:
Centralized Version Control System (CVCS) is a version control system that has a client-server relationship where a repository is located on one server that provides access to many clients. It stores all the files and historical data on the server. It can also control user access but it can’t be accessed offline.
[Return]
The X Windows System (X11) is the standard toolkit and protocol that’s used for building the graphical user interface on Unix-based operating systems. It handles the appearance of the windows, frames, buttons, toolbars, and title bars. It also receives user input from the mouse, keyboard, and touchscreen.
[Return]
Windows Firewall is an application that’s used to protect computers against attacks from the local network and the internet. It filters traffic based on IP address and port information. It permits all outbound traffic but it restricts inbound traffic to the sources that are explicitly stated in the firewall rules.
[Return]
The Shell is an interpreter that presents the command-line interface to users and allows them to interact with the kernel. It lets them control the system using commands entered from a keyboard. It also translates the commands from the programming language into the machine language for the kernel.
[Return]
The Interpreter is a program that reads through instructions that are written in human-readable programming languages and executes the instructions from top to bottom. It translates each instruction to a machine language the hardware can understand, executes it, and proceeds to the next instruction.
[Return]
The Command-Line Interface (CLI) is a program that accepts text input from the user to run commands on the operating system. It lets them configure the system, install software, and access features that aren’t available in the graphical user interface. It also gets referred to as the terminal or console.
[Return]
The Kernel is the program at the heart of the operating system that controls everything in the computer. It facilitates the memory management, process management, disk management, and task management. It also facilitates communication between the programs and hardware in machine language.
[Return]
The Desktop Environment is a collection of programs on top of an operating system that makes up the graphical user interface. It includes components like the windows manager, panels, menus, system tray, icons, and widgets. It also determines what the system looks like and how to interact with it.
[Return]
GNOME 3 is a very popular desktop environment that has a simple, easy to use, and reliable user experience. It provides an unique user interface that’s designed to focus on tasks and remove distractions. It also features a clean icon-less desktop, powerful search, tasks overview, and desktop extensions.
[Return]
Ubuntu is an open source operating system that’s built on top of Debian that includes thousands of supporting programs. It has become one of the most popular Linux distributions that’s known for being easy to use, reliable, and free. It can also be used on desktops, servers, and internet of things devices.
[Return]
The wslvar command is used in WSL2 to access the Windows environment variables from WSL2 . It specifies the environment variable but it doesn’t require the variable name to be enclosed in percentage signs. It can also be combined with command substitution to store the output in a variable.
[Return]
The Variable is the container that’s used to store different types of values. It can assign or update a value by placing an equals sign between the specified variable name and value without a space around it. It can also reference the stored value by placing a dollar sign in front of the existing variable name.
[Return]
The Environment Variable is a variable that’s automatically created and maintained by the computer. It helps the system know where to install files, find programs, and check for user and system settings. It can also be used by graphical and command-line programs from anywhere on the computer.
[Return]
The Repository is a storage location for binary packages that are located on remote servers. It needs to be present in the source list for the computer to install or update its containing packages. This helps provide a high level of security while making it easy to install programs in Linux distributions.
[Return]
The Binary Package is an archive file that contains the files and directories needed to make its containing program work properly. It gets stored in the repository that contains all the programs for a specific Linux distribution. It also requires the Linux package manager to access, extract, and install it.
[Return]
GNU Privacy Guard (GnuPG) is a program that’s used in Linux-based operating systems to provide secure communication between parties. It provides cryptographic privacy and authentication using a combination of symmetric-key and public-key cryptography. It also follows the OpenPGP protocol which defines all the necessary components involved in sending encrypted message signatures, private keys, and public key certificates.
[Return]
The Sudoers File is a text file that the sudo command uses to control which users can run what commands. It can allow users to run a specific command using elevated privileges without a password. It can also break the sudo program due to improper syntax so it’s advised to edit this file with visudo.
[Return]
The Super User Do (sudo) command is used to provide root level privileges to specific users. It enables them to enter their password to run commands that would otherwise be prohibited. It also only works for the main Ubuntu user by default but it can be used by other users by editing the sudoers file.
[Return]
The Visudo command is used to open a modified version of the nano text editor that can edit the sudoers file without accidentally breaking the sudo program. It locks the file so that only one person can make changes at once. It also parses the file before saving to ensure there aren’t any syntax errors.
[Return]
The Display variable is an environment variable that’s used to determine what screen to use when connecting to the display server. It contains the display name which includes a hostname, display number, and screen number. It also needs to be set because the program won’t work without it.
[Return]
The Screen Number is the optional number that’s used to refer to a specific screen from a collection of monitors that share a mouse and keyboard. It should be a number that starts at zero and increments once per screen. It also only really applies to computers that actually have multiple screens.
[Return]
The Display Number is the number that refers to the collection of monitors that share a mouse and keyboard. It should be a number that’s followed by a period character that starts at zero and increments once per collection. It also must be included in the display name or the program won’t execute.
[Return]
The Hostname is the internet address that the program uses to connect to the computer that’s running the display server. It should be an IP address, domain name, or abbreviated name that’s followed by a colon character. It also defaults to the localhost when an internet address isn’t provided.
[Return]
Visual Basic Script (VBScript) is a scripting language that’s based on Visual Basic. It was created for developing web pages but it has become a popular language for writing batch files on Windows. It can also be executed using Windows Scripting Host to interact with the Windows operating system.
[Return]
The WshShell object is used in Visual Basic Script to allow users to interact with the Windows operating system. It has access to environment variables, system folders, and the registry. It can also create shortcuts, display pop-up windows, and run programs with command-line arguments and keystrokes.
[Return]
Screen Lock is a security feature that prevents other people from accessing the computer. It locks the screen after a period of inactivity which requires entering the password to unlock the screen. It can also be manually locked by the user which also requires entering the password to unlock the screen.
[Return]
Snap is a self-contained package that contains all the dependencies that are needed to work perfectly and securely on any Linux distribution. It bundles the program, supporting libraries, and metadata into a compressed package which can be updated and rolled back to a previous version automatically.
[Return]