Hi!

I am have been running VirtualBox for my VMs on a Linux host for some time now. But when kernel 5.10 was installed there was some issue with compiling the drivers for VirtualBox. I think there is a workaround out there, but I needed to fix this asap. So I decided to migrate to kvm. And this is how I did that. I have for now Ubuntu 20.20 on my laptop also get the VMs up and running.

Goal for this
Get VirtualBox out of the box
Install qemu/kvm
Migrate my vms to qemu/kvm
Use my vms has before

We start with the short description of below events.

  1. Install KVM
  2. Convert your disk to kvm
  3. Create a new machine
  4. Start the VM
  5. Install stuff

Install KVM and other nice stuff

sudo apt install -y qemu qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager

Backup VM first

this step is not necessary, who remembers a coward?


VirtualBox needs to be installed for the conversion of disk files.

Here is a directory where a virtual machine is created with VirtualBox.

I was not able to convert directly to qcow2 format because I had multiple disk files so I needed to convert to raw format first. I did not investigate how this is possible to do, but I had enough disk space to do this i two steps.

vboxmanage clonemedium --format RAW ./Disk.vdi ./Disk.img

Delete everything, save only the img file that we converted

Change owner for the file to you user in my case roger

chown roger:roger Disk.img

Then we want to convert it to a format that KVM will understand. This can take a while but just wait. After the clone is done delete the img file.

qemu-img convert -f raw Disk.img -O qcow2 Disk.qcow2

Then we can start virt-manager to create our machine but we point out the disk that we converted above.

Assign memory as you please

Then after some reboots the VM is up and running

Uninstall any guest tools

Install new guest tools from

https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/

Install spice client to get copy / paste work between host and guest

https://www.spice-space.org/download.html

Thanx for reading this far, you are a nerd!

That was all for today! Keep hacking!

//Roger

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s