Skip to content

No IP After Clone

No IP Address After Cloning

This usually happens when the original system used netplan instead of the standard network configuration.

Rebuild machine-id (crucial!)

sudo rm /etc/machine-id
sudo systemd-machine-id-setup

Chose one of the two options below

Replace netplan with standard network configuration

  1. Switch from netplan to standard DHCP:

    sudo apt remove netplan.io
    sudo apt install ifupdown
    

  2. Configure DHCP - Edit /etc/network/interfaces:

    auto lo
    iface lo inet loopback
    
    auto eth0
    iface eth0 inet dhcp
    

  3. Restart networking:

    sudo systemctl restart networking
    

  4. Reboot the VM

Alternative: Keep Using Netplan

If You Prefer Netplan

If you want to keep netplan, just rebuild machine-id and configure netplan for DHCP:

  1. Rebuild machine-id:

    sudo rm /etc/machine-id
    sudo systemd-machine-id-setup
    

  2. Configure netplan - Edit /etc/netplan/01-netcfg.yaml:

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

  3. Apply configuration:

    sudo netplan apply
    

  4. Reboot the VM