10

I have Hyper-V installed on my Windows 10 laptop and have configured a Ubuntu VM on it. Ubuntu network adapter is connected with the external virtual switch I have created. With this configuration I would expect that the host and the guest should get different IP address from DHCP server. However they are both getting the same IP and I can't pinpoint the cause. Below are the print screens of virtual switch, network adapters on host, host network status and guest network status.

Here it's the virtual switch configuration

The network adapters on the host

Host configuration. Notice MAC and IP

Guest configuration. Notice MAC and IP

Can anyone see what's wrong in this configuration? Also, what should I change so both the host and the guest get their own IP and are presented independetly on the network?

Albert
  • 153
  • 1
  • 1
  • 7

7 Answers7

6

Some DHCP servers always assign the same IP address to the same MAC.

Since your upstream is a regular (non-WDS) Wi-Fi connection, it can only have one MAC address – not multiple. The only reason Windows even allowed you to put it into a bridge is that it performs L2 NAT (arpnat) for you, rewriting your VMs' packets on the fly.

grawity
  • 501,077
5

You can fix this, by going inside the VM settings:

Network Adapter/Advanced Feature and then

either apply a static MAC or dynamic MAC, but then you need to

Enable MAC address spoofing.

To make sure that VM will use a dedicated and spoofed MAC to act like a real network device.

Enable MAC address spoofing:

enter image description here

Visar
  • 51
0

Sharing a WiFi connection is problematic and should not be directly done.

You should create the virtual switch as Ethernet, then on the host in the Network and Sharing Center, bridge that virtual switch to the WiFi adapter.

For details, see my answer on this post.

If for some reason this does not work, you can :

  • Use cable, not WiFi, or
  • Give the VM a static IP address.
harrymc
  • 498,455
0

I had a similar problem only on a Windows 2016 server running hyper v - Unbuntu 18.04 server with a LEMP stack. I was having intermittent webserver problems at least 5 times a day and sometimes more where the server would just not respond. I noticed that in my DNS that there was two entries for the host system, one with its IP and the other with the IP for the webserver. I changed the hostname on Unbuntu server and still had the same problem. I also noticed that I was getting a 4319 error, duplicate TCP host. I finally found the following article...

https://social.technet.microsoft.com/Forums/windowsserver/en-US/9bd08920-7fa9-4aa6-915f-8e617b09fea1/duplicate-name-after-hyperv-external-lan?forum=winserverhyperv

that solved my issue. Since the server was set up to NICTeam the VM did not have a specific NIC assigned to it. When we created the virtual switch it also created a virtual switch interface on my host machine which was creating the duplicate DNS entry. The article told me to disable that entry and, walla, all problems solved!!

0

I have the same problem (Feb 2021) with a CentOS 7 installation on Hyper-V. Followed every instruction (not only from this post) but the IP address in the guest was the same as the host or no ip when configured a static one.

It was pure luck but in the end it worked and this is my configuration:

Host:

  • External switch
  • Static MAC Address
  • Everything with defaults.

Guest:

  • Static IP address BUT the important thing is, all the tutorials to set a static IP address pointed to the /etc/sysconfig/network-scripts/ifcfg* file and that never worked for me, what it did work was to use the nmtui utility. I returned all my changes to the defaults (back to dhcp) and made the configuration from the utility which is a very simple way to do the same action of setting the manual connection values.

Good luck.

elc_xx
  • 1
0

I was having this exact issue, and I found a solution that worked on my network.

My Debian 12 VM is connected to a vSwitch in Hyper-V named "Passthrough Switch" which is then connected to my Wi-Fi adapter using the "External network" option in Hyper-V's Virtual Switch Manager.

This added a Network Bridge and an adapter called "vEthernet (Passthrough Switch)" to the Windows "Network Connections" control panel.

In the "Network Connections" control panel, I opened the Network Bridge's properties and checked the "Bridge Driver" option and applied the changes.

After changing that option, I rebooted the VM. Now the router is seeing the VM's MAC address and assigned it a different IP from my Host.

I've attached images to this post to help explain the setup I have. (looks like it converted it to links since i'm a new user)

Host and VM listed on the router's DHCP log

Network Connections control panel on the host (DESKTOP-818MJ1B)

IP and MAC address of VM (pizzarolls) in Hyper-V

Markus Meyer
  • 1,910
-1

DHCP server is generally used to avoid IP conflicts in the network and in this case DHCP server has done right thing. It sees the platform while assigning IP address and in the above screenshots there are 2 platforms Ubuntu and Windows.

I can give you an example for this, if a Linux system hostname is system-1 and another system with the same name (system-1) in Windows and both are connected to same DHCP server at that time administrator has to enable "Name Protection" option in DHCP server properties to avoid NetBIOS name conflict on the network.

However, I would suggest to run commands like ipconfig /release, ipconfig /renew in Windows.