home | list info | list archive | date index | thread index

[OCLUG-Tech] Starting KVM

Hi;

I would like some short answers re: my KVM installation.  I have been
reading all morning and I think I have captured the basic ideas.  I am
just a little tentative about actually starting to use it.  Therefore I
have a series of questions.  I can and have guessed at the answers but a
quick confirmation would help.

1) I have a little qui called Virtual Machine Manager in Fedora 8.  It
shows me "gemu disconnected", if I want KVM should I connect it?  What
else should I do first.  The KVM modules are loaded.

2) Briefly what is qemu's relationsship to KVM?  I don't mean
abstractly, I mean, do I use qemu commands in the commandline or is KVM
the guiding light?  Or, is it; it depends?

3) Are there special utilities or frontends for working with KVM?

I have gotten the following quotes from:

http://www-128.ibm.com/developerworks/linux/library/l-linux-kvm/?ca=dgr-lnxw02aLinuxKVM

4) "This machine may or may not support virtualization directly, which
then requires support by the next layer, called the hypervisor."
  
        -- Does my machine support virtualization directly?  How do I
        know?  Will I be using a hypervisor?

5) "This hypervisor looks just like a regular Linux kernel on which you
can run any other application."

        -- Is the hypervisor/linux kernel referred to, my existing
        kernel or is it some new kernel?  If so, where did I get it?

6) "But this kernel can also support guest operating systems, loaded
through the kvm utility." 
 
        -- What is the kvm utility?  Would it be different from my
        Virtual Machine Manager gui? 

7) "Instantiation of a new guest operating system is provided by a
utility called kvm. This utility works with the kvm module,
using /dev/kvm to load a guest, associate it with the virtual disk (a
regular file in the host operating system), and then boot it." 

        -- Tried sudo kvm; kvm not found.  Do I have to modprobe kvm
        first?  'lsmod' says it is there.  So does /dev.
        
8) "Using KVM is actually quite simple if your hardware supports it. You
need a processor that has virtualization support: You can tell whether
your system supports virtualization by looking at /proc/cpuinfo. This
file specifies whether the vmx (Intel) or svm (AMD) extensions are
supported.

        ]$ cat /proc/cpuinfo
        flags           : fpu vme de pse tsc msr pae mce cx8 apic sep
        mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall
        nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good pni cx16
        lahf_lm cmp_legacy **svm** extapic cr8_legacy
        
9) "Next, you need a Linux kernel with KVM support enabled. You do this
in the kernel configuration under Device Drivers > Virtualization. You
must also enable processor support for your environment. You must have
the kvm and qemu user-space applications, as well." 

        -- Do I need to do this?  Isn't modprobe kvm enough? I have 
        ~]$ lsmod | grep kvm
        kvm_amd                24149  0 
        kvm                    69657  1 kvm_amd

10) "Using a booted kernel with virtualization support enabled, the next
step is to create a disk image for the guest operating system. You do so
with qeumu-img, as shown below. Note that the size of the image is 4 GB,
but using QEMU's copy-on-write format (qcow), the file will grow as
needed instead of occupying the full 4 GB."

$ qemu-img create -f qcow vm-disk.img 4G
            
        -- What is the disk image?  I don't yet have an extra operating
        system to image?  Is this preparing another/extra kernel space?

11) "With your virtual disk created, load the guest operating system
into it. The following example assumes that the guest operating system
is on a CD-ROM. In addition to populating the virtual disk with the
CD-ROM ISO image, you must boot the image when it's done."

$ kvm -no-acpi -m 384 -cdrom guestos.iso -hda vm-disk.img -boot d
            
        -- Keeping in mind I want to have a second Linux OS to play,
        explore and hack, where do I get the extra kernel and how do I
        load it not using a cdrom?

And, next, where and when does 'git' get into it?

I have created an new user account to work out of for this project.  Is
there some best place to put these extra OSs, trucks and source files in
the new user account.  I want to aggressively play around without
risking my existing system.
-- 
Regards Bill