Diving into KVM, Part 1: Progress, but limited
KVM stands for Kernel-based Virtual Machine. If I understand correctly, there was some debate as to whether to integrate Xen into the kernel, but the Linux developers opted to include their own(?) solution instead, KVM.
My first bit of confusion was the difference between virtualization, para-virtualization, and real virtualization. As I understood it:
Virtualization: All x86 calls, devices, etc. are emulated in software.
Paravirtualization: Layer of abstraction between real hardware calls and the virtual machine. Guest kernels must be modified to make these “idealized CPU calls”.
Real virtualization: Most x86 calls are emulated in software, but some “tricky” (i.e. slow) ones are done in hardware via Intel VT/AMD Pacifica extensions.
Confusing though, in the comparison of virtualization technologies chart, it says paravirtualization can be faster than real virtualization. That kind of surprises me. I suppose it entails creating “idealized” wrappers around real but imperfect hardware and doing optimizations, as in the DMA NIC example in the Wikipedia article. For my purposes, I’d be using “real virtualization”, but the idea that paravirt might be faster is intriguing.
To the Fedora 7 Virt Quick Start guide:
- Filtering out the Xen specific stuff is kind of frustrating. They should really separate the two.
virt-installasks me “What would you like to use as the disk (path)?” – I assume I’m supposed to put an empty dir with sufficient free space here.- I make a partition for “boxbox1″, my virtual machine:
# lvcreate -L 4500M -n boxbox1 VolGroup00
Rounding up size to full physical extent 4.41 GB
Logical volume "boxbox1" created
# mke2fs -j -m 0 /dev/mapper/VolGroup00-boxbox1
# mount /dev/mapper/VolGroup00-boxbox1 /mnt/boxbox1/
- I specify
/mnt/boxbox1/as my path:- Ooops:
ERROR: The disk path must be a file or a device, not a directory - Used
/dev/mapper/VolGroup00-boxbox1instead
- Ooops:
- Asks me “
Would you like to enable graphics support? (yes or no)“. Somehow I know this will come back to haunt me, but I say ‘yes’. - Guide says It is not possible to install from a local disk or CDROM., but
virt-installis asking me:What is the virtual CD image, CD device or install location?- First idea: Put in http://download.fedora.redhat.com/pub/fedora/linux/releases/7/Everything/x86_64/os/ and install F7 x86_64
- Second idea: Just point to /dev/cdrom and install F7 i386
- I try
/dev/cdromfirst, but it doesn’t like that. - Trying again as
rootwas an idea (probably need to be), but still no good. - Trying again without graphics, I still get a bunch of blank libvir: QEMU errors. However, it’s told me that I
can reconnect to the console to complete the installation process. From what I’ve read, the console should just “appear” in my current terminal. Not the case. - I see qemu is running..
$ ps aux |grep qemu
root 21866 7.7 2.4 565316 51520 ? Sl 23:18 1:53 /usr/bin/qemu -M pc -no-kqemu -m 512 -smp 1 -nographic -monitor pty -no-reboot -boot d -hda /dev/mapper/VolGroup00-boxbox1 -cdrom /dev/cdrom -net nic,macaddr=00:16:3e:2a:3f:2e,vlan=0 -net tap,fd=10,script=,vlan=0 -usb
…but I don’t have any idea how to connect to it.
Strange. I’ll investigate more tomorrow morning, and maybe try using the GUI tool, virt-manager, instead.
[...] KVM, Part 2 Filed under: Open Source — jbopensrc @ 4:40 pm Continuing my work from Part 1, I attempted to use virt-manager to create a KVM virtual machine. The GUI asked me a bunch of [...]
Diving into KVM, Part 2 « jb’s open source blog
October 20, 2007 at 4:40 pm