The tutorial will tell you how to run desktop environment inside Windows Subsystem for Linux.
And you don't need to build a developement environment with virtual machines any more.
Please note that you'll need to be running Windows 10 Build 19041 or higher.
You will also need to have (WSL2)[https://docs.microsoft.com/en-us/windows/wsl/install-win10#update-to-wsl-2] installed.
To install the Arch distro follow (these)[https://github.com/yuk7/ArchWSL] instructions.
This tutorial should also work for other WSL distro's if u know linux a bit.
In PowerShell run:
wsl --set-version Arch 2
If you don't use Arch, make sure to replace Arch with the actual name of your distro. (You can find these with the command: wsl -l).
Additionally, run the command below to make WSL 2 your default architecture:
wsl --set-default-version 2
Install the lastest version of VcXsrv.
sudo yay -Syu
sudo pacman -Syu
Add bellow code to ~/.bashrc
.
export DISPLAY=`grep -oP "(?<=nameserver ).+" /etc/resolv.conf`:0.0
export LIBGL_ALWAYS_INDIRECT=1
Then don't forget to run source ~/.bashrc
.
Edit /usr/share/dbus-1/session.conf
with sudo permissions & replace following lines:
<listen>unix:tmpdir=/tmp</listen>
with
<listen>tcp:host=localhost, port=0</listen>
and replace
<auth>EXTERNAL</auth>
with
<auth>ANONYMOUS</auth>
<allow_anonymous/>
Firewall & network protection -> Allow an app through the firewall ->
Change settings -> Allow another app -> Path: 'C:\Program Files\VcXsrv\vcxsrv.exe'
Open XLaunch, choose "One large window" or "One large window without titlebar", set the "display number" to 0 and click "Next.
Choose "Start no client" and click "Next".
Check "Disable access control" and click "Next".
Click "Finish" to launch display server.
After this start xface4 in Arch: startxfce4
Enjoy! :)
For further debugging if you encounter problems see (this)[microsoft/WSL#4106] thread.
OG thread: microsoft/WSL#637