How to fix, ubuntu not getting ip address on hyper-v?

Solution 1:

Ubuntu now uses netplan for network config. There's an article that looks helpful here: https://linuxconfig.org/netplan-network-configuration-tutorial-for-beginners

But a relevant snippet that might need to go in /etc/netplan/01-netcfg.yaml or similar:

network:
    version: 2
    renderer: NetworkManager
    ethernets:
        eth0:
            dhcp4: true

...then run sudo netplan apply.

Additional info here: https://www.server-world.info/en/note?os=Ubuntu_21.04&p=dhcp&f=2