LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   kvm slackbuild error on Slackware 13.1 (64) (https://www.linuxquestions.org/questions/slackware-14/kvm-slackbuild-error-on-slackware-13-1-64-a-814431/)

hakan56 06-16-2010 01:44 AM

kvm slackbuild error on Slackware 13.1 (64)
 
I would like to test "virt-manager" but "stumbled" with kvm..
http://slackbuilds.org/repository/13.1/system/kvm/
I got this error..
Code:

from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/mm.h: In function 'virt_to_head_page':
include/linux/mm.h:318: error: implicit declaration of function '__pfn_to_page'
include/linux/mm.h:318: warning: initialization makes pointer from integer without a cast
In file included from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:312,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/mm.h: In function 'lowmem_page_address':
include/linux/mm.h:592: error: implicit declaration of function '__page_to_pfn'
In file included from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:312,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
include/linux/mm.h:943:5: warning: "CONFIG_SPLIT_PTLOCK_CPUS" is not defined
In file included from include/linux/hardirq.h:10,
                from include/linux/interrupt.h:12,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/../external-module-compat-comm.h:675,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/external-module-compat.h:16,
                from <command-line>:0:
arch/x86/include/asm/hardirq.h: At top level:
arch/x86/include/asm/hardirq.h:29: error: requested alignment is not a constant
In file included from /tmp/SBo/kvm-88/kvm/kernel/include/linux/kvm_host.h:67,
                from /tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:56:
/tmp/SBo/kvm-88/kvm/kernel/include/asm/kvm_host.h: In function 'page_header':
/tmp/SBo/kvm-88/kvm/kernel/include/asm/kvm_host.h:705: warning: initialization makes pointer from integer without a cast
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c: In function 'svm_hardware_unsetup':
In file included from /tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:56:
/tmp/SBo/kvm-88/kvm/kernel/include/linux/kvm_host.h: At top level:
/tmp/SBo/kvm-88/kvm/kernel/include/linux/kvm_host.h:209: error: field 'mmu_notifier' has incomplete type
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:529: warning: passing argument 1 of '__free_pages' makes pointer from integer without a cast
include/linux/gfp.h:326: note: expected 'struct page *' but argument is of type 'int'
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c: In function 'svm_free_vcpu':
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:758: warning: passing argument 1 of '__free_pages' makes pointer from integer without a cast
include/linux/gfp.h:326: note: expected 'struct page *' but argument is of type 'int'
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:759: warning: passing argument 1 of '__free_pages' makes pointer from integer without a cast
include/linux/gfp.h:326: note: expected 'struct page *' but argument is of type 'int'
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:760: warning: passing argument 1 of '__free_pages' makes pointer from integer without a cast
include/linux/gfp.h:326: note: expected 'struct page *' but argument is of type 'int'
/tmp/SBo/kvm-88/kvm/kernel/x86/svm.c:761: warning: passing argument 1 of '__free_pages' makes pointer from integer without a cast
include/linux/gfp.h:326: note: expected 'struct page *' but argument is of type 'int'
make[4]: *** [/tmp/SBo/kvm-88/kvm/kernel/x86/svm.o] Error 1
make[3]: *** [/tmp/SBo/kvm-88/kvm/kernel/x86] Error 2
make[2]: *** [_module_/tmp/SBo/kvm-88/kvm/kernel] Error 2
make[1]: *** [all] Error 2
make: *** [kvm-kmod] Error 2
bash-4.1#

..and I don't have the knowledge to understand what is wrong so any help is much appreciated.

/Håkan

Thom1b 06-16-2010 02:12 AM

Hi,

This slackbuild is old. You have to use qemu-kvm with this slackbuild.

hakan56 06-16-2010 09:01 AM

2 Attachment(s)
Thank you, I already had this installed together with the other dependencies for virt-manager..
Code:

libvirt,
GConf, +orbit2
gnome-python, +libgnome +gnome-vfs (GConf (orbit2) gnome-mime-data libbonobo (orbit2) and optional avahi?)
urlgrabber,
virtinst, +libvirt
gtk-vnc,
tunctl,
rarian and
optionally qemu +kqemu
and/or kvm +qemu-kvm

..so I then fixed the groups, loaded the modules and started virtlibd..
Code:

spiken@hakan:~$ groups
users floppy audio video cdrom plugdev power netdev kvm libvirt
spiken@hakan:~$ su
Password:
root@hakan:/home/spiken# modprobe kvm
root@hakan:/home/spiken# modprobe kvm-intel
root@hakan:/home/spiken# lsmod |grep kvm
kvm_intel              42832  0
kvm                  265284  1 kvm_intel

root@hakan:/home/spiken# /usr/sbin/libvirtd &
[1] 2446
root@hakan:/home/spiken# 15:21:02.326: warning : qemudStartup:1099 : Unable to create cgroup for driver: No such device or address

..but it ends like this (attached pictures) when it's time to install XP. Any help is appreciated:scratch:

/Håkan

samac 06-18-2010 08:08 AM

Hi

You have to modprobe tun and possibly virtio as well. This worked for me I am currently installing FreeBSD-8.0 using the Virtual Machine Manager.

samac

Thom1b 06-18-2010 08:25 AM

Quote:

Originally Posted by samac (Post 4007479)
You have to modprobe tun and possibly virtio as well.

Virtual machines use virtio, host machines don't.

samac 06-18-2010 09:12 AM

Quote:

Virtual machines use virtio, host machines don't.
Thanks I didn't know this.

samac

hakan56 06-19-2010 12:56 AM

Thank you, that fixed it! :)

Can I ask some more questions..

Where do you put this commands so it's done on "boot" (rc.modules?? rc.local??)?

I saw that in FedoraCore there's a "skript" in /etc/init.d called "libvirtd" for libvirt but I cant see any hint of that in Slackware, and do you get the same "error" as I do (above) when "/usr/sbin/libvirtd %"?

Where can I change "policy" so I dont have to be "root" when starting, I have done the "groupadd" (above)?

My /home is the biggest partition so I would like to have the images there...how do I change that from the "default" /var/lib/libvirt ?

/Håkan

samac 06-19-2010 02:21 AM

Quote:

Where do you put this commands so it's done on "boot" (rc.modules?? rc.local??)?

I saw that in FedoraCore there's a "skript" in /etc/init.d called "libvirtd" for libvirt but I cant see any hint of that in Slackware, and do you get the same "error" as I do (above) when "/usr/sbin/libvirtd %"?

Where can I change "policy" so I dont have to be "root" when starting, I have done the "groupadd" (above)?

My /home is the biggest partition so I would like to have the images there...how do I change that from the "default" /var/lib/libvirt ?
All good questions. You put the modprobes and the libvirtd commands in rc.local. It would be possible to make a similar script and put it in /etc/rc.d/rc.libvirtd but if just starting the libvirt daemon by rc.local works then this shouldn't be required.

Changing policy could be done by udev, but I'm not sure how.

Changing the default for your images will probably be as easy as changing a line in a .conf file. Try searching for libvirt.conf, I would add that this is just a guess.

samac

hakan56 06-19-2010 07:50 AM

I tried it in /etc/rc.d/rc.local
Code:

## for virt-manager
modprobe kvm
modprobe kvm-intel
# With kvm module you don't need kqemu. Kqemu is only
# used on computer without virtualization on processor.
# modprobe kqemu
modprobe tun
/usr/sbin/libvirtd &

..it works!

I found that the "image-directory" can be changed in /etc/libvirt/storage/default.xml

I choose a bad "title" on this thread, should have been something with "virt-manager" instead..but as I am "up and running" now I consider this "Solved".

Again, many thanks to both of you for helping me.:hattip:

/Håkan

enine 07-28-2010 08:17 PM

What specifically got it working, I just tried to build kvm and got the same error so I found this thread saying I needed qemu-kvm and built it but get this

bash-4.1# modprobe kvm-intel
FATAL: Error inserting kvm_intel (/lib/modules/2.6.33.4-smp/kernel/arch/x86/kvm/kvm-intel.ko): Operation not supported
bash-4.1#

Slax-Dude 07-29-2010 03:48 AM

First, check if your cpu supports hardware virtualization: grep vmx /proc/cpuinfo
Then, check if it's enabled in your BIOS

I'm assuming you have an Intel cpu....

enine 07-29-2010 08:39 AM

Ahh, yea, more searching myself shows I don't have that flag. Found another post stating I need qemu-legacy and kqemu also to emulate it, I installed those, now I just need to figure out what to do with them.


All times are GMT -5. The time now is 05:10 PM.