To have network connectivity between Hyper-v host and guest, do the following steps:
- In Hyper-v Manager, click on Virtual Switch Manager, and create a new (if not already) Internal virtual switch. Enable VLAN ID.
- In the VM guest setting, configure a Network Adapter to use this Internal virtual switch.
- In host computer, in Control Panel, configure IPV4 address for the Internal netowrk created above step 1. No default gateway setting required.
- In VM guest setting, on the Network Adapter setup in above step 2, configure IPV4 address in the same range as in step 3 and using IP address in step 3 as the default gateway.
Now you have network connection between host computer and the guest VM. And no need to edit host file.
(Update:) The simple way now is to default Network Adapter to be in the same IP range as the vEthernet (Default Switch) on the hosting, and set the hosting IP address as the default gateway. You won’t have to create the above second virtual switch.
To enable HyperV connect to Internet, create an External Virtual switch on the HyperV host and bind to the physical NIC (or your WiFi NIC). Add a netowrk adapter to the VM to use this External Virtual switch.
FEATURED TAGS
ai
api
automation
azure
azure cosmos db
azure openai
azure vm
base64
dax
docker
excel
execution plan
hyper-v
infrastructure
m
machine learning
machine learning services
network
network card
performance
power automate
power bi
power bi report tricks
power query
powershell
python
qgis
query performance
regex
replication
snowflake
sql
sql script
sql server
sql server admin
sql server config
ssl
ssms
troubleshooting
unicode
vmware