I’m wondering if it is possible to connect to a HyperV Guest from the Host. The guest is a Linux machine and the Host is a Win 10 Pro.
Specifically, I cannot
ssh to the Linux Guest from the Host. I can
ssh locally from the Guest to itself, so I know that the
ssh server is correctly setup on the Guest. There are a few other servers I have setup on the Guest, but I cannot access any of them from the Host, but only locally from the Guest. (I have also tied these other servers to 0.0.0.0)
All Firewalls on the Host have been turned off, so this is not an issue. (Does Linux esp. Ubuntu have a Firewall by default. I don’t recall setting anything up.) On the Guest, I can access the internet. I can also ping the Guest from the Host. Other than that nothing else works i.e. no
ssh 192.168.0.5 ssh: connect to host 192.168.0.5 port 22: Connection refused telnet 192.168.0.5 22 Connecting To 192.168.0.5...Could not open connection to the host, on port 22: Connect failed
For the Guest, I have setup a Virtual Switch exactly as it is mentioned in Create a virtual switch by using Hyper-V Manager i.e. the top half that that page. The settings on the virtual switch look like:
The settings on the network adapter on the Guest look like:
I have not set the VLAN ID anywhere. I have installed XRDP on the Linux Guest and can connect to it via RDP without any issues. Other than these things I don't think I have anything unusual i.e. I have chosen the default setup for everything i.e. Host OS, Guest OS etc.
Since, I could not connect from the host, I solved this by adding a Network Adapter on the VM and connected it to the Default Switch as mentioned in What’s new in Hyper-V for Windows 10 Fall Creators Update? - Default Switch So now I have two Network Adapters on the VM, and connections from the Host to the VM go through this switch. I'm not sure if this is the best solution, but at least it works.