# Howto use KVM if configured as *  in kernel config

## walterguo

I have compiled KVM in the kernel. And want to creat a windowxp (as a file or something else), then How to do that? Well, I won't download the latest kvm.tar.gz, just want to use the kvm coming with the kernel. Must I need to install qemu?

Thanks for any advice.

 *Quote:*   

> @localhost /usr/src/linux $ cat .config|grep KVM
> 
> CONFIG_KVM=y
> 
> CONFIG_KVM_INTEL=y
> ...

 

----------

## walterguo

Nobody knows ?

----------

## Voltago

 *walterguo wrote:*   

> Nobody knows ?

 

I guess the people at http://kvm.qumranet.com/kvmwiki know quite well.

----------

## VoVaN

 *Voltago wrote:*   

>  *walterguo wrote:*   Nobody knows ? 
> 
> I guess the people at http://kvm.qumranet.com/kvmwiki know quite well.

 

Sabayon (the distribution based on Gentoo) has an ebuild for kvm (version of qemu with kvm support), but the latest version there is kvm-28, wich wasn't working for me. I renamed ebuild to the kvm-35 (latest available on sourceforge) and got it working just fine. You can grab ebuild derectly from sabayon site, or can use Layman to create custom overlay.

```
<?xml version="1.0" ?>

<layman>

  <overlay

      type = "svn"

      src  = "http://svn.sabayonlinux.org/overlay"

      contact = ""

      status  = "official"

      name = "sabayon">

    <link>

      http://svn.sabayonlinux.org/

    </link>

    <description>

    </description>

  </overlay>

</layman>

```

I tested kvm-35 for both amd64 and i686 on Core2Duo. Kernels are vanilla 2.6.22 with a few patches not related to kvm directly. Keep as informed!

----------

## walterguo

Thinks, I will try.

----------

## saboya

I'm also messing around with KVM/QEmu, but I don't know exactly how everything works. First I used QEmu + kQEmu, but what I really wanted is to use KVM. De-installed, compiled kernel with KVM (y, not M) and was trying to figure out how to make QEmu work with KVM, and found this topic...

Used the Sabayon ebuild to grab kvm-35 (kvm-36 doesn't compile) and emerged. It always sets:

```
Target list   x86_64-softmmu
```

Even though I'm running a 32-bit Gentoo, I suppose that's because I have a C2D E6300... Anyway, made and .img, and I'm installing XP Pro 32-bit right now, seems to be working.

Now, what's the difference between KQEmu (being a kernel module) and KVM? Is it possible to use both togheter? Because in the configure (during emerge), it says:

```
kqemu support:   yes

kvm support:   yes
```

Anyone with a little bit more knowledge care to enlight me?  :Smile:  thanks

----------

## XAvAX

By "targets" it doesn't mean the host system. That "x86_64-softmmu" entry means that it will be able to support that kind of guest system.

----------

## ycUygB1

In the past, I have complained  about the difficulty of installing XEN.

I wasn't very nice.  I never did get the thing to install.

Very frustrating with a chip that supports virtualization (Core 2 Duo) and you can't

get the thing to do virtualization.

But good news!  KVM is easy to install, and Windows works well on it.   So now

you can turn your other computer off and run Windows XP on top of Gentoo.

I am running 2.6.22-gentoo-r5 with 

CONFIG_KVM=m

CONFIG_KVM_INTEL=m

modprobe kvm

modprobe kvm-intel

I was able to install gcc-3.3.6 and used it to compile kvm-35, which you

can download from the kvm website.

```
./configure --prefix=/usr/local/kvm --with-patched-kernel 

 make

 /usr/local/kvm/bin/qemu-img create -f qcow vdisk.img 10G 

 make install

 /usr/local/kvm/bin/qemu-img create -f qcow vdisk.img 10G 

 /usr/local/kvm/bin/qemu-system-x86_64 -hda vdisk.img -cdrom /home/harold/windows.iso -boot d -m 384
```

Then Windows XP installed itself.  The only issue I'm having now is that Windows hangs when you try to 

shut it down.  Not a big deal; just close the window and restart.

I want to point out that it is rare that one doesn't even need to read the documentation to figure out

how a command works.  The -hda -cdrom -boot -m options are all obvious without even needing to

read the man page.  They really thought about this.

The ACPI workaround is terrific:

http://kvm.qumranet.com/kvmwiki/Windows_ACPI_Workaround

I must say that the documentation is a model of clarity. 

http://kvm.qumranet.com/kvmwiki/HOWTO

----------

## VoVaN

2hnaparst:

Try disabling modules in the kernel konfig and compile them from kvm package as recommended at http://kvm.sourceforge.net/. In my case qemu + windows XP/2003/2008 works without any problems (kvm-44).

----------

## bosele

i'm using some kvm/qemu out of the sabayon overlay which works fine,

but i did manage to destroy my xp image with this acpi improvement:

http://kvm.qumranet.com/kvmwiki/Windows_ACPI_Workaround

i now have the blue screen that the second part of the guide talks about (should have read the whole thing first, i know)

the fix described will not work for me since running qemu with no-kvm produces a nice segfault.

any advice on how to recover from this problem short of a new xp install?

----------

## mrbig4545

I know its not kvm, but i use virtual box and it work great, *REALLY*  fast, and has seamless windows, plus its in portage, theres a good how to here: http://gentoo-wiki.com/HOWTO:_VirtualBox

----------

