I have an Ubuntu 12.04 Server that hosts several virtual machines. I want to make backups of these VM's using the snapshot mechanism.
The purpose of these snapshots is to have a backup on an external device. I am currently trying to simply create the backup in /var/tmp.
When I type
sudo virsh snapshot-create-as test-vm --memspec /var/tmp/test-vm-snapshot
I get the message
error: internal error: unable to execute QEMU command 'transaction': Could not open '/var/lib/libvirt/images/test-vm.img': Permission denied
I tried to solve this by temporarily giving read/write permissions (chmod og+rw) but then I get the same message.
I read that this is due to AppArmor, and this seems to be confirmed by the syslog. However, if I temporarily stop AppArmor, I still get the same error message, and the same entries in the syslog.
How can I create an internal backup of a VM to a specific file?