Change nic name when importing Ubuntu vm from VMware
-
I noticed that when I import a vm from VMware running Ubuntu 22.04, I have to change the name of the nic from
ens33
to
eth0
If I don't do this, XO reports
no IPV4 record found
Although easy to do, it is a painful process if you have a large number of vm's to import.
Is there a way around this renaming step when import vm's?
-
@johandr said in Change nic name when importing Ubuntu vm from VMware:
I noticed that when I import a vm from VMware running Ubuntu 22.04, I have to change the name of the nic from
ens33
to
eth0
If I don't do this, XO reports
no IPV4 record found
Although easy to do, it is a painful process if you have a large number of vm's to import.
Is there a way around this renaming step when import vm's?
How are you importing the VM?
-
I use the Import from VMware option in XO to connect to VMware host to import
This is what the Netplan config file looks like before change:
-
@johandr yeah I'm not sure if the configuration within the VM matters for the device name, as it's getting passed the hardware from XCP-ng.
Are you trying to import a powered on or off VM from ESXi? I'll test here to check.
also are you using XOA or the source edition and are you updated to the latest version?
-
I have tried XOA and the latest community edition (build it today).
I imported the the vm's powered on and when switched off.
Once in XO, I install guest-tools and change the nic name. I tried installing guest-tools and rebooting the vm, but there is still no IP record. I have to change the name before it works.
I first suspected that it was just an XO problem not reporting the IP record with the old ens33 name, but you also can't ping the vm, so it definitely does not have a valid ip.
-
@johandr Dumb question, but is the network attached to the same VLAN from XCP-ng and ESXi?
IE: Can your VM actually pull DHCP if it were built brand new on XCP-ng using the same network adapter?
-
Let me try that ...
-
I built a new vm from the Ubuntu 22.04.4 template and it picked up an ip address from the DHCP server after boot.
Interesting though, the name of the nic in the Netplan config file is now
eth0
I noticed that VMware use a virtual nic named
VMXNET 3
Maybe Ubuntu then maps that virtual nic to the ens33 nic name
I see this issue was identified previously: https://xcp-ng.org/forum/post/68891