Hyper-V Ubuntu VM no longer connecting to network

Rob 0 Reputation points
2024-06-26T17:14:54.74+00:00

I've setup an Ubuntu 24.04 Server Linux VM but when I login it's unable to start systemd-networkd-wait-online.service and I'm not being assigned an IPv4 address.

I'm also unable to run sudo apt-get update so it's clear that I don't have network connectivity.

I've attached an external virtual switch with the following configuration based on another support article here:

External Virtual Switch Configuration

Note: the External Virtual Switch is attached to the VM.

And I still don't have network connectivity :(

My network for this VM was also working up until this morning.

Please advise. Thanks in advance!

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,609 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 33,071 Reputation points Microsoft Vendor
    2024-06-27T03:21:19.27+00:00

    Hi Rob,

    Hope you're doing well.

    1. Verify that the VM settings specify either "host-only networking" or "bridged/NAT mode" to allow network communication with your host machine.
    2. Unlike IPv6, IPv4 does not have auto-configuration built-in. Most of the time, DHCP is used to assign IPv4 addresses. Try running the following command in your VM terminal:

    sudo dhclient eth0

    or

    sudo dhcpcd eth0

    This should attempt to obtain an IPv4 address from the DHCP server.

    1. Restart the network services to apply any changes:

    sudo systemctl restart systemd-networkd

    sudo systemctl restart systemd-resolved

    Then check if you receive an IPv4 address.

    1. Ensure that firewall rules are not blocking network traffic.
    2. Confirm that your VM has received an IPv4 address.

    Best Regards,

    Ian Xue


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

    0 comments No comments