secana / EnhancedSessionMode

Contains scripts to enable "Hyper-V Enhanced Session Mode" for Linux
Apache License 2.0
79 stars 14 forks source link

Getting "Video remoting was disconnected" error #3

Closed prabhatgupta46 closed 5 years ago

prabhatgupta46 commented 5 years ago

I have followed the steps and installed xrdp on my fedora 29 workstation in hyper v. Finally enabled the ESM via powershell for my above virtual machine.

Now i get the ESM popup to choose resolution but after that throws up error "Video remoting was disconnected"

Can you help.

pjgerardo commented 5 years ago

I have followed the steps and installed xrdp on my fedora 29 workstation in hyper v. Finally enabled the ESM via powershell for my above virtual machine.

Now i get the ESM popup to choose resolution but after that throws up error "Video remoting was disconnected"

Can you help.

Same issues here but on Fedora 30

w0ndersp00n commented 5 years ago

Ok guys, I've figured this one out. I'm on Fedora 30 right now and I've used the script. The issue here is that SELinux is never set to Permissive. Instead it's stuck in Enforcing, which prevents the RDP session to be set. Ofcourse you can configure SELinux to play nice with RDP, but the easiest way is just to set it to permissive.

The issue is in line 8 of the script. This line should be as follows (or it can be added):

sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config

It's documented in this bug: https://bugzilla.redhat.com/show_bug.cgi?id=147615. The location that is used by the script is deprecated.

To fix it, first of all disable Enhanced Session, by shutting down the VM. In an elevated PowerShell enter the following command:

Set-VM -VMName "<vmname>" -EnhancedSessionTransportType VMBus

Now boot up the VM and edit the file /etc/selinux/config, and change SELINUX=enforcing to SELINUX=permissive.

After this, shut down the VM and in an elevated PowerShell enable Enhanced Session again:

Set-VM -VMName "<vmname>" -EnhancedSessionTransportType HvSocket

After this you can boot up your VM with Fedora, using ESM!

My only issue right now is that everything that might require elevation in Fedora prompts for me to enter my password, such as powering off the VM. Minor, but something that isn't the case with the default Ubuntu setup from Microsoft.

secana commented 5 years ago

Hi @w0ndersp00n. Thx for the information. I updated the scripts to use your line instead.