From Segfault
Jump to: navigation, search



sudo apt-get install qemu-kvm libvirt-bin
sudo usermod -a -G kvm,libvirt alice


  • Debian #747568 - Unknown lvalue 'ControlGroup' in section 'Service'
  • Debian #758688 - Unit virtlockd.service cannot be reloaded because it is inactive
$ sudo deb-systemd-invoke start virtlockd.socket virtlockd.service


sudo dnf install virt-manager qemu-kvm libvirt        # Fedora, RHEL Note: libvirt seems to be optional


For already existing VMs or disk images, grant access to everyone in the libvirt group:

sudo find /opt/vm/ -type d -exec setfacl -m u:libvirt-qemu:rwx -m g:libvirt:rwx '{}' +
sudo find /opt/vm/ -type f -exec setfacl -m u:libvirt-qemu:rw  -m g:libvirt:rw  '{}' +


We may want to edit our network[1] settings:

$ sudo virsh net-edit default
 <ip address='' netmask=''>
     <range start='' end=''/>

$ sudo systemctl restart libvirtd.service                 # Fedora

After KVM has been installed, let's setup a Debian virtual machine:

virt-install --virt-type kvm --hvm --vnc --connect qemu:///system --network network:default --name debian0 \
       --vcpus=2 --ram=1024 --file=/opt/vm/kvm/debian0_disk0.img --file-size=2 \

As Fedora comes with SELinux enabled, we may have to grant extra permissions[2][3] to the locations above:

sudo setsebool -P virt_use_nfs 1
sudo chcon -R --type=virt_image_t /opt/vm/kvm
sudo setfacl -m u:$USER:rwx /opt/vm/kvm


The newly installed virtual machine can be controlled with virsh[4].

List virtual machines:

$ sudo virsh list 
Id    Name                           State
2     debian0                        running

Connect the virtual machine's serial console:

$ sudo virsh console debian0                      # The guest needs to enable its Serial Console
Connected to domain debian0
Escape character is ^]

Shutdown/reboot/start a virtual machine:

sudo virsh shutdown debian0
sudo virsh reboot debian0
sudo virsh start debian0

Core dump a virtual machine:

sudo virsh dump debian0 --file debian0.core       # May not work due to non-migratable devices


  • Redhat #678555 - systemd should not purge application created cgroups, even if they contain no processes
  • Redhat #452422 - qemu: could not open disk image
  • Redhat #527736 - Storage driver can't create storage pool volumes on a FAT32 hard disk