The Founder’s Guide:

How to Install Ubuntu Desktop With a Graphical User Interface in WSL2

The condensed tutorial with copy and paste code and screenshots

Update: The GUI doesn’t include sound by default. To install the GUI with sound refer to this article.

“The expanded version of this article uses concise explanations to help you learn what’s happening 💡”

Download VcXsrv:

  1. Visit the official website
  2. Click “Download”

Install VcXsrv:

  1. Open “vcxsrv-64.1.20.8.1.installer.exe”
  2. Click “Next”
  3. Click “Install”
  4. Click “Close”

Allow Access to VcXsrv:

  1. Check “Private Networks”
  2. Click “Allow Access”

Open PowerShell:

  1. Press “⊞ Windows”
  2. Enter “PowerShell” into the search bar
  3. Right-click “Windows PowerShell”
  4. Click “Run as Administrator”

Change the Execution Policy:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
Set-ExecutionPolicy Unrestricted -Force

Open WSL2:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
wsl

Install Ubuntu Desktop:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt --yes install ubuntu-desktop

Set the Username Variable:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
username=$(wslvar USERNAME)

Create the Ubuntu Directory:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
mkdir --parents /mnt/c/users/$username/.ubuntu/

Open the Ubuntu Directory:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
cd /mnt/c/users/$username/.ubuntu

Get the Microsoft Public Key:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt-key adv --fetch-keys https://packages.microsoft.com/keys/microsoft.asc

Add Microsoft to the Source List Directory:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. 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:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt update

Download .Net 5.0 Runtime:

  1. Visit the official site
  2. Click “Download x64”

Install .Net 5.0 Runtime:

  1. Click the “Windowsdesktop-runtime-5.0.5-win-x64.exe” file
  2. Click “Install”
  3. Click “Next”
  4. Click “Close”

Enter the Shell as the Root User:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo --shell

Install Apt Transport HTTPS:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
apt install apt-transport-https

Download the GPG Key:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. 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:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
chmod a+r /etc/apt/trusted.gpg.d/wsl-transdebian.gpg

Add Arkane Systems to the Source List Directory:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. 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:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
apt update

Exit the Shell as the Root User:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
exit

Install Genie:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt install --yes systemd-genie

Add Genie to the Sudoers Directory:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
echo "$USER ALL=(ALL) NOPASSWD:/usr/bin/genie" | sudo EDITOR="tee" visudo --file /etc/sudoers.d/$USER

Create the Desktop Environment Script:

  1. Copy the code from below these instructions
  2. Paste the code into PowerShell
  3. Press “Enter”

Download the Ubuntu Design Images:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
wget https://assets.ubuntu.com/v1/9fbc8a44-circle-of-friends-web.zip

Install Unzip:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt --yes install unzip

Unzip the Ubuntu Design Images:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
unzip 9fbc8a44-circle-of-friends-web.zip

Install ImageMagick:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
sudo apt --yes install imagemagick

Create the Ubuntu Icon:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
convert -resize 64x64 ./circle-of-friends-web/png/cof_orange_hex.png ubuntu.ico

Exit WSL2:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
exit

Shut Down WSL2:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
wsl --shutdown

Create the VcXsrv Script:

  1. Copy the code from below these instructions
  2. Paste the code into PowerShell
  3. Press “Enter”

Create the Ubuntu Desktop Script:

  1. Copy the code from below these instructions
  2. Paste the code into PowerShell
  3. Press “Enter”

Create the Shortcut Icon:

  1. Copy the code from below these instructions
  2. Paste the code into PowerShell
  3. Press “Enter”

Open the Ubuntu Directory:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
cd $HOME\.ubuntu

Launch Ubuntu Desktop:

  1. Copy the command from below these instructions
  2. Paste the command into PowerShell
  3. Press “Enter”
  4. Double-click the “Ubuntu” shortcut
  5. Wait 180 seconds for Ubuntu Desktop to boot up
explorer.exe .\

Open Terminal:

  1. Click “Activities” in the top-left corner
  2. Enter “Terminal” into the search bar
  3. Click “Terminal”

Disable the Screen Lock:

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. Press “Enter”
gsettings set org.gnome.desktop.lockdown disable-lock-screen true

Install the Snap Store:

  1. Copy the command from below these instructions
  2. Paste the command into Terminal
  3. 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 Learning
WSL2:
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 Learning
Mac:
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

From: Non-Technical | To: Technical | Writes: To Make It Easier For Everyone | Topics: #Setup #Basics #AI #MachineLearning #DeepLearning #Repositories

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