0

I'm using Windows 10 Enterprise and the Hyper-V Manager.

  • I want that my virtual machine is able to see the host but not the cooperate network and internet.
  • I want to be able to connect from the host via remote desktop to the virtual machine.

How can I create a virtual switch which allows the virtual client to communicate with the host but not with the internet:

enter image description here

  • If I set the connection type to internal I'm able to do a remote desktop connection to my virtual machine. But the virtual machine sees the internet.
  • If I set the connection type to private I'm not able to do a remote desktop connection to my virtual machine.
  • If I set the connection type to external and I would have 3 Ethernet adapter in my host PC then it could work. Ethernet 1 connected to internet, Ethernet 2 (fix IP e.g.: 192.168.1.1), Ethernet 3 (chosen as external network adapter for the virtual machine fix IP e.g.: 192.168.1.2). If there is a physical connection (Ethernet cable) between adapters 2 and 3 I'm able to do a remote desktop connection from my host to the virtual machine and the virtual machine isn't connected to the internet. So exactly what I want. The problem is that I don't have 3 Ethernet adapter in my host. I'm pretty sure there is an easier way.
6
  • “But the virtual machine sees the internet.” – How did you check that? Did you perhaps accidentally bridge the virtual network connection with your physical network?
    – Daniel B
    Commented Aug 17, 2018 at 11:23
  • But the virtual machine sees the internet. Check your host OS do NOT route VM's traffic to Inet.
    – Akina
    Commented Aug 17, 2018 at 11:31
  • @Akina how can I check that?
    – Wollmich
    Commented Aug 17, 2018 at 11:32
  • @DanielB I check that by opening a browser in the virtual machine.
    – Wollmich
    Commented Aug 17, 2018 at 11:40
  • @DanielB I was using the Default Switch which use as connection type internal but it does NAT. If I create a new virtual switch with connection type internal then the vm doesn't see the internet.
    – Wollmich
    Commented Aug 17, 2018 at 11:55

1 Answer 1

0

The problem was that I used the Default Switch which uses as connection type internal. But the Default Switch does NAT. The following steps solved my problem:

  1. Create a new virtual switch with connection type internal.
  2. Assign a fix IP to the vEthernet adapter on the host (e.g.:192.168.1.1)
  3. Assign a fix IP to the Ethernet adapter in the virtual machine (e.g.:192.168.1.2)

Like that I'm able to do a remote desktop connection from my host to my virtual machine and my virtual machine isn't connected to the internet.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .