Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How To Migrate Virtualbox VMs Into KVM VMs In Linux - DesignLinux

Jan 04 2021
designlinux 0 Comments

Are you considering making a switch from VirtualBox to KVM hypervisor? One of your greatest concerns would be starting all over again by creating new virtual machines in KVM – an arduous task to say the least.

The good news is that instead of creating new KVM guest machines, you can easily migrate the VirtualBox VMs which are in VDI format to qcow2 which is the disk image format for KVM.

In this guide, we are going to outline a step-by-step procedure of how you migrate VirtualBox VMs into KVM VMs in Linux.

Step 1: List Existing VirtualBox Images

First and foremost, ensure that all the virtual machines are powered off. Virtualbox guest machines exist in VDI disk format. Next, proceed and list the existing VirtualBox virtual machines as shown.

$ VBoxManage list hdds
OR
$ vboxmanage list hdds

From the output, you can see that I have 2 Virtual Disk Images – Debian and Fedora VDI images.

List Virtualbox Images in Commandline
List Virtualbox Images in Commandline

Step 2: Convert VDI Image to RAW Disk Format

The next step is to convert the VDI images into a RAW disk format. To achieve this, I’m going to run the commands below.

$ VBoxManage clonehd --format RAW /home/james/VirtualBox\ VMs/debian/debian.vdi debian_10_Server.img
OR
$ vboxmanage clonehd --format RAW /home/james/VirtualBox\ VMs/debian/debian.vdi debian_10_Server.img
Convert VDI Image to RAW Disk Format
Convert VDI Image to RAW Disk Format

When you investigate, you will notice that the RAW image format takes up an enormous amount of disk space. You can use the du command as shown to verify the size of the RAW image.

$ du -h debian_10_Server.img

In my case, the Debian RAW image takes up 21G of hard disk space, which is quite some enormous space. We are later going to convert the RAW disk image to KVM disk format.

Check RAW Image Disk Space
Check RAW Image Disk Space

Step 3: Convert RAW Image Disk Format to KVM Format

Lastly, to migrate to KVM disk image format, convert the RAW image to qcow2 format which is the KVM disk image format.

$ qemu-img convert -f raw debian_10_Server.img -O qcow2 debian_10_Server.qcow2

The qcow2 disk image is just a minute fraction of the RAW disk image. Again, verify this using the du command as shown below.

$ du -h debian_10_Server.qcow2
Check Disk Space of qcow2 Image
Check Disk Space of qcow2 Image

From here, you can import the qcow2 KVM image format either on command-line or using the KVM graphical window and create a new KVM virtual machine.

This wraps up our article for today. Your thoughts and feedback are much welcome.

Related

Tags: KVM Tips, Oracle Virtualbox

How to Install PHP 8 on Debian 10

Prev Post

Bash: Write to File

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 467
  • 493,603

DesignLinux.com © All rights reserved

Go to mobile version