setup
apt-get install qemu-kvm libvirt-clients libvirt-daemon-system virt-manager
adduser ME libvirt
adduser ME libvirt-qemu
sample br0 config:
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
#make sure we don't get addresses on our raw device
iface eth0 inet manual
iface eth0 inet6 manual
#set up bridge and give it a static ip
auto br0
iface br0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
dns-nameservers 8.8.8.8
#allow autoconf for ipv6
iface br0 inet6 auto
accept_ra 1
Nameservers fix (them ugly workaround)
- add
dns=none
to/etc/NetworkManager/NetworkManager.conf
- push nameservers to /etc/resolv.conf
- reboot host
Disk size:
qemu-img resize /var/lib/libvirt/images/web.qcow2 +2G
Snapshot revert:
virsh snapshot-revert {vm_name} {snapshot_name}
https://www.linuxtechi.com/create-revert-delete-kvm-virtual-machine-snapshot-virsh-command/
start, autostart
virsh start vmName
virsh autostart vmName
https://www.cyberciti.biz/faq/rhel-centos-linux-kvm-virtualization-start-virtual-machine-guest/ https://www.cyberciti.biz/faq/how-to-rename-kvm-virtual-machine-vm-domain-with-virsh-command/
Rename:
virsh domrename {domain} {new-name}
https://www.linuxtechi.com/create-revert-delete-kvm-virtual-machine-snapshot-virsh-command/