Share via

Hyper-V VM's have no internet connection with default switch

Anonymous
2023-07-09T23:05:25+00:00

Hello,

I frequently make VM's with hyper-v either to test things, or just for convenience's sake. (usually with windows on them as well).

But recently, any VM's I make (or have previously made) can't connect to the internet at all. I usually just use the "default switch", but that doesn't work anymore. (I do notice that windows sandbox does still have a connection somehow, so I'm not sure what's different about it).

I've heard one solution was the make an external switch, however I could never make one, and I later read that it doesn't work with wifi adapters (which is what I'm using).

I did notice that the issue started around the time I switched internet providers (I switched from Spectrum to T-Mobile), so that could potentially be the problem, but I'm not sure what "fixing it" would entail.

Within the VM's themselves, if I use the network troubleshooter, it says that "'Ethernet' doesn't have a valid IP configuration", and "The default gateway is not available". It wasn't able to fix those itself, but I'm also not sure what exactly they mean either.

If anyone has any solutions, I would be glad to hear.

Thanks.

Windows for home | Windows 10 | Internet and connectivity

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

14 answers

Sort by: Most helpful
  1. Anonymous
    2024-01-18T10:44:51+00:00

    On the right side of Hyper-V manager, click on Virtual Switch Manager.

    Ensure the "External" switch type is selected in the box to the right.

    Click the [Create Virtual Switch] button.

    Ensure the newly created Virtual Switch is selected from the list on the left.

    Choose a Connection type from the drop down list on the right.

    Click the [Apply] button.

    A warning will be displayed (Pending changes may disrupt connectivity).

    Click [Yes].

    All being well, some VMs detect the change when spun up, or in the VM's, settings add the new Network Adapter.

    HTH

    10+ people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-01-18T10:24:46+00:00

    Creating an external switch to Wi-Fi can be dangerous. I did it on my home desktop and not only did my host lose internet but the D: drive disappeared, requiring a re-boot to get the internet back and second re-boot to get the D: drive back. Good times.

    I also did this on work laptop, a Dell XPS 16 (with a Killer (R) WiFi 6 AX 160MHz Wireless Adapter (201D2W)), and it worked (after a fashion, see below).

    A VM can have multiple switches, the default and a second external. Which gave me internet access. Very poor, intermittent, unreliable, not really useful access.

    You really have to admire Microsoft's professionalism and attention to detail. You'd think something that severely limits the utility of Hyper-V would be important enough to ensure it actually worked.

    The lack of useful guides, tutorials or documentation is equally baffling.

    10+ people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2024-01-18T10:43:52+00:00

    I actually fixed this in the end. The main solution was to add google dns servers, 8.8.8.8 and 8.8.4.4

    How I set it up was I had a physical (internet facing) ip address. I didn't want the VMs on this so I created a new Internal network.

    Then I went into the VM's and set the guest IP's up the same as the host IP's. But adding the dns servers is what gave me internet access.

    10 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2024-02-09T08:57:36+00:00

    Hi,

    I had the same issues. I finally found a "fix" that works for me. I have created at Powershell script that disables my network adapters and enables them again. This seems to trigger the VM in hyper-v to get an IP an thus Internet access again. This works for both wired and wireless connections.

    Disable-NetAdapter -Name "Ethernet" -Confirm:$false

    Enable-NetAdapter -Name "Ethernet" -Confirm:$false

    Invoke-Expression "netsh int set int 'Ethernet 2' enable"

    Ethernet being my physical adapter

    Ethernet 2 being my "PANGP Virtual Ethernet Adapter Secure"

    Hope this works for you all.

    BR,

    Andreas

    8 people found this answer helpful.
    0 comments No comments
  5. Anonymous
    2024-10-18T06:04:08+00:00

    why would you even waste your time writing that reply? That's the first thing everyone did, and it didn't work. That's why they are posting here. Why didn't you realize that a comment like that would be completely meaningless?

    6 people found this answer helpful.
    0 comments No comments