Copy the URL to any browser and download the latest Linux kernel update package.
Go to downloads and look for wsl_update_x64.msi
Double click on it and install the application.
Once it is installed, go back to PowerShell and run wsl –set-default-version 2 command again to set the default version of WSL to 2.
Download Ubuntu 20.04 from Microsoft Store
Click on Start and select Microsoft Store and search for Linux.
Select Ubuntu 20.04 and click on Get. It will start the download.
Select Launch, once download is complete.
Configure Ubuntu 20.04
Once you click on the Launch option, a new window will open for Ubuntu 20.04. Enter a new username and password.
You can run the command wsl -l -v in PowerShell to check the installed distribution of Linux.
Install GUI and RDP on Ubuntu 20.04
First thing, update and upgrade your Ubuntu 20.04 using the command: sudo apt update && sudo apt -y upgrade
Install RDP on Ubuntu 20.04 using command: sudo apt install xrdp
Next, we will install a lightweight graphical user interface using the xfce4 package. Command: sudo apt install -y xfce4
During the installation, it will ask you to select a default display manager. It is a program that provides graphical login capabilities for the X Windows System. We are going to use gdm3.
We will be adding some additional packages for better performance of the GUI. Command: sudo apt install -y xfce4-goodies
We are going to take a backup of xrdp configuration file. It is a good practice to have backups of the important configuration files. Command: sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.backup
Change the default port of 3389 to 3390. This step is just to make sure there are no conflicts with the port number if you are running more than one Linux distribution. Command: sudo sed -i ‘s/3389/3390/g’ /etc/xrdp/xrdp.ini
Now, we will set the parameters for screen resolution. Command: sudo sed -i ‘s/max_bpp=32/#max_bpp=32\nmax_bpp=128/g’ /etc/xrdp/xrdp.ini
sudo sed -i ‘s/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g’ /etc/xrdp/xrdp.ini
Save xfce4-session into a file called .xsession. Command: echo xfce4-session > ~/.xsession
Edit the xrdp startup script using command: sudo vi /etc/xrdp/startwm.sh
Comment out the very last two lines by putting a ‘#’ at the beginning of the line. Also, add two more lines and save the file.
Let’s start the xrdp service. Command: sudo /etc/init.d/xrdp start
Test the RDP with Ubuntu 20.04
Open Remote Desktop Connection from start.
In the Computer tab, type localhost:3390 and click on Connect.
Enter the username and password, which you have created earlier while configuring Ubuntu 20.04, and click on OK.
Finally, your Ubuntu 20.04 with GUI on Windows 10 is up and running.