Ask Your Question
6

How do I move a virtual machine in gnome boxes to another host?

asked 2013-08-08 03:48:11 -0500

potato8989 gravatar image

updated 2013-08-08 05:49:23 -0500

FranciscoD_ gravatar image

I have virtual machine that I created in gnome-boxes that I would like to move to another computer. How do I do this?

edit retag flag offensive close merge delete

Comments

1

I've moved the image file from one host to another but I have not been able to get it to show up in gnome-boxes on the new host. I have even tried copying the config files from /home/<user>/.config/gnome-boxes

potato8989 gravatar imagepotato8989 ( 2013-08-08 18:41:21 -0500 )edit

5 Answers

Sort by ยป oldest newest most voted
3

answered 2014-12-09 16:49:39 -0500

maarten gravatar image

As I see it, gnome-boxes is a front-end for libvirtd.

1. First list all domains (=virtual machines)

$ virsh list --all
Id    Name                           State
----------------------------------------------------
 -     boxes-unknown                  shut off

2. Dump the xml file describing the domain

$ virsh dumpxml boxes-unknown >~/boxes-unknown.xml

3. Copy this xml file and the corresponding image file in ~/.local/share/gnome-boxes/image to your other host. It is important to put the image in exactly the same location. (Otherwise you will have to edit the xml file)

4. Import the domain using

$ virsh create boxes-unknown.xml

See the manual of virsh for more information

$ man virsh

Source: http://linux.die.net/man/1/virsh

edit flag offensive delete link more

Comments

This solution works for me, thanks !

remjg gravatar imageremjg ( 2014-12-19 17:19:59 -0500 )edit
1

If you don't have the old system running or available you can get the xml file from the old directory ~/.config/libvirt/qemu. Then follow the rest of the instructions. (worked in Fedora 22)

alfC gravatar imagealfC ( 2015-06-28 18:30:07 -0500 )edit

On Fedora 24, I encountered this error :

error: Failed to create domain from boxes-unknown.xml
error: internal error: /usr/libexec/qemu-bridge-helper --br=virbr0 --fd=24: failed to communicate with bridge helper: Transport endpoint is not connected 
stderr=failed to get mtu of bridge `virbr0': No such device

I did success restoring my virtual machine after copying the two following folders :

~/.config/libvirt/
~/.config/gnome-boxes/

Hope that helps !

remjg gravatar imageremjg ( 2016-09-15 11:52:14 -0500 )edit
2

answered 2013-08-10 17:46:38 -0500

rstrode gravatar image

i think copying ~/.local/share/gnome-boxes and ~/.config/share/gnome-boxes together should work.

Another cool related thing you can do is have gnome-boxes connect to VMs set up by virt-manager.

To do that, click the "New" button, then "Enter Url", and for the url put "qemu:///system", then all virt-manager VMs will appear in the boxes UI.

edit flag offensive delete link more

Comments

1

I can confirm that copying /.local/share/gnome-boxes and ~/.config/share/gnome-boxes from one machine to another will not show the virtualmachine in gnome-boxes

MichaelH gravatar imageMichaelH ( 2014-11-18 15:54:21 -0500 )edit

@MichaelH actually it is ~/.config/libvirt/qemu/*.xml and also virsh create boxes-file.xml

alfC gravatar imagealfC ( 2015-06-28 18:32:05 -0500 )edit
1

answered 2016-10-10 17:24:04 -0500

q2dg gravatar image

An import/export button in GUI would be fantastic!

edit flag offensive delete link more

Comments

FYI there is at least already a sketch and a bugzilla ticket for this: https://bugzilla.gnome.org/show_bug.c...https://wiki.gnome.org/Design/Apps/Bo...

rugk gravatar imagerugk ( 2017-06-07 05:48:02 -0500 )edit
0

answered 2014-12-04 17:00:43 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

There's another config file for the location of the images used by gnome-boxes:

/home/<user>/.config/libvirt/storage/gnome-boxes.xml</user>

edit flag offensive delete link more
0

answered 2013-08-08 05:59:53 -0500

FranciscoD_ gravatar image

updated 2013-08-08 06:00:18 -0500

Gnome boxes is just a front end. You can just transfer the image it created. I think the images are stored here in /home/<user>/.local/share/gnome-boxes/images

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-08-08 03:48:11 -0500

Seen: 24,348 times

Last updated: Oct 10 '16