kvm virtualization in RHEL 5.4 Beta, howto

Thomas von Steiger thomas.vonsteiger at bluewin.ch
Thu Aug 13 19:26:50 UTC 2009


If you install from rhn.redhat.com activate this channels (if x86_64)  
for your system:

rhel-x86_64-server-5
rhel-x86_64-server-vt-5-beta
rhel-x86_64-server-5-beta

Then update your system to 5.4 and reboot to the new kernel

After that install this rpm's from rhel5.4 (dependencies will install  
more packages):

kvm
virt-viewer
virt-manager
python-virtinst
libvirt-python
libvirt
kvm-qemu-img
bridge-utils

I have active VT Support in the system bios (vmx flag in /proc/ 
cpuinfo) on my intel i7.

https://fedoraproject.org/wiki/ 
Getting_started_with_virtualization#System_requirements

[root at raptor ~]# virt-install  --prompt
Would you like to use KVM acceleration? (yes or no) yes
  What is the name of your virtual machine? testnode
  How much RAM should be allocated (in megabytes)? 512
  What would you like to use as the disk (file path)? /data/images/ 
testnode.img
  How large would you like the disk (/data/images/testnode.img) to be  
(in gigabytes)? 10
  What is the install CD-ROM/ISO or URL? /data/iso/rhel-server-5.3- 
x86_64-dvd.iso


Starting install...
Creating storage file...           |  10 GB     00:00
Creating domain...                 |    0 B     00:00

and then you get the virt-viewer console for start install your guest.  
There are more option for using kickstart files.
If you are using ssh to access you hypervisor use "ssh -X" for x11  
forwarding virt-viewer.

Or you can install guests with virt-manager complete over the UI.  
Define virtual networks and storage by Edit->Host Details.
After that create a guest with "new"....

With "virsh help" there are many commands available for vm management.
For example:

virsh list -> list you guests
virsh dumpxml testnode -> dump a xml from your testnode
virsh autostart testnode -> autostart your guest at boot up.


Here one xml from a running guest:

virsh # dumpxml testnode
<domain type='kvm' id='8'>
   <name>testnode</name>
   <uuid>0a5e51a8-2eeb-283d-ca99-83b6e92cdfd1</uuid>
   <memory>524288</memory>
   <currentMemory>524288</currentMemory>
   <vcpu>2</vcpu>
   <os>
     <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
   <features>
     <acpi/>
     <apic/>
     <pae/>
   </features>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
   <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/libexec/qemu-kvm</emulator>
     <disk type='file' device='disk'>
       <source file='/data/images/testnode.img'/>
       <target dev='hda' bus='ide'/>
     </disk>
     <interface type='network'>
       <mac address='54:52:00:11:8d:71'/>
       <source network='default'/>
       <target dev='vnet7'/>
     </interface>
     <serial type='pty'>
       <source path='/dev/pts/16'/>
       <target port='0'/>
     </serial>
     <console type='pty' tty='/dev/pts/16'>
       <source path='/dev/pts/16'/>
       <target port='0'/>
     </console>
     <input type='mouse' bus='ps2'/>
     <graphics type='vnc' port='5907' autoport='yes' keymap='en-us'/>
     <sound model='es1370'/>
   </devices>
</domain>

With "virt-viewer testnode" you can access allways to your guests  
console.
Hope this help you a little for starting and learning about this great  
technologie!

Thomas


On 13.08.2009, at 12:14, ESGLinux wrote:

> Thanks for your answer Len,
> One question, which exactly package did you install to use KVM ? I´m  
> going
> to look for it in RHEL 5.4
>
> ESG
>
> 2009/8/13 Le Wen <wenle at lenovo.com>
>
>> Yes, it's not supported in RHEL5.3 by default, so I upgrade my  
>> kernel to
>> 2.6.24 and enable KVM , download KVM package and install it. Then I  
>> can
>> use qemu command to create a VM.
>>
>> I haven't tested RHEL5.4, you can try if there's such qemu command.
>>
>>
>>
>>
>>
>>
>> ESGLinux <esggrupos at gmail.com>
>> Sent by: redhat-list-bounces at redhat.com
>> 2009-08-13 15:04
>> Please respond to
>> General Red Hat Linux discussion list <redhat-list at redhat.com>
>>
>>
>> To
>> General Red Hat Linux discussion list <redhat-list at redhat.com>
>> cc
>>
>> Subject
>> Re: kvm virtualization in RHEL 5.4 Beta, howto
>>
>>
>>
>>
>>
>>
>>
>> 2009/8/12 Le Wen <wenle at lenovo.com>
>>
>>> Hi there,
>>>
>>>    I don't know what to do in RHEL5.4, but in RHEL5.3, using
>>>
>>>     qemu-img create -f qcow /vm/vdisk.img 20G
>>>
>>>    to create the virtual disk
>>>
>>>   qemu-kvm -hda /vm/vdisk.img -cdrom /vm/iso/w2k3.iso -boot d  -m  
>>> 1024
>>>
>>>     to create the virtual machine,
>>>
>>>     and finally, using
>>>
>>>   qemu-kvm /vm/vdisk.img -m 1024
>>>
>>>    to boot the installed vm.
>>>
>>>
>>>
>> Hi Len,
>>
>> I´m totally overwhelmed with your answer.
>>
>> The use of kvm is one of the great, great news in RHEL, in fact, it´s
>> still
>> in Beta. So I don´t understad how you can use it on 5.3.
>>
>> on the other hand I don´t have the qemu-kvm command in my RHEL 5.3
>> systems.
>> (the qemu commands comes with the supplementary packages but I don 
>> ´t have
>> the kvm command)
>>
>> How do I install the qemu-kvm command?
>>
>> Thanks for your answer,
>>
>> ESG
>>
>>
>>
>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ESGLinux <esggrupos at gmail.com>
>>> Sent by: redhat-list-bounces at redhat.com
>>> 2009-08-12 15:35
>>> Please respond to
>>> General Red Hat Linux discussion list <redhat-list at redhat.com>
>>>
>>>
>>> To
>>> General Red Hat Linux discussion list <redhat-list at redhat.com>
>>> cc
>>>
>>> Subject
>>> Re: kvm virtualization in RHEL 5.4 Beta, howto
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Hi Thomas,
>>> thanks for your answer.
>>>
>>> When I run virt-manager (as I do with xen) and try to use kvm I  
>>> dont see
>>> this option anywhere.
>>>
>>> When I try to add a connection the hypervisors avaliable are xen and
>> qemu
>>> (like with previous version of RH)
>>>
>>> How I build the kvm guest (sorry if this is a silly question, but I
>> don´t
>>> see how to make it)
>>>
>>> Thanks,
>>>
>>> ESG
>>>
>>> 2009/8/11 Thomas von Steiger <thomas.vonsteiger at bluewin.ch>
>>>
>>>>
>>>> On 11.08.2009, at 15:02, ESGLinux wrote:
>>>>
>>>> Hi all,
>>>>> I have installed the RHEL 5.4  Beta (see the press
>>>>>
>>>>>
>>>
>>>
>>
>> http://press.redhat.com/2009/07/02/red-hat-enterprise-linux-5-4-beta-now-available/?sc_cid=70160000000Hv6dAAC
>>
>>>
>>>>> )
>>>>>
>>>>> and I want to test KVM virtualization, but I don´t know how to  
>>>>> test
>>>>> because
>>>>> I´m totall newbie to this kind of virtualization.
>>>>>
>>>>> I have installed the KVM group from pirut, but I dont see how to  
>>>>> test
>>> it.
>>>>>
>>>>> someone knows a good KVM-howto and the utilities that comes with  
>>>>> RHEL
>>> 5.4
>>>>> Beta for manage it?
>>>>>
>>>>
>>>>
>>>> You can use virt-manager, virsh, virt-viewer from rhel5.4 beta to
>> build
>>> kvm
>>>> guests.
>>>>
>>>> Thomas
>>>>
>>>> --
>>>> redhat-list mailing list
>>>> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
>>>> https://www.redhat.com/mailman/listinfo/redhat-list
>>>>
>>> --
>>> redhat-list mailing list
>>> unsubscribe mailto:redhat-list-request at redhat.com? 
>>> subject=unsubscribe
>>> https://www.redhat.com/mailman/listinfo/redhat-list
>>>
>>> --
>>> redhat-list mailing list
>>> unsubscribe mailto:redhat-list-request at redhat.com?subjectunsubscribe
>>> https://www.redhat.com/mailman/listinfo/redhat-list
>>>
>> --
>> redhat-list mailing list
>> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
>> https://www.redhat.com/mailman/listinfo/redhat-list
>>
>> --
>> redhat-list mailing list
>> unsubscribe mailto:redhat-list-request at redhat.com?subjectunsubscribe
>> https://www.redhat.com/mailman/listinfo/redhat-list
>>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list





More information about the redhat-list mailing list