I will not be continuing tihs project for the foreseeable future. I have entirely changed to various distributions of Linux for all of my systems. Should there be a time in the future where I am required to use Windows, I would likely resume it at that time in the future.
Eventually seeks to automate installation of WSL2 for xrdp connectivity to Xubuntu hosted on Windows 10 along with USB passthrough via usbipd as well as additional requisite configurations in Windows and the distro.
Install and access Ubuntu
CLI:
- Open admin-level CMD or PS.
- Install
wsl
:wsl --install
- Update
wsl
:wsl --update
- Install
Ubuntu
:wsl --install -d Ubuntu
- If
An error occurred during installation. Distribution Name: 'Ubuntu' Error Code: 0x80072eff
is encountered,Win + R > wsreset.exe
and re-run installation command; additional troubleshooting for 0x80072eff
- If
- Access
Ubuntu
:wsl --distributionName Ubuntu --user userName
Install and configure xfce
and xrdp
:
- Remove any traces of
xrdp
:sudo apt-get purge xrdp
- Install
xrdp
:sudo apt-get install xrdp
- Install
xfce
:sudo apt-get install xfce4
- Install additional
xfce
packages:sudo apt-get install xfce4-goodies
Configure xrdp
on xcfe
:
sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
- Change
xrdp
port to allow concurrent RDP and shell access: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
- Modify
/etc/xrdp/startwm.sh
- to comment-out
#test -x /etc/X11/Xsession && exec /etc/X11/Xsession
#exec /bin/sh /etc/X11/Xsession
- and append these lines to the end of the file:
# xfce
startxfce4
sudo sed -i 's:test -x /etc/X11/Xsession \&\& exec /etc/X11/Xsession:#test -x /etc/X11/Xsession \&\& exec /etc/X11/Xsession:g' /etc/xrdp/startwm.sh
sudo sed -i 's:exec /bin/sh /etc/X11/Xsession:#exec /bin/sh /etc/X11/Xsession\n# xfce\nstartxfce4:g' /etc/xrdp/startwm.sh
- to comment-out
Start the xrdp
service:
sudo /etc/init.d/xrdp start
Connect to Ubuntu
using RDP:
- In Windows,
Win + R > %windir%\system32\mstsc.exe
to open "Remote Desktop Connection" - Set
Computer
tolocalhost:3390
- Click on
Connect
- Set
Session
toXorg
- Populate
username
andpassword
- Click on
OK
- Verify Xubuntu desktop.
Backup the distribution:
- In the Window OS admin-level CLI, execute
wsl --export <distro> <filename.tar>
- e.g.,
wsl --export Ubuntu C:\projects\Ubuntu-wsl2-usbip.tar
- e.g.,
To restore this backup of the distribution:
- In the Windows OS admin-level CLI, execute
wsl --unregister <distro>
to remove the problem distribution.- e.g.,
wsl --unregister wsl2-usbip
- e.g.,
- In the Windows OS admin-level CLI, execute
wsl --import <distro> <install location> <filename>
- e.g.,
wsl --import wsl2-usbip C:\projects\wsl-dist C:\projects\Ubuntu-wsl2-usbip.tar
- e.g.,
Start WSL2 when Windows starts
- implement installation of
wsl
andWindows Terminal
usingChocolatey
- implement automated configuration of this entire process using Ansible
- Windows
- Chocolatey (community? module)
- Linux
- resolve usbipd passthrough issue with Windows 10
- include in automation if resolved
- WSL reference: Install WSL
- The post by Muhammad Ridwan Hakin • Apr 30 '20 • Edited on Jun 6 in "Linux on Windows: WSL with Desktop Environment via RDP" was extremely helpful to configure
Xubuntu
forxrdp
.