Skip to content

Instantly share code, notes, and snippets.

@Vinetos
Last active October 15, 2025 07:21
Show Gist options
  • Save Vinetos/9dce954adf4c48a74a830869c941ea1f to your computer and use it in GitHub Desktop.
Save Vinetos/9dce954adf4c48a74a830869c941ea1f to your computer and use it in GitHub Desktop.

Revisions

  1. Vinetos revised this gist Nov 29, 2020. 1 changed file with 15 additions and 4 deletions.
    19 changes: 15 additions & 4 deletions wsl2-xrdp.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,15 @@
    # 0. ON WINDOWS :
    # On windows, to check which WSL you use, type ` wsl --list --verbose ` in admin cmd.
    # If you are not in WSL2, reinstall the machine with WSL2 : https://docs.microsoft.com/fr-fr/windows/wsl/install-win10

    # 1. Make sure you are running with systemd
    # sudo systemctl must not say "Failed to connect to bus"
    # If so, I recommand you to reinstall the VM. You can try this repo too : https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git

    # 2. On WSL2 machine
    # /!\ Create an user with A PASSWORD and with sudo access
    # On your WSL2 machine installed, juste run theses commands :

    sudo apt update && sudo apt -y upgrade
    sudo apt-get dist-upgrade
    sudo apt-get install xfce4 xrdp xfce4-goodies xorg
    @@ -18,9 +27,11 @@ sudo /etc/init.d/xrdp start

    sudo /etc/init.d/xrdp status

    # Launch Windows remote desktop and connect to localhost:3390

    # To launch the xrdp server
    # 4. Launch the xrdp server :
    #sudo /etc/init.d/xrdp start
    # To stop the xrdp server
    #sudo /etc/init.d/xrdp stop

    # Launch Windows remote desktop and connect to localhost:3390

    # 5. Stop the connection
    #sudo /etc/init.d/xrdp stop
  2. Vinetos created this gist Nov 29, 2020.
    26 changes: 26 additions & 0 deletions wsl2-xrdp.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # On windows, to check which WSL you use, type ` wsl --list --verbose ` in admin cmd.
    # If you are not in WSL2, reinstall the machine with WSL2 : https://docs.microsoft.com/fr-fr/windows/wsl/install-win10
    # On your WSL2 machine installed, juste run theses commands :
    sudo apt update && sudo apt -y upgrade
    sudo apt-get dist-upgrade
    sudo apt-get install xfce4 xrdp xfce4-goodies xorg

    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

    echo xfce4-session > ~/.xsession

    sudo systemctl enable dbus
    sudo /etc/init.d/dbus start
    sudo /etc/init.d/xrdp start

    sudo /etc/init.d/xrdp status

    # Launch Windows remote desktop and connect to localhost:3390

    # To launch the xrdp server
    #sudo /etc/init.d/xrdp start
    # To stop the xrdp server
    #sudo /etc/init.d/xrdp stop