LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Building SlackBuilds KVM doesn't work, 2.6.35.4 kernel (http://www.linuxquestions.org/questions/slackware-14/building-slackbuilds-kvm-doesnt-work-2-6-35-4-kernel-835647/)

Squall90 10-01-2010 10:14 AM

Building SlackBuilds KVM doesn't work, 2.6.35.4 kernel
 
Hi,

since there was a lot of talk about virtualization I thought I try kvm -- before I used VirtualBox.
I took the SlackBuild from SlackBuilds.org and got an error with u8 as type in /usr/include/scsi/scsi.h. (sorry, I don't have the exact error message anymore..) I searched for its definition and I only found __u8 in /usr/include/linux/types.h. Then I searched the web and found a "fix" which says I have to change u8 from /usr/include/scsi/scsi.h to __u8.

Okay, this problem was solved, but when I run the SlackBuild now it stops at some point and I don't know why. These are the last few lines of output:
Quote:

CC arm-softmmu/translate.o
CC arm-softmmu/tcg/tcg.o
CC arm-softmmu/tcg/tcg-runtime.o
CC arm-softmmu/fpu/softfloat.o
CC arm-softmmu/op_helper.o
CC arm-softmmu/helper.o
CC arm-softmmu/neon_helper.o
CC arm-softmmu/iwmmxt_helper.o
CC arm-softmmu/disas.o
CC arm-softmmu/i386-dis.o
CC arm-softmmu/arm-dis.o
CC arm-softmmu/vl.o
CC arm-softmmu/monitor.o
CC arm-softmmu/gdbstub-xml.o
AR i386-softmmu/libqemu.a
LINK i386-softmmu/qemu
AR arm-softmmu/libqemu.a
LINK arm-softmmu/qemu-system-arm
root@tux:/home/christian/Downloads/kvm#
I put an echo after the make for building kvm and I put an echo after "make install". None of them are printed.

What now?


Thanks

ponce 10-01-2010 10:19 AM

kvm is a little old for your kernel, you should use qemu-kvm.

which version of slackware (and so which slackbuild) are you using?

Squall90 10-01-2010 10:26 AM

I am using Slackware 13.1 and I'm using this Slackbuild.

I thought qemu-kvm might be some fork or whatever because I read kvm is already a fork of qemu.
Then I'll try qemu-kvm. Thanks.^^

ponce 10-01-2010 10:39 AM

as you can see here, kvm is the name of the old version of the package stopped in 2009, userspace tools (the modified qemu) and the kernel modules: with 2010 (someone correct me if I'm saying bull**** :D ) they are packaging only the new stable branch named qemu-kvm containing only the userspace tools (as the kvm modules are already shipped with your distribution's kernel).

Squall90 10-01-2010 01:13 PM

Thank you, I got it now.
Quote:

christian@tux:~$ qemu --version
QEMU PC emulator version 0.12.5 (qemu-kvm-0.12.5), Copyright (c) 2003-2008 Fabrice Bellard
But it is still very slow. I think I'll read some tutorials about kvm and if it won't be faster I'll change back to VirtualBox or VMware.

Chuck56 10-01-2010 02:25 PM

Quote:

Originally Posted by Squall90 (Post 4115027)
Thank you, I got it now.

But it is still very slow. I think I'll read some tutorials about kvm and if it won't be faster I'll change back to VirtualBox or VMware.

Did you load the kvm modules first:

Code:

modprobe kvm-intel

- or -

modprobe kvm-amd

If either of those don't load then either your CPU doesn't support virtualization or your motherboard BIOS doesn't support virtualization. A BIOS upgrade is sometimes needed to gain access to the virtualization of the motherboad depending on how old it is.

Squall90 10-01-2010 03:18 PM

Yep, I loaded the kvm-amd module. lsmod verified it.

About the BIOS update: I'd never update a BIOS if it's not absolutely necessary. If it doesn't work due to my BIOS version I'd rather take another virtualization program.

maxmiorim 10-01-2010 03:43 PM

Quote:

Originally Posted by Squall90 (Post 4115122)
Yep, I loaded the kvm-amd module. lsmod verified it.

About the BIOS update: I'd never update a BIOS if it's not absolutely necessary. If it doesn't work due to my BIOS version I'd rather take another virtualization program.

AFAIK, you won't get hardware virtualization from other programs if this isn't enabled by your BIOS.

Also, unless i missed something, if you have the hardware virtualization extension enabled you should see a svm (for AMD) or vmx (for Intel) on your /proc/cpuinfo in the flags line.

As for qemu, you can alternate to the VM console using ctrl+alt+2 and run "info kvm" to see if it go the kvm support enabled.

Chuck56 10-01-2010 03:45 PM

Like I said, you only need to worry about the CPU or BIOS if the modules didn't load. You're good to go.

So is the slowness you're experiencing related to anything in particular (e.g. display, drives, network)?

How are you starting the vm? What command?

Squall90 10-01-2010 03:49 PM

These are my flags:
Quote:

fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_save
However, guest OSes with VirtualBox and WMware are much faster than with Qemu.

Like I said, you only need to worry about the CPU or BIOS if the modules didn't load. You're good to go.

Quote:

Originally Posted by Chuck56 (Post 4115139)
So is the slowness you're experiencing related to anything in particular (e.g. display, drives, network)?

It was even slow at the installation. I was trying to boot the Slackware DVD ISO (mounted). I never saw such a slow installation.

Quote:

Originally Posted by Chuck56 (Post 4115139)
How are you starting the vm? What command?

Code:

$ qemu -m 2047 -hda ./Qemu/slackware13.1.img -cdrom ./Downloads/slackware-13.1-install-dvd.iso -boot d

Chuck56 10-01-2010 03:53 PM

Quote:

Originally Posted by Squall90 (Post 4115144)
These are my flags:
However, guest OSes with VirtualBox and WMware are much faster than with Qemu.

So are you running "qemu" or "qemu-system-x86_64"?

EDIT: Disregard... You must have been typing when I asked this question.

Squall90 10-01-2010 03:57 PM

Just "qemu".

Chuck56 10-01-2010 04:04 PM

Quote:

Originally Posted by Squall90 (Post 4115148)
Just "qemu".

No wonder it's slow! ;)

The qemu command is just the emulator without any acceleration. It's slower than qemu-kvm even if you add the -enable-kvm option.

Use qemu-system-x86_64 in place of qemu. Don't worry about the reference to x86_64 if you're running 32 bit because it works for both 32 bit and 64 bit.

If I've kept up so far, you've installed packages for qemu, kvm and qemu-kvm. As mentioned earlier in the thread, all you need is qemu-kvm. I suggest you uninstall the qemu and kvm packages.

Squall90 10-01-2010 04:25 PM

Ah, this explains a lot. I read about qemu-system-x86_64 but I didnt used it because I didnt want 64bit.^^
I'll try then. Thannks!

maxmiorim 10-01-2010 04:28 PM

I didn't know there was a difference between qemu and qemu-system-x86_64 - i use "qemu" for i[456]86 machines and the performance seems the same. :\

Anyway, my performance bottleneck usually is the weird disk caching of qemu, so i just disable it and everything runs smooth again.

Basically, i use:
Code:

-drive index=0,media="disk",if="virtio",cache="none",file="/home/max/vms/disks/slack64-build.img",boot="on"
Istead of:
Code:

-hda /home/max/vms/disks/slack64-build.img
Note that the virtio interface requires a customized kernel with the virtio-blk module, you'd have to replace it for scsi or ide if you don't want to customize the installer.


All times are GMT -5. The time now is 01:39 AM.