3

I have an image with a debian-squeeze installation and using that I created two overlay-images to boot two (nearly identical) virtual machines from.

When I boot them up individually (connecting them to a vde-switch and specifying the mac-adress in the qemu/kvm command-line) everything works as I would expect.

However when I run them simultaniously something odd is happening:

The first machine to boot works as expected and creates a "eth0"-interface, but the second machine does not create "eth0" but "eth1" instead.

Can someone please explain this behaviour?

What would be the best way to ensure that in all vms the virtual network interface has the same name?

Many thanks!

3 Answers 3

1

Most Linux systems use udev to tie an interface name to a specific MAC addresses (so that machines with multiple NICs have the interfaces consistently named across boots). This however causes this problem when the MAC address does change (like when booting in a VM with a different MAC address set) but you don't want a new interface name assigned. To clear these mappings, delete the appropriate file in /etc/udev/rules.d/ (usually named 70-persistent-net.rules) and reboot. In your case you want to do this while creating the master image.

0

Are they starting on the same machine? How are they communicating to the outside world? Are u using any bridge interface like br0 on the host machine? Can you paste the qemu command that u sed to start both vms.

0

If your guest is Debian 10, you can easily rename the interface in /etc/network/interfaces:

rename enp1s0=mynw0
auto mynw0
iface mynw0 inet dhcp

Next activate it:

ifup mynw0

You can use every name you like.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .