How to connect via RDP to my Hyper-V machine?

I am in my home network with two machines set up: A and B. Both are running Win 10 Pro and have been updated regularly (no outstanding updates as of my check today).

A is the host machine where the VM is set up and stored, B is the machine I am using to actually access the VM. Using Hyper-V Manager, it's possible for me without any issues to access the VM on A from B. Now, I want to go down the RDP route in connecting to my VM. As far as I understand, Hyper-V Manager is already using RDP to connect, it's just packaged a bit differently.

However if I try to use RDP... I am lost how to actually connect. What I have tried so far:

  • Use the PC name of my VM. RDP gives me an error telling me it can't find the machine
  • Use the IP as displayed in Hyper-V Manager in the Network section (and also the same as ipconfig returns on the VM itself). Here the result is that I am getting a can't connect error.

I did try using A to RDP to my VM via it's PC name and that works without issue. So how would I connnect to the VM from B?

2

1 Answer

I did try using A to RDP to my VM via it's PC name and that works without issue. So how would I connnect to the VM from B?

The Hyper-V Guest Machine in Machine A defaults to a NAT network, nominally 172.16.x.y. I verified this on my on Hyper-V Guest machine.

You need to change your Hyper-V Guest machine to "Bridged" Networking. Hyper-V calls it External. Same thing.

I am using a Kali Linux Guest machine. You need to set up for your Guest Machine.

Summary:

  1. Add an External Switch (Bridged Mode) to the Hyper-V Manager on Machine A.
  2. Change the network settings in the Guest to External and restart the Guest and make a note of the IP address.
  3. Add RDP Protocol (xrdp) to the Guest if necessary. Windows Guest does not need this - already there.
  4. Log out of the guest machine (but do not shut it down).
  5. From Machine B. open RDP, enter the IP of the Machine A guest, user name and connect.

It works.

1. Add an External Switch to Hyper-V

enter image description here

2. Change the Guest Settings to use the External Switch (Bridged Mode).

enter image description here

If your Guest Machine is Linux, be sure to set up xrdp

Set up xrdp on Linux

sudo apt install xrdp

sudo systemctl enable xrdp

3. On Machine B, connect by RDP. Be sure to log out of the Guest machine A. RDP will log out of a Windows Guest but does not know what to do with a Linux guest.

enter image description here

4. It all works. I am working on Machine B. Here is a screen shot of Kali on Machine A

enter image description here

I have carefully laid out all the steps so you can change Hyper-V as needed and so you can see that it all works assuming you use an External Switch (Bridged Mode). NAT will not allow you to connect.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like