How do I connect to Hyper

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

How do I connect to Hyper

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

How do I connect to Hyper

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.

How do I connect to Hyper

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

How do I connect to Hyper

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.

In Hyper-v you can connect Hyper-v machines to Internet with two methods that I’m going to explain all step by step. This article is for those, who know the basic of Server Virtualization with Hyper-v. If you don’t know about Hyper-v Virtualization software, I recommend you to read the previews articles of Hyper-V installation and configuration posts.

  • Install Hyper-V: Hyper-v Beginner: A Practical Guide to Virtualization. This post shows you how to install Hyper-v on Windows client 8.1, 10 and Windows Server 2012 and Windows Server 2016.
  • Configure the necessary Hyper-V settings: Essential Hyper-V Configuration. Explain the configuration of Hyper-v for beginner to create a virtualization testing Lab.

Hyper-v Virtual Switches

The virtual switch is a logical switch which connects virtual machines. Currently, Hyper-v has three different types of virtual switch which I told the preview article also.

  • External: Switch is used to connect the virtual machines to external network and Internet. The virtual machines (Guest) and Host will be on the same network.
  • Internal: Switch is used to create network connection between guest machines and the host.
  • Private: The private switch is used to create network connection between virtual machines only.

Connect Hyper-v Machines to Internet Using External vSwitch

1. Create an external virtual switch in Hyper-v and then link it to the physical host network card. To create a virtual switch, open Hyper-v Manager then clicks Action and click Virtual Switches Manager.

How do I connect to Hyper
Create Hyper-v External Virtual Switch – Technig

2. From Virtual Switch Manager, select External virtual switch and click Create Virtual Switch.

How do I connect to Hyper
How to Connect Hyper-v Machines to Internet in Windows 10  – External NIC

3. Type a name for this virtual switch and select the exact physical network card which currently connects your host to the internet then click OK to apply the changes.

4. Now, to connect a virtual machine to the internet just select this external virtual switch as network adapter of the virtual machine.  Let’s test it on a Windows 10 Pro.

How do I connect to Hyper
Connect Hyper-v Machines to Internet in Windows 10

5. Run a virtual machine then click File and click Settings then select Network Adapter from Virtual Machine Settings. From right side select the external virtual switch as the virtual switch to connect hyper-v machines to internet.

How do I connect to Hyper
Connect Windows 10 Virtual Machines to Internet – Technig

The virtual machine is successfully connected to the internet through the external virtual switch.

The second method is using Internet Connection Sharing (ICS). ICS is another best practice to connect Hyper-v Machines to the internet. But in this method, you must share the original internet connection for virtual machines. So with ICS, you can connect your all private network machines to the internet. Let’s do it.

How do I connect to Hyper
Configure Hyper-v Internal Virtual Switch in Windows 10 – Technig

The process is the same as creating an external virtual switch. Open the Virtual Switch Manager and create a new one. Only select Internal instead of external the click OK to create the Internal virtual switch.

Enable ICS to Host Machine

1. Type “ncpa.cpl” to Windows Run and press enter to go to network connections of your host machine. Then right-click the Ethernet connection which is connected to the internet then click Properties.

How do I connect to Hyper
Configure Hyper-v Internet Connection Sharing – Technig

2. On the Ethernet Properties page click Sharing tab then tick the checkbox of Allow other network users to connect through this computer’s internet connection then click OK to apply the changes.

3. Now for your virtual machines, you should choose Internal vSwitch as a virtual switch to connect them to the internet.

How do I connect to Hyper
How to Configure Internet Connection Sharing on Windows 10 – Technig

Yes, it works fine.

In the environment where your internet connection is a Wi-Fi connection, you can use the second method ICS to connect Hyper-v machines to the internet.

Connect Hyper-V Virtual Machine to Internet – Video

OK, that’s all. Hope you enjoy this Virtualization related article to Hyper-v beginner guide.  If you have any questions, please ask us in the comment box. We will help you fix the problems fast and easy.