wsl ubuntu desktop - Himeyama/himeyama GitHub Wiki

sudo apt update
sudo apt install -y xrdp ubuntu-desktop openssh-server

sudo service xrdp start

echo gnome-shell --x11 -r > ~/.xsession

if [ ! -f $HOME/.ssh/id_ed25519 ]; then
  ssh-keygen -f $HOME/.ssh/id_ed25519 -t ed25519 -N ""
fi

sudo ssh-keygen -A
sudo service ssh start

wsl -- echo $(cat .\.ssh\id_ed25519.pub) `| tee /root/.ssh/authorized_keys

ssh $(wsl -- hostname -I).trim() -l root -L13389:localhost:3389