Michael Hill
mdhillca@gmail.com 2018
Write the configuration of a box to a file to back it up or move it.
Fran Dieguez
frandieguez@gnome.org 2018-2020.

# 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.

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

Copy the .xml file you just created to your backup or temporary storage location.

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.

Exit Boxes.

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

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.

Launch Boxes.