0

Here's the summary of my fight to connect to a port on the hypervisor host from a VM hosted on the same machine:

  • Set up in the Hyper-V Manager:

    • Virtual Switch Settings
    • Internal
    • 'Enable virtual LAN identification for management operating system'
    • VLAN number 2
  • Set up the Virtual Machine (client-01)

    • Network Adapter Settings
    • 'Enable virtual LAN identification'
    • VLAN number 2
  • Configured IP4 on adapter of host desktop01 (host): 192.168.5.1 255.255.255.0

  • Configured IP4 on adapter of host client-01 (vm): 192.168.5.10 255.255.255.0

  • The client can successfully navigate to 'http://desktop01' port 80 running on the host (there's a small website running on the host)

  • Ping 192.168.5.1 from client is OK

  • Ping 192.168.5.10 from host is OK

  • Added 10000 as OK for incoming in Windows Firewall on host

  • Opened a listener on 10000 on the host, but on the client:

PS C:\Users\user-01> test-netconnection -ComputerName 192.168.5.1 -Port 10000
WARNING: TCP connect to 192.168.5.1:10000 failed

ComputerName           : 192.168.5.1
RemoteAddress          : 192.168.5.1
RemotePort             : 10000
InterfaceAlias         : Ethernet
SourceAddress          : 192.168.5.10
PingSucceeded          : True
PingReplyDetails (RTT) : 0 ms
TcpTestSucceeded       : False

The listener is a C# programme I wrote. You may suspect an issue with it, but PowerShell has no problem establishing a connection to it from the same machine. So.. it smells like a firewall thing, but I already made an entry there and there's nothing in the log file. What gives?

1
  • I turned the firewall off completely and the issue persists. So weird.
    – Andy
    Commented Apr 24, 2021 at 9:27

1 Answer 1

0

I dropped back to the 'Default Switch' instead of 'VLAN Number 2' and now everything is working perfectly. So - the lesson is to use the default switch.

2
  • The Hyper-V switches behave very unpredictable, I also almost always use the Default one, only when I want the whole traffic to go through a virtualised router I use a nonstandard switch. But as far as I know there is no real disadvantage of using the default one, it just works... Commented Apr 24, 2021 at 12:42
  • Thanks mate for your ideas. I added it originally because I thought it had to be on 'LAN ID management'. Great way to waste 2 hours :P
    – Andy
    Commented Apr 24, 2021 at 23:16

You must log in to answer this question.

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