2020-12-27
紀錄一下 Linux on Windows: WSL with Desktop Environment via RDP
In Ubuntu WSL:
apt update && apt -y upgrade
apt-get purge xrdp
apt-get install xrdp -y
apt-get install xfce4 -y
apt-get install xfce4-goodies -y
configure : (其中可改你要的 port)
cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini
sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini
echo xfce4-session > ~/.xsession
改 xrdp
nano /etc/xrdp/startwm.sh
comment these lines to:
#test -x /etc/X11/Xsession && exec /etc/X11/Xsession
#exec /bin/sh /etc/X11/Xsession
add these lines:
# xfce
startxfce4
啟動
/etc/init.d/xrdp start
改 password
passwd root
Now in Windows, use Remote Desktop Connection
localhost:3390
then login with Xorg, fill in your username and password.