Yes, you can specify all those on the virt-install
command line. Check virt-install --network=?
for a complete list of what you can specify. These correspond to the attributes set in XML.
For instance, if your <interface>
looks like this:
<interface type='bridge'>
<mac address='52:54:00:c2:de:ce'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</interface>
You can specify it like:
virt-install ... -network bridge=br0,model=virtio,mac=52:54:00:c2:de:ce,address.type=pci,address.domain=0,address.bus=1,address.slot=0,address.function=0 ...
You can also, instead of doing an installation, use --print-xml
to get the generated XML. Then you can customize this to your liking and automate many installations directly without going through virt-install
.
--print-xml [STEP]
Print the generated XML of the guest, instead of defining it. By
default this WILL do storage creation (can be disabled with
--dry-run). This option implies --quiet.
If the VM install has multiple phases, by default this will print
all generated XML. If you want to print a particular step, use
--print-xml 2 (for the second phase XML).