Hyper-V Virtual Switch: VMs Unable to Obtain IP Addresses

Raikoug 0 Reputation points
2024-01-10T09:59:57.5766667+00:00

Hi,

I'm having trouble getting an IP address on my VMs. I have both a windows VM (windows 11) and a linux VM (RHEL9.2), they get the link local address (APIPA) 169.xxxx

At start I left the default virtual switch, but power the VMs during the install there is no way to get and IP.

I tried to create a new virtual switch, an internal one, assign to VM and try again. Nothing.

After changing the switch a couple of times, 30/40 minutes of tries, magically linux vm got and IP and I yum installed everything I needed, hoping any issue was solved.

Booting the host again and powering the VMs, again, no IP is released.

My system info:

  • Windows 10 Enterprise (yes, this is a Company computer, but I'm full administrator, I can do whatever I want)
  • WSL enabled (installed debian, and this WSL2 can apt update, hence, internet is working fine for it)
  • DockerHub installed and working (I can reach services on 127.0.0.1:XXXX)
  • Winget and winget UI (dunno if this can affect)
  • power toys
  • Vanilla Hyper-v, no extensions for virtual switches, just 2 VMs, now I have only default switch.

What I've done that maybe should have not be done:

  • I wanted an nginx dockerized istance to reach my services with a name instead of '127.0.0.1:8000', but this needed ports 80 and 443. Even though there was no web service enabled somehow the ports where occupied by 'System' pid 4, and I gave the command: net stop http
    This command prompted the services that it was going to stop, and I decided to disable the from the services.msc
    I really don't know if this can cause mess in the infrastructure and brake the VMs capabilities to get an IP (there must be a DHCP somewhere I'm no aware of, otherwise I really don't get how the VMs can get an IP)
    By the way, I disabled the container with nginx an enabled again the services, nothing change

The problem stand, my VMs can't get an IP address anymore. And at this point I don't know anymore if I configured a static ip on my 'Defaul Switch' virtual interface on ncpa.cpl or if it was already there.

What am I doing wrong? How to fix this blocking issue?

Thanks

Windows for business Windows Client for IT Pros Storage high availability Virtualization and Hyper-V
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-01-12T06:32:46.28+00:00

    Hi Raikoug, Hope you're doing well. This issue may caused by some reasons: Firstly, it's possible that there is an IP address conflict on your network. This can happen if two devices are assigned the same IP address. To resolve this, you can try assigning a new IP address to your VMs that has never been used before. You can also try clearing the ARP table of the LAN switch. If you're using a network environment with statically assigned IP addresses, make sure that each local host is configured with a unique IP address. Secondly, it's possible that there is an issue with the virtual network adapter driver. You can try removing and reinstalling the virtual network adapter driver to see if that resolves the issue. Lastly, it's possible that there is an issue with the virtual switch. You can try creating a new virtual switch and assigning it to your VMs to see if that resolves the issue. You can also try connecting an external switch to your VMs to see if that resolves the issue. Regarding the issue with the ports, it's possible that there is a service running on your system that is using those ports. You can try stopping the service and see if that resolves the issue. However, I would recommend being cautious when stopping services as it can cause issues with other applications or services that rely on them. If you're unsure about whether stopping a service will cause issues, it's best to leave it running. Best Regards, Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.