# kqemu / qemu / qemu-kvm

## Rhiakath

Ok, what is the difference between these options?

I installed qemu to try it out. It seems to work but is SO slow compared to virtualbox on the same machine.

So, I installed kqemu assuming it would change something. A /dev/kvm device was created. It seemed to improve a bit.

I checked qemu-kvm and it says that it is blocked by qemu and qemu-kvm. So I unemerged these, and emerged qemu-kvm.

Still, I can't get any /dev/kvm device with this.

Now. What's the difference between qemu, qemu + kqemu, and qemu-kvm ?

----------

## cach0rr0

/dev/kvm isn't created by those packages, but rather by the kvm kernel module

distinctly possible the other package is loading that module automatically

qemu-kvm is what you want

my typical invocation looks like so:

```

sudo /usr/bin/qemu-kvm -drive file=/kvm/web/apache.img,if=virtio,boot=on -net nic,model=virtio,macaddr=00:1d:92:ab:3f:77 -net tap,ifname=tap0,script=no,downscript=no -m 1024 -vnc 127.0.0.1:5 -balloon virtio

```

----------

## Rhiakath

cachorro? strange nick.

The kqemu package only provided a kernel module, so I guess that it got obsolete after the kvm support got inserted in the kernel sources?

I'm removing kvm support from my kernel, since virtualbox-bin stopped working. it immediately freezes my pc whenever i try to load a VM.

So, reemerging regular qemu, without kvm support on the kernel. to see if virtualbox gets working again, and i get mouse support in qemu again.

Then, and only then, will I try qemu-kvm. Right now, with qemu-kvm, and kvm support in the kernel, virtualbox is dead, and qemu has no mouse.

----------

## Hu

In my opinion, you should always use app-emulation/qemu-kvm over app-emulation/qemu, even if you do not use the hardware assisted virtualization provided by the KVM kernel module.  If you want to use app-emulation/kqemu, then you must use app-emulation/qemu.

----------

## Mad Merlin

qemu-kvm is a fork of qemu aimed at making qemu faster using VMX/SVM. It is enormously faster than qemu without VMX/SVM and is what you should be using. qemu-kvm is gradually being merged back into qemu.

kqemu is dead. It's a kernel module aimed at making qemu faster without using VMX or SVM. Everyone has VMX or SVM now and hence there's no interest in kqemu anymore.

qemu is the base upon which most every FOSS hypervisor is based upon (including qemu-kvm, Xen, and Virtualbox), at least for device emulation. On it's own, it is too slow to be useful for most tasks.

Neither VMX nor SVM (hardware features) can be safely used by more than one kernel module at a time, if you try it, they'll step on eachother's toes and bad things will happen. As long as you make sure that only one user of VMX/SVM is loaded into the kernel at a time (ie, KVM or Virtualbox), you should be able to switch between them as much as you'd like.

----------

## toralf

 *cach0rr0 wrote:*   

> my typical invocation looks like so:
> 
> ```
> 
> sudo /usr/bin/qemu-kvm -drive file=/kvm/web/apache.img,if=virtio,boot=on -net nic,model=virtio,macaddr=00:1d:92:ab:3f:77 -net tap,ifname=tap0,script=no,downscript=no -m 1024 -vnc 127.0.0.1:5 -balloon virtio
> ...

 stupid question (I'm a n00b wrt to kvm) : How do I specify a static IP address ?

----------

## Hu

 *toralf wrote:*   

> stupid question (I'm a n00b wrt to kvm) : How do I specify a static IP address ?

 For the host or for the guest?

----------

## toralf

For the guest. For my user mode linux image as an example I use this during start:

```
eth0=tuntap,,,192.168.0.253
```

and specify within the UML a static IP address :

```
n22 / # cat /etc/conf.d/netconfig_eth0="192.168.1.50/16"

routes_eth0="default gw 192.168.0.254" 

dns_domain_eth0="uml_domain"

dns_search_eth0="uml_domain"

dns_servers_eth0="127.0.0.1 192.168.0.254"

```

for completeness my host has these definitions :

```
tfoerste@n22 ~ $ cat /etc/conf.d/net

config_eth0="192.168.0.254/16"

```

 and the host hostname is "n22". I access the internet btw w/ DSL or WLAN.

A similar thing I'd like to do no with my first steps with KVM.

----------

## cach0rr0

the guest will have its own /etc/conf.d/net

you dont specify the IP on the qemu-kvm command-line, if that's what you're asking

you set up whichever configuration files inside the KVM guest's file system that control its various networking utilities

----------

## Rhiakath

For some reason, my system completely hangs if i start virtualbox with kvm support built in the kernel. So, I'm currently removing kvm from it. Without this option, is there any difference between qemu and qemu-kvm?

----------

## Mad Merlin

 *Rhiakath wrote:*   

> For some reason, my system completely hangs if i start virtualbox with kvm support built in the kernel. So, I'm currently removing kvm from it. Without this option, is there any difference between qemu and qemu-kvm?

 

This is to be expected. See my comment above.

Why don't you build it as a module instead? Then you can simply unload it before starting Virtualbox and visa versa.

----------

## Rhiakath

Yes, but virtualbox hangs even without qemu running. right now, its running again (without kernel kvm support)

Or must I unload the kvm module before running vbox, even if qemu is not running?

----------

## cach0rr0

 *Rhiakath wrote:*   

> 
> 
> Or must I unload the kvm module before running vbox, even if qemu is not running?

 

correct

svm/vmx can either be in use by either virtualbox, or by KVM, but not both at the same time 

when the KVM module is loaded, it is in use by KVM, so virtualbox cannot use it

you unload the module, KVM is no longer using it, and virtualbox can without issue

----------

## Rhiakath

Ok, something is wrong here.

So, I enabled kvm support as a module, in the kernel, rebuilt it, and rebooted.

First thing I do open a virtual console, do an lsmod, and check that kvm is not loaded.

Then run virtualbox-bin, and launch a machine. Instant hang.

There was nothing related to kvm running, or loaded. Haven't even tried qemu. I'm just trying to understand this virtualbox vs kernel kvm thing. And so far, kernel kvm is winning 2/0.

----------

## Rhiakath

Ok, so I removed kvm module support from the kernel. And now virtualbox is able to load a machine again. Why is this? The module was never loaded. Unless virtualbox is trying to load it?

Oh, and for some reason, before, with the kvm support in module, i loaded the module with modprobe, and no /dev/kvm node was created.

----------

