Is it normal for KVM/Qemu to be this slow?

Red Squirrel

No Lifer
May 24, 2003
69,299
13,040
126
www.anyf.ca
I am currently looking at possible solutions to replace VirtualBox and have a new server on the way. Meanwhile I'm playing around on my production server with host based stuff that does not require to actually install a hypervisor. Playing with KVM/Qemu/libvirt (I'm still confused about which is which, or if they're the same thing) and one thing I noticed is that it is BLOODY SLOW. For example, it takes about 30 minutes to boot off a live CD. Everything is just so slow. It's like if it's self limiting it's internal disk I/O to like 100 bytes per second or something. Once an OS is actually loaded, stuff like moving the cursor is fine, but disk access is brutal. I know as a fact it's not Disk I/O since at one point I had 7+ VMs running on this server and now I have none since I had to disable virtualbox in order to play with this so the raid arrays are all idle.

Is there any kind of optimizations or something I have to do? This is an older machine, but it's not a 486 either.

Chances are I will probably end up going with proxmox though but I can only try this once I get the new server so I want to see if I can get KVM to work as I like the fact that it's standard with Linux and uses raw disks that I can actually mount as a loop device or w/e if I want to. I think proxmox uses KVM too though.

I just fired up a VM that eventually got Xubuntu installed on it (had to leave it overnight, took like 8 hours) and it's been "booting from harddisk" for over half an hour now.
 

theevilsharpie

Platinum Member
Nov 2, 2009
2,322
14
81
You're probably not using KVM, so QEMU is falling back to software emulation, which is dog slow.

I've also seen this if you grossly overcommit the VM's memory, but you'd see a lot of disk activity in that case.
 

Red Squirrel

No Lifer
May 24, 2003
69,299
13,040
126
www.anyf.ca
That's probably the case. Is there a way to make sure I'm using KVM?



I read about adding a flag, but where do I add that flag? Qemu "just works", I don't have to launch anything or do anything, I just open virt-manager, and it's there. There's a libvirtd service that is running so I'm guessing it's that.
 

Red Squirrel

No Lifer
May 24, 2003
69,299
13,040
126
www.anyf.ca
Yep KVM is enabled. When I create a VM do I choose KVM or Qemu?

Either way it seems really flaky. For a while it was running fast but then slowed down again. Sometimes I install an OS but yet it wont boot off it either. Think I'll wait till I get my new server to install a new OS as this is FC9 and the version of KVM/Qemu/libvirt or w/e is super old.
 

Red Squirrel

No Lifer
May 24, 2003
69,299
13,040
126
www.anyf.ca
Yeah think I will end up going with Proxmox anyway for the nicer front end. I'm trying to make software work on an ancient version, so probably why I'm have lot of issues. I'll wait till my new server comes in and just go straight to proxmox I think. I don't have any other machine that has VT to test stuff with other than my production server, which I don't want to take offline.

Though I read somewhere that they're no longer offering stable releases for free, so that seems kind of iffy if it's true. I hope they don't decide to just outright start charging.
 

theevilsharpie

Platinum Member
Nov 2, 2009
2,322
14
81
Either way it seems really flaky. For a while it was running fast but then slowed down again.

KVM is the fastest hypervisor I've used to date, and it's rock solid. If KVM is truly as slow on your PC as your described in your OP, either you're doing something horribly wrong, or you have the world's shittiest hardware.

I'm not sure what you're doing with your VMs, but 512MB may be low and causing the guest VMs to page. If the host has sufficient memory, try bumping the VMs up to 1GB each and see if things improve.

Playing with KVM/Qemu/libvirt (I'm still confused about which is which, or if they're the same thing)...

Qemu is Linux's virtualization "engine". It defines the virtual hardware and handles the interaction with the virtual machine.

Libvirt is a library for Linux that provides an abstracted interface for the management of virtual hosts. It supports many virtualization engines (including Xen and Qemu), and many Linux virtualization front-ends tie into it (virsh and Virtual Machine Manager being two of note, with Proxmox being a notable exception).

KVM is a kernel module that Qemu can use to accelerate virtualization with hardware virtualization extensions such as Intel VT or AMD-V. KVM and Qemu are technically different things, but most people mean the Qemu/KVM combo when they refer to KVM by itself.
 

Red Squirrel

No Lifer
May 24, 2003
69,299
13,040
126
www.anyf.ca
What could I be doing wrong? I just open virt-manager, right click, new, and start making a VM. There's not really much that could be done wrong. Though should I be choose Qemu or KVM as the hypervisor? I'm guessing KVM.

Could it be that it's just because my version is really old? I'm hoping that's all it is. I'll find out when my new server comes in so I can install a newer OS. I'm currently on Fedora Core 9. 512MB should be enough ram just to load the installer of an OS so I don't think that is the issue.
 

theevilsharpie

Platinum Member
Nov 2, 2009
2,322
14
81
Fedora Core 9 is very old, and KVM wasn't nearly as mature back then as it is now.

I'm not sure what the purpose of using such an old OS is, but if you're married to it, you may want to use Xen or Virtualbox instead of KVM.
 

Red Squirrel

No Lifer
May 24, 2003
69,299
13,040
126
www.anyf.ca
Fedora Core 9 is very old, and KVM wasn't nearly as mature back then as it is now.

I'm not sure what the purpose of using such an old OS is, but if you're married to it, you may want to use Xen or Virtualbox instead of KVM.

I'm just stuck using it till I get my new server, then I will use whatever is newest. Then I'll be able to migrate stuff over properly. Problem is, it's currently not a hypervisor setup, the host itself handles lot of production stuff like my email so I can't do anything till I can migrate it over. I will probably end up virtualizing that server or just reconfiguring it all from scratch on a new OS in a VM. That server setup has been used since before I even considered virtualization and could use a big cleanup anyway. I use it for development too, that should probably be done on a separate VM. Will be nice to reorganize everything once I have a good solution going.

According to Qemu's site it's at version 2.0.0 and mine is at 0.9.1 (lol) so hopefully that's the reason for my issues. Not sure how to check KVM's version but I imagine it's equaly as old.

I'll just have to wait till my new server comes in. Most of the parts got back ordered though so it could be a while.