In order to test preseeded installation, I want to create a virtual machine as close as possible to an actual server I use in production. The server has two network adapters: p1p1 and p2p1.

When creating a virtual machine with:

virt-install \
    --connect=qemu:///system \
    --network=bridge:br0 \
    --network=bridge:br0 \

the network adapters are called eth0 and eth1.

Is there a way to name them p1p1 and p2p1 before installing an OS?

  • What distro are you using? The names of the devices for network are often times controlled by dbus.
    – slm
    Jun 24 '14 at 2:21
  • @slm: virt-install is executed on Ubuntu desktop 14.04. Also, if it matters, OSes installed on the newly created virtual machine are either Debian 7.5.0 or Ubuntu server 14.04. Jun 24 '14 at 10:21

You need to define and start the networks in libvirt before.

  1. Start by creating a XML file describing your network.
  2. Enter in libvirt console, define the network using the XML file and then activate it. You also might mark as autostart.

    net-define example.xml
    net-autostart vbr0
    net-start vbr0
  3. The last step is create your VM adding the network previously added.

  • 3
    This doesn't seem to actually answer the OP's question, which seems to have been: how to rename eth0 and eth1 into p1p1 and p2p1 in the guest? Jul 10 '17 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.