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 18917 or higher.
To find your Windows version, open Settings>System>About and look for the "OS build" field.
In PowerShell run:
wsl --set-version <Distro> 2
Make sure to replace 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 apt-get update
sudo apt-get upgrade
sudo apt-get install xfce4-terminal
sudo apt-get install xfce4
Add bellow code to your ~/.bashrc
, and don't forget to run source ~/.bashrc
. :)
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
export LIBGL_ALWAYS_INDIRECT=1
Open XLaunch, choose "One large window" or "One large window without titlebar", set the "display number" to 0 and click "Next.
Check "Disable access control" and click "Next".
Choose "Start no client" and click "Next".
Click "Finish" to launch display server.
Execute the following command inside Ubuntu.
startxfce4
Install the lastest version of Hack fonts.
sudo apt-get install fonts-noto
sudo apt-get install fonts-noto-hinted
sudo apt-get install fonts-noto-mono
sudo apt-get install fonts-noto-unhinted
sudo apt-get install fonts-noto-cjk
Add the following shell code to your bashrc
if grep -q microsoft /proc/version; then
if [ "$(umask)" == '0000' ]; then
umask 0022
fi
fi
sudo apt-get install fcitx
sudo apt-get install fcitx-pinyin
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
sudo apt-get install guake
Please enjoy your development environment. :)