Commands
Shutdown VM
virsh shutdown NAMEOFVMDump config of VM
virsh dumpxml NAMEOFVM > NAMEOFVM.xmlTakes an XML configuration file (your VM definition) and registers it with libvirt. It creates the VM’s configuration in /etc/libvirt/qemu/ but doesn’t boot it.
virsh define win11.xmlThat does the same as define, but also starts the VM immediately.
virsh create win11.xmlStart up VM
virsh start NAMEOFVMEdit Live Machine
virsh edit NAMEOFVMSet VM to AutoStart
virsh autostart NAMEOFVM.xmlChange VM from NAT to Bridge
Original Settings using default NAT
<interface type='network'>
<mac address='52:54:00:1e:a9:91'/>
<source network='default'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</interface>Settings using the bridge
<interface type='bridge'>
<mac address='52:54:00:1e:a9:91'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</interface>Enable QEMU Commands on VM to set Serial Number
- Change Domain information
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>- Add the following lines right before the
<qemu:commandline>
<qemu:arg value='-smbios'/>
<qemu:arg value='type=1,serial=ABC123456789'/>
</qemu:commandline>Powershell command to ger serial number
Get-WmiObject Win32_BIOS | Select-Object SerialNumbercommand to create a unique UUID
uuidgen