I thought I understood KVM/QEMU pretty well but then I tried following the instructions on this page: https://docs.cumulusnetworks.com/cumulus-vx/Getting-Started/Libvirt-and-KVM-QEMU/

Took me a while to figure out I needed to substitute the kvm command with qemu-system-x86_64 on a CentOS host.

Now I'm wondering why I need to run the below syntax every time I want to start the VM.

qemu-system-x86_64  -enable-kvm    \
                    -curses           \
                    -name leaf0         \
                    -pidfile leaf0.pid    \
                    -smp 1             \
                    -m 256             \
                    -net nic,vlan=10,macaddr=00:01:00:00:01:00,model=virtio \
                    -net user,vlan=10,net=,hostfwd=tcp::1401-:22 \
                    -netdev socket,udp=,localaddr=,id=dev0 \
                    -device virtio-net-pci,mac=00:02:00:00:00:01,addr=6.0,multifunction=on,netdev=dev0,id=swp1 \
                    -netdev socket,udp=,localaddr=,id=dev1 \
                    -device virtio-net-pci,mac=00:02:00:00:00:02,addr=6.1,multifunction=off,netdev=dev1,id=swp2 \
                    -netdev socket,udp=,localaddr=,id=dev2 \
                    -device virtio-net-pci,mac=00:02:00:00:00:09,addr=6.2,multifunction=off,netdev=dev2,id=swp3 /home/libvirt/images/leaf0.qcow2

I expected that when I shut down the VM it would be defined, but virsh cannot see it even when it's running. (virsh list --all) fails to find it too.

Is there some way of dumping a xml file for this VM so I can define it?



The tutorial you linked to provides directions to install libvirtd, but then it never actually uses it anywhere. Instead it advises creating VMs manually, which is completely insane, not least because their configuration isn't saved anywhere.

Use libvirt-aware tools such as the virt-manager GUI or virt-install to create virtual machines with libvirt.

  • Yes, the doc is completely insane. I agree. – mr.zog Aug 11 '19 at 16:28
  • 1
    Try the official Red Hat docs instead. You may spend a few extra minutes reading, but it will eliminate hours of frustration. – Michael Hampton Aug 11 '19 at 16:30

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.