View previous topic :: View next topic |
Author |
Message |
gertvs n00b
Joined: 30 Dec 2006 Posts: 5
|
Posted: Sat Dec 30, 2006 10:30 am Post subject: Kernel Based Virtualization (KVM) |
|
|
Maybe this is not the right forum, but I imagine people here will know. I have searched the whole site but didn't find an answer.
I plan to start using Gentoo on new hardware I am currently buying (Intel Core 2 Duo Conroe E6300 based).
I want to install the system using a kernel with the KVM module. I didn't find any package though when I browsed through the package listing.
Is KVM currently available for Gentoo? Or should I wait until 2.6.20 is released?
Thanks |
|
Back to top |
|
|
anello Guru
Joined: 17 Jul 2005 Posts: 557 Location: EU -> DE -> Stuttgart
|
Posted: Sat Dec 30, 2006 11:05 am Post subject: |
|
|
It is not added as yet, though there is a request for an ebuild maintainer ... see here _________________ Antonino Catinello | http://catinello.eu |
|
Back to top |
|
|
gertvs n00b
Joined: 30 Dec 2006 Posts: 5
|
Posted: Sat Dec 30, 2006 3:10 pm Post subject: |
|
|
anello wrote: | It is not added as yet, though there is a request for an ebuild maintainer ... see here |
I could opt to build it outside the portage tree, right? Or would it be better to wait for it to be officially supported, either as a module or inside the 2.6.20 kernel?
Gert |
|
Back to top |
|
|
anello Guru
Joined: 17 Jul 2005 Posts: 557 Location: EU -> DE -> Stuttgart
|
Posted: Sat Dec 30, 2006 6:23 pm Post subject: |
|
|
gertvs wrote: | I could opt to build it outside the portage tree, right? |
Yes you can!
Quote: | Or would it be better to wait for it to be officially supported, either as a module or inside the 2.6.20 kernel? |
You should wait if you expect help from gentoo developers to troubleshoot the bugs that you'll encounter. So you're pretty much on your own, but you can still post here on the forums and hope that some of the users/devs here have experience in that regard that may help you. _________________ Antonino Catinello | http://catinello.eu |
|
Back to top |
|
|
JoeUser n00b
Joined: 08 Apr 2006 Posts: 61
|
Posted: Wed Jan 03, 2007 10:54 pm Post subject: |
|
|
You could still build it outside portage. I'm running it. I was too impatient to wait for the next kernel
KVM-7 wouldn't build because I needed to use gcc4 but the QEmu part of KVM requires gcc3. As of KVM-8 you can specifiy an alternate compiler for QEmu so now it's running here fine.
For me, i used the following for configure:
Code: | ./configure --prefix=/usr/local/kvm --qemu-cc="/usr/bin/gcc-3.4.6" |
then make, make install, added kvm-amd (kvm-intel for you) to /etc/modules.autoload.d/kernel-2.6 and modprobe'd it so I could use it right away. |
|
Back to top |
|
|
stuorguk Tux's lil' helper
Joined: 13 Jan 2003 Posts: 106 Location: UK
|
Posted: Thu Jan 04, 2007 12:46 pm Post subject: |
|
|
How well does KVM work? I have just installed 2.6.20-mm1, on a new Gentoo box that I am building and saw it as a kernel option.
Stuart. |
|
Back to top |
|
|
JoeUser n00b
Joined: 08 Apr 2006 Posts: 61
|
Posted: Thu Jan 04, 2007 2:01 pm Post subject: |
|
|
stuorguk wrote: | How well does KVM work? I have just installed 2.6.20-mm1, on a new Gentoo box that I am building and saw it as a kernel option. |
Currently not quite as smooth as VMWare but a little better then QEmu with KQemu. It's still a young project but it's coming along very quickly. I've been watching the kvm-devel mailing list on sourceforge and the new MMU Virtualization work for KVM appears to have some significant improvements but I've not tried that yet. The MMU branch I read was for Intel VT only at the moment and I use AMD. I'm looking forward to testing it though.
Someone else that had tested the KVM MMU branch showed quite a good speed up over the current KVM release. See the thread here:
http://sourceforge.net/mailarchive/forum.php?thread_id=31313271&forum_id=50582
Quote from the mailing list:
Quote: | Here are some quick numbers. Context-switch overhead with lmbench
lat_ctx -s 0 [zero memory footprint]:
-------------------------------------------------
#tasks native kvm-r4204 kvm-r4232(mmu)
-------------------------------------------------
2: 2.02 180.91 9.19
20: 4.04 183.21 10.01
50: 4.30 185.95 11.27
so here it's a /massive/, almost 20 times speedup! |
I run Windows XP with KVM and it runs just fine for what I need now. |
|
Back to top |
|
|
drwook Veteran
Joined: 30 Mar 2005 Posts: 1324 Location: London
|
Posted: Thu Jan 04, 2007 2:06 pm Post subject: |
|
|
JoeUser wrote: | stuorguk wrote: | How well does KVM work? I have just installed 2.6.20-mm1, on a new Gentoo box that I am building and saw it as a kernel option. |
Currently not quite as smooth as VMWare but a little better then QEmu with KQemu. |
Noticably better or measurably better? I run a windows server 2003 AD domain & some test VM's on one machine using gentoo/qemu, so if it's really noticable performance increase I might take a look. |
|
Back to top |
|
|
JoeUser n00b
Joined: 08 Apr 2006 Posts: 61
|
Posted: Thu Jan 04, 2007 2:43 pm Post subject: |
|
|
drwook wrote: | Noticably better or measurably better? I run a windows server 2003 AD domain & some test VM's on one machine using gentoo/qemu, so if it's really noticable performance increase I might take a look. |
Only slightly noticeably better than Qemu with KQemu after windows is booted but the boot up in KVM pauses a bit with a white screen. I'm not sure what that's all about but after windows is booted it's fine.
For running servers it might be better to wait for the official release of the 2.6.20 kernel if it includes the work from the optimized MMU virtualization branch. |
|
Back to top |
|
|
stuorguk Tux's lil' helper
Joined: 13 Jan 2003 Posts: 106 Location: UK
|
Posted: Thu Jan 04, 2007 2:55 pm Post subject: |
|
|
Sounds great. I have a hard disk with a windows installation on it. What I want to do is either get KVM to boot straight from the HD partition, or copy it into a virtual HD. I assume thats possible.
Stuart. |
|
Back to top |
|
|
gertvs n00b
Joined: 30 Dec 2006 Posts: 5
|
Posted: Fri Jan 05, 2007 8:59 am Post subject: |
|
|
Thanks, everybody here for the excellent information.
I am currently resolving hardware problems with my new system, but I deduct from the performance comparisons provided here, eventhough they're not hard bench marks, that using either the proprietary VMware Player or Qemu with KQemu would be a good temporary option until kernel 2.6.20 is released.
When is 2.6.20 projected to be released?
Many thanks,
Gert |
|
Back to top |
|
|
JoeUser n00b
Joined: 08 Apr 2006 Posts: 61
|
Posted: Fri Jan 05, 2007 11:07 am Post subject: |
|
|
If you're going to use KVM eventually I'd recommend using QEmu while you wait rather then VMWare because KVM also uses QEmu as it's front and its disk images so you can reuse the same disk images you create now after you install KVM. QEmu/KVM will also read VMWare 3 and 4 disk images but i'm not sure if it'll read newer VMWare 5 files. Using QEmu now will save you from having to re-install everything in a new disk image later.
see here: qemu-img invocation |
|
Back to top |
|
|
drwook Veteran
Joined: 30 Mar 2005 Posts: 1324 Location: London
|
Posted: Sat Jan 06, 2007 1:48 pm Post subject: |
|
|
gertvs wrote: | Thanks, everybody here for the excellent information.
I am currently resolving hardware problems with my new system, but I deduct from the performance comparisons provided here, eventhough they're not hard bench marks, that using either the proprietary VMware Player or Qemu with KQemu would be a good temporary option until kernel 2.6.20 is released.
When is 2.6.20 projected to be released?
Many thanks,
Gert |
qemu/kqemu has worked out quite nicely for me up to now |
|
Back to top |
|
|
JoeUser n00b
Joined: 08 Apr 2006 Posts: 61
|
|
Back to top |
|
|
Maf Guru
Joined: 15 May 2005 Posts: 310
|
Posted: Fri Jan 12, 2007 12:00 am Post subject: |
|
|
Any hope for KVM available for amd64 s939 cpu or just physicly impossible? |
|
Back to top |
|
|
JoeUser n00b
Joined: 08 Apr 2006 Posts: 61
|
Posted: Fri Jan 12, 2007 2:38 am Post subject: |
|
|
Maf wrote: | Any hope for KVM available for amd64 s939 cpu or just physicly impossible? |
Does it have SVM support listed under 'flags' in '/proc/cpuinfo'? I don't think it does but I'm not certain.
if it does you're in luck otherwise no. sorry. |
|
Back to top |
|
|
dpurcell n00b
Joined: 06 Sep 2006 Posts: 4
|
Posted: Fri Jan 12, 2007 6:11 am Post subject: kvm-11 on amd64 |
|
|
I've been trying to get kvm-11 to work on my amd64 X2 5200+ but am having trouble compiling it. Perhaps any one of you may know what may be going on?
The first problem I run into is with the ./configure. It says I don't have sdl support, even though I emerged media-libs/libsdl and app-emulation/emul-linux-x86-sdl. I also did a gcc-config and switched my computer to x86_64-pc-linux-gnu-3.4.6 and sourced /etc/profile. When I type ./configure --prefix=/usr/local/kvm, this is what I get:
Install prefix /usr/local/kvm
BIOS directory /usr/local/kvm/share/qemu
binary directory /usr/local/kvm/bin
Manual directory /usr/local/kvm/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path /home/dpurcell/dev/kvm-11/qemu
C compiler /usr/bin/gcc32
... cut out to not bore you with details....
SDL support no
... cut out to not bore you with details....
kvm support yes
Documentation yes
ERROR: QEMU requires SDL or Cocoa for graphical output
To build QEMU without graphical output configure with --disable-gfx-check
Note that this will disable all output from the virtual graphics card.
However, when I cd into the qemu subdir and type './configure' from that subdirectory, I see "SDL support yes" and SDL static support yes" in the output. So I edited the qemu/configure script and forced 'sdl' to 'yes'. After that, I see a 'yes' next to sdl when I run configure from the kvm-11 subdir.
The next issue happens a few moments after I type make (sorry for the tons of output):
/usr/bin/gcc32 -DQEMU_TOOL -I /home/dpurcell/dev/kvm-11/qemu/../user -Wall -O2 -g -fno-strict-aliasing -I. -g -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o qemu-img qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c -lz -luuid
block-vmdk.c: In function `vmdk_open':
block-vmdk.c:420: warning: passing arg 1 of `dirname' discards qualifiers from pointer target type
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../libz.so when searching for -lz
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../libz.a when searching for -lz
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /lib/libz.so when searching for -lz
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[1]: *** [qemu-img] Error 1
make[1]: Leaving directory `/home/dpurcell/dev/kvm-11/qemu'
make: *** [qemu] Error 2
Why would qemu have trouble finding a compatible libz? I have made sure I have zlib installed.
-Confused |
|
Back to top |
|
|
dpurcell n00b
Joined: 06 Sep 2006 Posts: 4
|
Posted: Fri Jan 12, 2007 6:14 am Post subject: |
|
|
Ha! Figured it out. All I needed to do was this:
Code: | /configure --prefix=/usr/local/kvm --qemu-cc="/usr/bin/gcc-3.4.6" |
and all my sdl and zlib problems went away! |
|
Back to top |
|
|
Maf Guru
Joined: 15 May 2005 Posts: 310
|
Posted: Fri Jan 12, 2007 7:25 am Post subject: |
|
|
JoeUser wrote: |
Does it have SVM support listed under 'flags' in '/proc/cpuinfo'? I don't think it does but I'm not certain.
if it does you're in luck otherwise no. sorry. |
Ok, then I have small OT question: Which other VM do you all suggest to use? Qemu, Xen? Or something else?
I'd like it to be fast and use free/libre license. |
|
Back to top |
|
|
whig l33t
Joined: 27 Nov 2004 Posts: 973 Location: New Zealand
|
Posted: Fri Jan 12, 2007 8:14 am Post subject: |
|
|
If you want an X gui in a VM then KVM uses Qemu's. Xen is faster, but console only I understand. |
|
Back to top |
|
|
JoeUser n00b
Joined: 08 Apr 2006 Posts: 61
|
Posted: Fri Jan 12, 2007 10:26 am Post subject: |
|
|
It depends on your needs. Do you plan on running Windows on it? Xen has the same limitation as KVM. It can't run Windows without an SVM or VT capable processor. Xen's paravirtualization can get near native performance using modifed Xen aware guests but MS isn't going to let anyone release modified Windows source. Windows will only run unmodified in Xen and KVM with hardware assisted full virtualization. You also need to VNC, TSClient, XDMCP or SSH with X forwarding to get a windowed interface to a Xen guest. The kvm-devel mailing list has some work being done to give KVM paravirtualization support but then like Xen it'll require modified guests to make them 'aware'. I might be wrong here but that's how I understand it all.
Also, I couldn't get Xen to work reliably. I don't think it likes my Acer because when I booted the Xen kernel built from the Xen modified kernel source in Portage everything just went BAD. I think Xen is overkill for most peoples needs unless you're consolidating a server farm into fewer machines. The average Linux user probably just wants it to run windows for their last few programs they don't have replacements for yet. That's my situation and KVM is fine for me.
Qemu with KQemu accelerator isn't bad if you don't have an SVM/VT processor. It'll run Windows for you unmodified but KQemu isn't open. There was an open source project to create a Qemu accelerator called QVM86 but I haven't tried it.
Last edited by JoeUser on Sat Jan 13, 2007 1:13 pm; edited 1 time in total |
|
Back to top |
|
|
Maf Guru
Joined: 15 May 2005 Posts: 310
|
Posted: Sat Jan 13, 2007 12:00 pm Post subject: |
|
|
I have Athlon 64 @ s939 cpu, so I probably have to stay with Qemu + KQemu, which works quiet ok. |
|
Back to top |
|
|
kraix Tux's lil' helper
Joined: 20 Jun 2005 Posts: 93
|
Posted: Sat Jan 13, 2007 2:30 pm Post subject: |
|
|
there has been one thing I have been wanting to know but haven't really put any time into figuring it out, with virtualization hardware, AMD Turion Tl-50, is it possible to get good 3d rendering for games under Xen or KVM? pretty much for games... |
|
Back to top |
|
|
whig l33t
Joined: 27 Nov 2004 Posts: 973 Location: New Zealand
|
Posted: Sat Jan 13, 2007 8:07 pm Post subject: |
|
|
Socket 754 here: Qemu gives me a Cirrus "card" so no hardware opengl. The programs do run, at about 4 fps |
|
Back to top |
|
|
kraix Tux's lil' helper
Joined: 20 Jun 2005 Posts: 93
|
Posted: Sat Jan 13, 2007 11:20 pm Post subject: |
|
|
But I don't believe the 754 has virtualization support at all. The turion tl-50 does have virtualization support, which might increase opengl performance for some very strange reason. |
|
Back to top |
|
|
|