This bash script is used for RHEL and Fedora virtual machines to configure XRDP for enhanced session in Hyper-V.
It should work on Fedora 3x, RHEL 8, RHEL 9 and their variants.
-
Enable Extra Packages for Enterprise Linux (EPEL).
For RHEL and its variants, follow instructions on Fedora documentary.
However, this is not required on Fedora, since it has the extra repositories enabled by default.
-
Install the following packages
sudo dnf install hyperv-tools xrdp xrdp-selinux
-
Run the script as root
curl -fsSL https://raw.githubusercontent.com/hu-ximing/Hyper-V-RHEL-Fedora-enhanced-session/main/install-config.sh | sudo bash
-
Poweroff vm
-
Run in elevated PowerShell on Windows host
Set-VM -VMName <your_vm_name> -EnhancedSessionTransportType HvSocket
Check:
Get-VM <your_vm_name> | select EnhancedSessionTransportType # should print "HvSocket"
-
Start the vm
Now the vm can be connected as enhanced session.
It is a fork/combination of scripts below:
https://github.com/microsoft/linux-vm-tools/pull/124/files
https://github.com/EtienneBarbier/Hyper-V-RHEL-VM/blob/main/install_configure_esm_rhel.sh