LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-26-2009, 05:36 AM   #1
[GOD]Anck
Member
 
Registered: Dec 2003
Location: The Netherlands
Distribution: Slackware
Posts: 171

Rep: Reputation: 35
virtualization with kvm-84 on slackware 12.2


I'm having some problems with virtualization using kvm-84 on slackware 12.2. I can't seem to install any guest operating system, qemu-system-x86_64 causes a general protection fault as soon as I start any installer. The system has an intel core2 quad cpu, and virtualization is enabled in bios. I run a slightly modified (highmem support) 2.6.27.7-smp kernel.

Here's what I did:

I downloaded kvm-84, compiled and installed it. This created the kvm kernel modules in /lib/modules/2.6.27.7-smp/extra/. I loaded the intel module with modprobe kvm-intel. /dev/kvm was created with root as owner and group. The kvm howto says to run qemu-system using sudo, but I created a kvm group instead and chgrp'd /dev/kvm to that group. I added my user account to the kvm group.

Code:
ls -la /dev/kvm
crw-rw---- 1 root kvm 10, 232 2009-03-26 09:58 /dev/kvm

groups
users floppy audio video cdrom kvm
Then I created an image and started an installer:

Code:
qemu-img create -f qcow image.img 10G
qemu-system-x86_64 -hda image.img -cdrom /path/to/install/iso -boot d -m 512
The install cd image boots, and I can navigate the menu, but when trying to start the installation, qemu-system-x86_64 causes a general protection fault:

Code:
Mar 26 10:06:52 quad kernel: general protection fault: 0000 [#3] SMP
Mar 26 10:06:52 quad kernel: Modules linked in: kvm_intel kvm snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss ppdev lp parport_pc parport fuse usbhid hid nvidia(P) snd_hda_intel uhci_hcd i2c_i801 snd_pcm agpgart i2c_core snd_timer ehci_hcd snd_page_alloc snd_hwdep sky2 thermal processor evdev thermal_sys button snd sg hwmon soundcore reiserfs
Mar 26 10:06:52 quad kernel:
Mar 26 10:06:52 quad kernel: Pid: 3705, comm: qemu-system-x86 Tainted: P      D   (2.6.27.7-smp #1)
Mar 26 10:06:52 quad kernel: EIP: 0060:[<f9365256>] EFLAGS: 00010246 CPU: 0
Mar 26 10:06:52 quad kernel: EIP is at vmx_save_host_state+0x156/0x1a0 [kvm_intel]
Mar 26 10:06:52 quad kernel: EAX: 00000900 EBX: 00000100 ECX: c0000080 EDX: 00000000
Mar 26 10:06:52 quad kernel: ESI: c0000080 EDI: f22d46e0 EBP: eed21e90 ESP: eed21e6c
Mar 26 10:06:52 quad kernel:  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Mar 26 10:06:52 quad kernel: Process qemu-system-x86 (pid: 3705, ti=eed20000 task=f3f3c6e0 task.ti=eed20000)
Mar 26 10:06:52 quad kernel: Stack: 00000000 00000000 00000900 00000000 00000800 00000000 f22d46e0 00000000
Mar 26 10:06:52 quad kernel:        f22d46e0 eed21ef0 f938cf70 00000000 00000001 c0578ffc eed21ed0 c014374d
Mar 26 10:06:52 quad kernel:        00000001 00000000 00000001 083c0000 f3f0b500 f22d46e0 c05598a8 f02f0000
Mar 26 10:06:52 quad kernel: Call Trace:
Mar 26 10:06:52 quad kernel:  [<f938cf70>] ? kvm_arch_vcpu_ioctl_run+0x310/0x9f0 [kvm]
Mar 26 10:06:52 quad kernel:  [<c014374d>] ? futex_wake+0xad/0xe0
Mar 26 10:06:52 quad kernel:  [<c017d6c4>] ? kfree+0x14/0xb0
Mar 26 10:06:52 quad kernel:  [<f9387dae>] ? kvm_vcpu_ioctl+0x44e/0x490 [kvm]
Mar 26 10:06:52 quad kernel:  [<c0152e5b>] ? __rcu_process_callbacks+0xb/0x170
Mar 26 10:06:52 quad kernel:  [<f9387960>] ? kvm_vcpu_ioctl+0x0/0x490 [kvm]
Mar 26 10:06:52 quad kernel:  [<c018d97d>] ? vfs_ioctl+0x2d/0x90
Mar 26 10:06:52 quad kernel:  [<c018dc4a>] ? do_vfs_ioctl+0x26a/0x2b0
Mar 26 10:06:52 quad kernel:  [<c01d6d58>] ? cap_file_ioctl+0x8/0x10
Mar 26 10:06:52 quad kernel:  [<c018dce7>] ? sys_ioctl+0x57/0x70
Mar 26 10:06:52 quad kernel:  [<c010325a>] ? syscall_call+0x7/0xb
Mar 26 10:06:52 quad kernel:  =======================
Mar 26 10:06:52 quad kernel: Code: 08 00 00 89 c1 09 d9 89 4d e4 89 d1 09 f1 be 80 00 00 c0 89 4d e8 8b 55 e8 89 f1 89 d0 31 d2 89 45 dc 8b 45 e4 89 55 e0 8b 55 dc <0f> 30 83 87 98 00 00 00 01 83 c4 18 5b 5e 5f 5d c3 b8 08 0c 00
Mar 26 10:06:52 quad kernel: EIP: [<f9365256>] vmx_save_host_state+0x156/0x1a0 [kvm_intel] SS:ESP 0068:eed21e6c
Mar 26 10:06:52 quad kernel: ---[ end trace 3c762b44fdc696cd ]---
Am I doing something wrong? How do I get this working? Install image used was a debian 5 netinst iso, I also tried an ubuntu 8.10 iso I had lying around and the same thing happened.

Last edited by [GOD]Anck; 03-26-2009 at 05:37 AM.
 
Old 03-26-2009, 05:53 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Did you check that your CPU support Intel VT ? It seems that some Core 2 do but others don't.

You could check on this page or @ http://processorfinder.intel.com/ or simply look at "cat /proc/cpuinfo|grep vmx"'s output.

The CPU should have the "vmx" flag if it is VT-able.

Mine is not

PS There is a SlackBuild for kvm-83 @ http://slackbuilds.org (it needs some editing to work with kvm-84 though).

EDIT This post was wrong about flag to check for, edited accordingly.

Last edited by Didier Spaier; 03-26-2009 at 06:49 AM.
 
Old 03-26-2009, 06:06 AM   #3
[GOD]Anck
Member
 
Registered: Dec 2003
Location: The Netherlands
Distribution: Slackware
Posts: 171

Original Poster
Rep: Reputation: 35
/proc/cpuinfo shows the vmx flag which should indicate virtualization support. The kvm-intel module seems to load just fine:

Code:
modprobe kvm-intel
lsmod | grep kvm
kvm_intel              47592  2
kvm                   163952  1 kvm_intel
 
Old 03-26-2009, 06:15 AM   #4
reptiler
Member
 
Registered: Mar 2009
Location: Hong Kong
Distribution: Fedora
Posts: 184

Rep: Reputation: 42
From what I remember you'll be having problems with x86_64-guests when your OS is 32-bit, which Slackware is.
You still should be able to emulate a 64-bit system, but you won't enjoy the benefits which KQEmu or KVM are supposed to give you.
Thus, performance-wise, it would be better to use 32-bit guests.

I may be wrong about this, but that's how I remember it.
 
Old 03-26-2009, 06:47 AM   #5
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
In addition to your steps I created a udev rule.

file: /lib/udev/rules.d/65-kvm.rules
Code:
KERNEL=="kvm", NAME="%k", GROUP="kvm", MODE="0660"
Also you might be interested in the Slackbuild for KVM. Just remember to change the version number to 84 in the kvm.SlackBuild file if you go that route.
 
Old 03-26-2009, 07:35 AM   #6
AlleyTrotter
Member
 
Registered: Jun 2002
Location: Coal Township PA
Distribution: Slackware64-15.0
Posts: 783

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
How it works for me

I have no idea why your getting a seg fault, but I have several kvm virtual machines running on 12.2 with kernel 2.6.29
These are my notes on how to create install and boot them
Also a url which may help

To create an image for KVM
dd if=/dev/zero of=fedora.img bs=1k count=0 seek=16000000

To Install
/usr/bin/qemu-system-x86_64 -localtime -m 1024 -hda /img/fedora.img -cdrom /dev/cdrom -boot d

Or
/usr/bin/qemu-system-x86_64 -localtime -m 1024 -hda /img/winxp.img -cdrom /img/winxp_pro_us.iso -boot d

To boot
/usr/bin/qemu-system-x86_64 -localtime -m 1024 -hda /img/fedora.img -cdrom /dev/cdrom -soundhw es1370

http://alien.slackbook.org/dokuwiki/...slackware:qemu

I also have a kvm group of which I am a member and somewhere along the line a udev rule was created
KERNEL=="kvm", NAME="%k", GROUP="kvm", MODE="0660"
i believe by the slackbuild from sbo

john

Last edited by AlleyTrotter; 03-26-2009 at 07:41 AM.
 
Old 03-26-2009, 04:21 PM   #7
[GOD]Anck
Member
 
Registered: Dec 2003
Location: The Netherlands
Distribution: Slackware
Posts: 171

Original Poster
Rep: Reputation: 35
Quote:
Originally Posted by reptiler View Post
From what I remember you'll be having problems with x86_64-guests when your OS is 32-bit, which Slackware is.
You still should be able to emulate a 64-bit system, but you won't enjoy the benefits which KQEmu or KVM are supposed to give you.
Thus, performance-wise, it would be better to use 32-bit guests.

I may be wrong about this, but that's how I remember it.
Ah yes, that was the problem, my install images were 64 bit. I got the 32 bit equivalent and it installed without a problem.

Thanks also to Chuck56 and AlleyTrotter for the udev rule, that will make life a little easier.

Last edited by [GOD]Anck; 03-26-2009 at 04:24 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Virtualization With KVM On A Fedora 10 Server LXer Syndicated Linux News 0 03-22-2009 09:20 AM
LXer: Virtualization With KVM On Ubuntu 8.10 LXer Syndicated Linux News 0 12-14-2008 12:00 PM
F7 KVM Virtualization Crito Fedora 2 06-05-2007 07:58 AM
can someone tell me if my processor has virtualization features to use KVM? r00tb33r Linux - Software 6 04-14-2007 10:22 AM
LXer: KVM steals virtualization spotlight LXer Syndicated Linux News 0 02-26-2007 12:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration