Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
What distro are you using? The names of the devices for network are often times controlled by dbus. –  slm Jun 24 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. –  MainMa Jun 24 at 10:21

1 Answer 1

up vote 1 down vote accepted

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.

    --network=<network-name>
    
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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