Move a VM from user to system
Page content
Migrating a VM from qemu:///session to qemu:///system
Sometimes you’ll spin up a machine in qemu:///session and later decide it should live in qemu:///system due to network limitations etc. Here’s how to do that. You can also migrate the qcow2 image if you like.
Find your VM, in this example we’re going to be working with the freenas VM.
[jsj:~/temp] $ virsh list --all Id Name State ---------------------------------- 8 win10 running - centos7_default shut off - freenas shut offDump the config
[jsj:~/temp] $ virsh dumpxml --domain freenas > freenas.xmlRemove the VM
[jsj:~/temp] $ virsh undefine --domain freenas Domain freenas has been undefinedImport the dumped machine config as root
[jsj:~/temp] $ sudo virsh define freenas.xml [sudo] password for jsj: Domain freenas defined from freenas.xmlFire it up
[jsj:~/temp] $ sudo virsh start --domain freenas [sudo] password for jsj: Domain freenas started