notes on VM management + libvirt/kvm/qemu ------------------------------------------ resources: https://rabexc.org/posts/how-to-get-started-with-libvirt-on https://wiki.libvirt.org/VM_lifecycle.html networking: https://wiki.libvirt.org/VirtualNetworking.html#the-default-configuration https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/6/html/virtualization_administration_guide/sect-network_address_translation-libvirt#sect-DNS_and_DHCP-protocols-libvirt need: - dnsmasq - dmidecode - guestfs-tools ------------------------------------------ net tools - netstat (net-tools) $ netstat -nulp $ netstat -ntlp $ ip address show $ sudo iptables -nvL ------------------------------------------ virsh connect: virsh -c qemu:///system starting, resuming, restoring virsh start domain --console net (#virsh) net-list --all net-dumpxml net-undefine net-define file.xml net-start net-autostart net-destroy DHCP net-dhcp-leases storage pool-list --all vol-list snapshot snapshot-create-as --name "name" --description "desc" VM CREATION virt-install \ -n alpine-virt-volatile \ --ram 4096 \ --vcpus=4 \ --cpu=host \ -c ./images/alpine-virt-3.22.1-x86_64.iso \ --os-variant=alpinelinux3.23 \ --disk=pool=vdisk,size=10,format=qcow2 \ -w network=default \ --graphics=vnc \ --connect qemu:///system clone from existing VM: virt-clone --original [orig] --name [new] --file [path/to/vdisk/qcow2] CDROM
FUCK NETWORKING. Domains (VMs) list --all remove a domain undefine [domain] --managed-save --remove-all-storage --wipe-storage --snapshots-metadata --nvram