Access WSL2 desktop

Option 1

Setup X server on windows (VcXsrv, Xming, etc.) and then launch desktop manager to start at the preset display

 

Option 2

On WSL2 start xrdp and connect to it using Remote desktop connection. (Source)

Steps

  1. Install and setup xrdp
    sudo apt-get purge xrdp
    sudo apt-get install xrdp xfce4 xfce4-goodies
    
    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 /etc/init.d/xrdp start
  2. Connect to WSL using Remote Desktop Connection
    localhost:3390
    * Login with Xorg with wsl username and password

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *