So you want to Install WSL2 and Setup a graphical user interface (GUI) with Ubuntu 20.04 using WSL 2 on a Windows 10 computer. I learned how to setup WSL2 with a GUI from David Bombals video, and Robin Kretzschmar
article, he left all the commands for people to use in the comments section, I have added them on this page, so people can find them easier. credit goes to David Bombal. I show you step by step on how to get GUI installed and how to connect to the GUI using remote desktop, it’s pretty cool.
[su_box title=”WSL commands: ” style=”soft”]dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart wsl –set-default-version 2
wsl –set-default-version 2
[/su_box]
[su_box title=”Ubuntu GUI commands:” style=”soft”]sudo apt update && sudo apt -y upgrade
sudo apt-get purge xrdp
sudo apt install -y xrdp
sudo apt install -y xfce4
sudo apt install -y xfce4-goodies
sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
sudo sed -i ‘s/3389/3390/g’ /etc/xrdp/xrdp.ini
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
echo xfce4-session > ~/.xsession
sudo nano /etc/xrdp/startwm.sh
edit these lines to:
# test -x /etc/X11/Xsession && exec /etc/X11/Xsession
# exec /bin/sh /etc/X11/Xsession
add these lines:
# xfce
startxfce4
sudo /etc/init.d/xrdp start
[/su_box]
Now go to the search box and type Remote Desktop open
Remote Desktop Connection and type localhost:3390 then login using your Ubuntu username and password, to install Firefox type: sudo apt install firefox
Good Useful links:
.wslconfig is not working . please help!
All in one command :
sudo apt update && sudo apt -y upgrade && sudo apt-get purge xrdp && sudo apt install -y xrdp && sudo apt install -y xfce4 && sudo apt install -y xfce4-goodies && sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak && sudo sed -i ‘s/3389/3390/g’ /etc/xrdp/xrdp.ini && 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 && echo xfce4-session > ~/.xsession && sudo nano /etc/xrdp/startwm.sh
For thepart after xfce4-goodies : sudo sed -i ‘s/3389/3390/g’ /etc/xrdp/xrdp.ini && 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 && echo xfce4-session > ~/.xsession && sudo nano /etc/xrdp/startwm.sh
Your code blocks contain curly-quotes, which are not good. You should fix those.
Hi !
Its very great but it takes a lot of memory, powerfull, so can you explained me how to uninstall it plz ?
thks