[virt-tools-list] How to force em1 during virt-install?

Cole Robinson crobinso at redhat.com
Tue May 9 16:32:26 UTC 2017


On 05/05/2017 05:34 PM, William D. Colburn wrote:
> I want to use virt-install on a raw hard disk to kickstart a machine.
> It all works fine, but the intitial install has an eth0, and when I move
> the disk to physical hardware the ethernet is em1 instead.  Admittedly,
> I already have to delete the HWADDR line out of the ifcg-em1, so I could
> just rename the file too, but it would be nice if I could install with
> the right ethernet name from the start.
> 
> I'm on RHEL6.9, libvirt-0.10.2-62.el6.x86_64.  My install command is:
> 
> virt-install \
>   --network bridge:br0,mac=${MACADDR} \
>   --name ${HOSTNAME} \
>   --ram=${RAM} \
>   --vcpus=${CPUS} \
>   --graphics vnc \
>   --disk path=/dev/sdh,driver_type=raw \
>   --location=/home/os/redhat/isos/rhel6/rhel6.9/rhel-workstation-6.9-x86_64-boot.iso \
>   --extra-args="ks text"
> 
> I can't find anything I can do to set the ethernet device seen inside
> the VM.
> 

The em1 naming is set by biosdevname software inside the VM. I think it
determines the name based on some smbios data, so there might be a way to
inject that info into the VM, but another option is to disable biosdevname at
install time so the physical machine sticks with eth0. Google 'biosdevname'
and you'll find steps for disabling it

- Cole




More information about the virt-tools-list mailing list