Linux KVM

From Wiki

Jump to: navigation, search

Contents

[edit] Linux KVM

Linux KVM is a standard feature of the Linux operating system for x86 and x64 architectures. Support for other architectures are emerging. It equippes Linux with Hypervisor capabilities, given the CPU supports hardware based virtualization.

[edit] KVM critics

I am very positive about open source, and linux in particular. Because of this I honestly document what does not work, but should in my humble opinion. I feel sorry not to invest enough of my own time to fix the problems.

  • kvm build 68: configure does not check for zlib headers.
  • On my laptop, when kvm modules are loaded, suspend breaks. Modules have to be unloaded, then suspend works.
  • OpenSuse guest partially BROKEN: Intel Real Mode Virtualization and OpenSuse gfxboot: facts of life, the linux/kvm/qemu packages need to address it.
  • Kubuntu 7.10 guest partially BROKEN: the full Kubuntu 7.10 / 64 Bit iso based installation crashes instantly upon startup. mini.iso works. Need to be fixed.
  • ubuntu package repository provides rather old releases of kvm, this information is as of march 2008.
  • kvm monitoring: missing a remote/script interface, like provided with user mode linux / uml.
  • the kvm error handling - commandline output on a crashed runtime - looks disturbing to a regular user.
  • Windows Server 2008 guest partially BROKEN: kvm build 65 seems broken for Windows Server 2008 64-Bit edition. VM crashes on 'windows loading files' early during installation.

[edit] My host configuration

I use Linux KVM on the Kubuntu installation of my laptop, and use qemu to provide the hardware emulation and supporting commands. The key environment characteristics are

  • Intel Core 2 Duo 2.4 GHz, with hardware virtualization support, and 64 Bit support
  • 4 GB RAM
  • Plenty of harddisk for a laptop, 320 GB SATA disk
  • Kubuntu 8.04 for AMD64 host operating system
  • Linux 2.6.24, which is the default kernel shipped with Kubuntu 8.04
  • Kubuntu packages qemu, bridge-utils
  • self compiled kvm build 68
  • qemu package for ubuntu as from a repository, version 0.9.0

[edit] Building kvm myself

Update: After I initially went through the installation experience at the bottom of this section, last I used kvm build 68 as follows:

  Download the tar.gz from Sourceforge.
  gunzip -xzf kvm-68.tar.gz
  cd kvm-68
  ./configure
  make
  sudo make install
  sudo rmmod kvm-intel
  sudo rmmod kvm
  sudo modprobe kvm-intel

The kvm version reported by Kubuntu 7.10 when I failed to install several guests was 1:28, with no useful version ids in the modules.

As such next thought was to compile latest module.

So I visited the sourceforge kvm pages, and downloaded the latest tarball, which was build 64.

Unpacked and did ./configure. configure complained about missing gcc 3.4, missing libdsl headers, missing pkg-config.

I searched, found and installed those using the adept package manager, with just a few button clicks.

Then configure worked.

make then was broken:

  block-qcow.c:26:18: warning: zlib.h: No such file or directory

The developers should fix configure to check for the zlib headers.

Another adept package install.

finally it worked:

  ... stopping running kvm instances ...
  sudo rmmod kvm-intel
  sudo rmmod kvm
  tar -xzf kvm-64.tar.gz
  cd kvm-64
  ./configure
  make
  sudo make install

[edit] Guests

[edit] My wishlist

Installing guests one at a time.

  • OpenSolaris (64 Bit)
  • Windows Server 2008 (64 Bit)
  • Windows Vista Ultimate (32 Bit)
  • OpenSuse 10.3 (64 Bit)

[edit] Kubuntu 7.10 (64 Bit)

Installation tweaks:

Had to use the minimal CD-Rom Image, as the graphical installation boot screen hangs. Probably the Intel Real Mode Virtualization issue.

  qemu-img create gutsy-server.img -f qcow 6G
  kvm -m 500 -cdrom ~/downloads/mini.iso -boot d gutsy-server.img
  ... installation ... shutdown after installation ...
  kvm -m 500 gutsy-server.img

Using the full DVD iso image for installation crashes almost instantly, using kvm-65:

  kvm -m 500 -cdrom kubuntu-7.10-dvd-amd64.iso -boot d gutsy-server.img
  exception 13 (33)
  rax 0000000000000469 rbx 0000000000800001 rcx 0000000000004300 rdx 0000000000000000
  rsi 000000000005961d rdi 000000000005961c rsp 00000000fffaa9cc rbp 000000000000200c
  r8  0000000000000000 r9  0000000000000000 r10 0000000000000000 r11 0000000000000000
  r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000
  rip 000000000000b04b rflags 00033006
  cs 4143 (00041430/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  ds 4004 (00040040/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  es 4004 (00040040/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  ss 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  fs 3002 (00030020/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  gs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  tr 0000 (1fc50000/00002088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0)
  ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0)
  gdt 40920/47
  idt 0/ffff
  cr0 60000010 cr2 0 cr3 0 cr4 0 cr8 0 efer 0
  code: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  Aborted (core dumped)


[edit] Kubuntu 8.04 (64 Bit)

failed with ubuntu kvm version 1:28. worked seamless with build 64.

  qemu-img create kubuntu8.img -f qcow 6G
  kvm -m 500 -cdrom ~/downloads/kubuntu-8.04-beta-desktop-amd64.iso -boot d kubuntu8.img
  ... installation ... shutdown after installation ...
  kvm -m 500 kubuntu8.img

On shutdown, kvm aborted with error.

  unhandled vm exit: 0xb

[edit] OpenSolaris (32 Bit)

Having problems installing... Very simple solution: Don't use the graphical installer when starting the guest with just 500 MB. After setting memory to 1000 MB, installer works fine.

Also don't try to install with a 6 GB cow file, it is too small. I use 10 GB.

This first installation is 32 Bit only by accident. Soon I replace it with 64 Bit.

  qemu-img create solaris.img -f qcow 10G
  kvm -m 1000 -cdrom ~/downloads/sol-nv-b85-x86-dvd.iso -boot d solaris.img
  ... installation ... shutdown after installation ...
  kvm -m 1000 solaris.img

[edit] OpenSuse 10.3 (32 Bit)

Installation tweaks:

Had to use the -no-kvm option during install, due to the Intel Real Mode Emulation Problem, and opensuse's gfxboot using real mode.

  qemu-img create opensuse.img -f qcow 6G
  kvm -no-kvm -m 500 -cdrom ~/downloads/openSUSE-10.3-GM-DVD-i386.iso -boot d opensuse.img
  ... installation ... shutdown after installation ...
  kvm -m 500 opensuse.img

Using kvm build 65 and not using -no-kvm for installation causes almost instant crash.

  kvm -m 500 -cdrom openSUSE-10.3-GM-DVD-i386.iso -boot d opensuse103.img
  exception 13 (33)
  rax 0000000000000671 rbx 0000000000800000 rcx 0000000000000000 rdx 00000000000013ca
  rsi 0000000000055e1c rdi 0000000000055e1d rsp 00000000fffa0080 rbp 000000000000200b
  r8  0000000000000000 r9  0000000000000000 r10 0000000000000000 r11 0000000000000000
  r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000
  rip 000000000000b071 rflags 00033096
  cs 4004 (00040040/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  ds 4004 (00040040/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  es 00ff (00000ff0/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  ss ff11 (000ff110/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  fs 3002 (00030020/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  gs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
  tr 0000 (1fc50000/00002088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0)
  ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0)
  gdt 40920/47
  idt 0/ffff
  cr0 60000010 cr2 0 cr3 0 cr4 0 cr8 0 efer 0
  code: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  Aborted (core dumped)

[edit] Windows Server 2003 (32 Bit)

I used the Trial of Windows Server 2003 Enterprise Edition, Version R2 SP2, English, 32 Bit. The download comes in the form of two img CD-Image files.

Using memory of 1000 MB and a 6G disk image for the guest.

  qemu-img create windows.img -f qcow 6G
  kvm -m 1000 -net nic,model=rtl8139 -net user -cdrom X13-05665.img -boot d windows.img
  ... installation ... shutdown after installation ...
  kvm -m 1000 -net nic,model=rtl8139 -net user -cdrom X13-05463.img -boot c windows.img
  ... installation using setup2.exe from second installation CD-Rom image ... shutdown after installation ...
  kvm -m 1000 -net nic,model=rtl8139 -net user windows.img

[edit] Windows Server 2008 (32 Bit)

Using memory of 1000 MB and a 10G disk image for the guest.

I downloaded the 1.8 GB iso image from Microsoft, and burnt a DVD using the iso image.

This first installation is 32 Bit as the 64 Bit edition crashes.

  qemu-img create windows.img -f qcow 10G
  ... insert installation dvd into dvd drive ...
  kvm -m 1000 -net nic,model=rtl8139 -net user -cdrom /dev/cdrom -boot d windows.img
  ... installation ... shutdown after installation ...
  kvm -m 1000 -net nic,model=rtl8139 -net user windows.img

[edit] BROKEN: Windows Server 2008 (64 Bit)

Using memory of 1000 MB and a 10G disk image for the guest.

I downloaded the almost 3 GB iso image from Microsoft, and burnt a DVD using the iso image.

  qemu-img create windows.img -f qcow 10G
  ... insert installation dvd into dvd drive ...
  kvm -m 1000 -cdrom 6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso -boot d windows.img

Note: When I used Kubuntu 7.10/kvm-65, the installation crashed after the initial 'windows loading files...' screen. This problems seems to be fixed with Kubuntu 8.04/Kernel 2.6.24/kvm-68.

Personal tools