Move Virtual Machine Image to Another Host Using GNOME Boxes

2 min


This guide explains the steps you need to move a Virtual Machine Image to Another Host Using GNOME Boxes.

GNOME Boxes is a virtualization utility created by the GNOME project. This utility works as a front end for libvirt. libvirt is an open-source API, daemon, and management tool for managing platform virtualization. It supports different virtualization technologies such as KVM, Xen, VMware ESXi, QEMU, etc.

If you want to create virtual machines using GNOME Boxes, refer to this guide.

In this tutorial, I will explain how you can move any Virtual Machine image file (which is already created and running using GNOME Boxes) to a different host and run it.

This way, you do not need to re-install the virtual machine from the operating system anymore. Moreover, it is portable and you can carry your virtual machine image in a USB stick.

How to Move Virtual Machine Image to Another Host Using GNOME Boxes

I hope you have already had a virtual machine created in GNOME Boxes; if not, check out this guide.

  • GNOME Boxes and libvert uses below directories for the virtual machine images and configurations. You need to take backups of each, as mentioned below, carefully.
  • GNOME Boxes keeps the virtual machine’s physical image (usually in the size of GB) in the below path. For each of your virtual machines, you will find an image there.
~/.local/share/gnome-boxes/images/

Machine Images
Machine Images
  • Copy the image file to your new host’s path: ~/.local/share/gnome-boxes/images/
  • Copy the libvirt configuration XML from the below path to your new host’s same location.
~/.config/libvirt/qemu/
Image XML
Image XML
  • In the above path, you should see separate xml files for each of your virtual machines. Copy the one you need.

  • Open the below file in your current system.
~/.config/gnome-boxes/sources/'QEMU Session'
  • Copy the section (from “[display” … to end of this section) which belongs to your virtual machine. You can easily find it using the name (see below – ‘last seen name’).
QEMU Session File
QEMU Session File
  • Open the same above file in the other host machine and append the copied content at the end. Save the file.
  • Close all applications, including GNOME Boxes, in the new host machine.

Open GNOME Boxes now, and you should see your virtual machine moved with its contents in your new host.

You can now have a portable virtual machine that can easily carry and move around. Remember, the target machine should have GNOME Boxes installed to make this work.


Arindam

Creator and author of debugpoint.com. Connect with me via Telegram, 𝕏 (Twitter), or send us an email.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

2 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments