5

My host system is Win 11 Pro with Hyper-V enabled, also using "Enhanced session mode".

I have a few Ubuntu versions installed manually (I downloaded the ISO and ran install), but they always have issues. So this time I used Quick Create and the latest long term support version of Ubuntu (22.04). I hoped it would work better because it was curated.

And it connects just fine when I launch it from Hyper-V Manager. It uses the XRDP protocol with an Xorg session. Wow!

Now, on all my manually installed Ubuntu VMs, I have never seen that XRDP screen when launching from Hyper-V Manager. I only see it when I try to connect from Remote Desktop. So I assumed this time it's working better than usual.

But when I try to connect from Remote Desktop, I get the error "Remote Desktop can't connect to the remote computer".

I have Googled my butt off, tried lots of seemingly pointless things, and proven those things were pointless. Nothing I've tried so far has made a difference.

For the "Computer" field of Remote Desktop, I tried using the actual computer name, the IPV4 address, and the IPV6 address. Nothing worked.

But... I can ping from host to guest, and from guest to host.

XRDP is obviously installed in the guest Ubuntu system.

I have no idea what's causing it to not connect.

Bobby Cottle
  • 71
  • 1
  • 1
  • 4

3 Answers3

2

I have one computer with VMware and the other with Hyper-V. The Hyper-V system has both Ubuntu and Kali Guests and I can connect to both of them from the first computer using RDP.

XRDP is obviously installed in the guest Ubuntu system.

(1) That is good (necessary).

Make sure now that XRDP is enabled. sudo systemctl enable xrdp

Then make sure XRDP has been started. sudo systemctl start xrdp

You may wish to check the XRDP status to ensure it is running.

(2) Good idea (best) to give the Ubuntu Guest in Hyper-V an External Switch (Bridged network in most VM apps). This is so RDP on the other computer can readily find the Ubuntu Guest.

Close down the Guest, make a New External Switch in Hyper-V. Go to the Guest settings in Hyper-V and select the External Switch.

Start the Guest and make sure the External Switch is working.

(3) Restart the Guest, start the XRDP service (needs to be restarted with every Linux restart.

Now log off Linux but leave it running.

Go to your other machine and RDP in. Should work. Steps above work flawlessly for me.

2

This is what seems to be working for me...

First, I had to disable "Allow enhanced session mode" in the Hyper-V settings. That may actually be the only thing required, but the next step is kinda neat, so...

I edited /etc/xrdp/xrdp.ini to have multiple values for PORT:
port=vsock://-1:3389 tcp://:3389

This lets me connect by RDP as well as Hyper-V Manager at the same time! I think you can log in to separate accounts, but trying to have two logins to the same account will fail.

Got that suggestion from https://github.com/neutrinolabs/xrdp/issues/1260.

I'm not really happy with this workaround, but maybe that's just pessimism. If anyone has a better working suggestion I'll be happy to credit them.

Bobby Cottle
  • 71
  • 1
  • 1
  • 4
0

After (also) "... Googl[ing] my butt off..." and trying a ton of things, I found that Ubuntu 22.04 now has native support for Microsoft RDP.

All I had to do was go into the Ubuntu vm's Settings, and under Sharing turn on Remote Desktop and enable Remote Control. Ba da boom! It finally worked!

Pictures in this article: Ubuntu 22.04 Finally Supports Remote Desktop Control via MS RDP Protocol | UbuntuHandbook

[Now, I'm just not sure what I've broken by trying all those other things ;)]


Update: Not sure why the downvote; however... upon creating a new VM and following just these steps, this didn't work - so one of the many other things I tried might've solved it. I have some thoughts, so I'll update this answer once I've found the "key"... (or delete it if I don't find the key shortly)

leanne
  • 631