Back up or move a box

Two components are required to back up or move a box: the image file, and the configuration of the box saved as an XML file. Saving the configuration requires the virsh command from the libvirt or libvirt-client package.

  1. In a terminal window, type

    virsh dumpxml Name > Name.xml

    where Name is the Boxes name, or domain, of your box. To list the domains seen by Boxes, type

    virsh -c qemu:///session list --all
  2. Copy the .xml file you just created to your backup or temporary storage location.

  3. Copy the image file to your backup or temporary storage location. It will be a file with the domain name of your box and ending in .qcow2, located in ~/.local/share/gnome-boxes/images/.

Restore a box

The saved box can be installed into Boxes on a new host machine, or on the original machine as part of a disaster recovery scenario.

  1. Exit Boxes.

  2. Copy the .qcow2 image file from your backup or temporary storage location into the ~/.local/share/gnome-boxes/images/ directory in the new location.

  3. In a terminal window, navigate to the directory or device containing the .xml file you stored. Type

    virsh define Name.xml

    where Name is the domain of your box.

  4. Launch Boxes.