Skip to content

Instantly share code, notes, and snippets.

@Zorg64
Last active January 10, 2024 22:43
Show Gist options
  • Save Zorg64/80eab66d7b7d78cc461ae3b438779c4d to your computer and use it in GitHub Desktop.
Save Zorg64/80eab66d7b7d78cc461ae3b438779c4d to your computer and use it in GitHub Desktop.
Windows RDP to WSL (Debian/Ubuntu) using KDE + XRDP

Enable systemd

echo -e "[boot]\nsystemd=true" | sudo tee -a /etc/wsl.conf

Restart wsl

exit
wsl --shutdown
wsl

Update

sudo apt update -y && sudo apt upgrade -y

Install KDE and XRDP

sudo apt install kde-plasma-desktop xrdp

SDDM fix for VMs

echo -e "[General]\nInputMethod=" | sudo tee -a /etc/sddm.conf

Modify /etc/xrdp/xrdp.ini and /etc/X11/Xwrapper.config

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

sudo sed -i 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config

Modify /etc/xrdp/startwm.sh

sudo sed -i 's|test -x /etc/X11/Xsession && exec /etc/X11/Xsession|#&|' /etc/xrdp/startwm.sh
sudo sed -i 's|exec /bin/sh /etc/X11/Xsession|#&|' /etc/xrdp/startwm.sh
echo -e '\n#kde\nstartplasma-x11' | sudo tee -a /etc/xrdp/startwm.sh

Create xsession for KDE

echo "plasma-x11-session" | sudo tee ~/.xsession

Start xrdp

sudo systemctl enable xrdp
sudo systemctl enable xrdp-sesman
sudo systemctl restart xrdp
sudo systemctl restart xrdp-sesman

Connect

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment