Skip to content

Instantly share code, notes, and snippets.

@latheeshvm
Created August 27, 2023 15:05
Show Gist options
  • Save latheeshvm/955f0cedc920b5ee50b2fdbfe578d3b6 to your computer and use it in GitHub Desktop.
Save latheeshvm/955f0cedc920b5ee50b2fdbfe578d3b6 to your computer and use it in GitHub Desktop.
WSL2 | RDP
#!/bin/bash
# Update repositories and packages
sudo apt update && sudo apt upgrade -y
# Install xrdp
sudo apt install -y xrdp
sudo apt install -y xfce4
sudo apt install -y xfce4-goodies
#backup
sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
#port config
sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
#scaling and color
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
Edit the xrdp file :
sudo nano /etc/xrdp/startwm.sh
Comment these lines below:
#test -x /etc/X11/Xsession && exec /etc/X11/Xsession
#exec /bin/sh /etc/X11/Xsession
Add these lines:
echo "# xfce" >> "$file"
echo "startxfce4" >> "$file"
echo "File edited successfully."
sudo /etc/init.d/xrdp start
# make it executable
# chmod +x update_and_install_xrdp.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment