lost and found ( for me ? )

Fedora 15 : install KVM and fly WIndows XP as a guest VM


Here’s an explanation of how to install KVM in Fedora 15.
[root@f15 ~]# cat /etc/redhat-release
Fedora release 15 (Lovelock)
[root@f15 ~]# uname -r
2.6.40.4-5.fc15.i686
[root@f15 ~]# qemu-kvm --version
QEMU emulator version 0.14.0 (qemu-kvm-0.14.0), Copyright (c) 2003-2008 Fabrice Bellard

Before installing KVM , check your CPU supports the VT technology.
[root@f15 ~]# egrep '(svm|vmx)' /proc/cpuinfo | uniq
flags    : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm dts tpr_shadow vnmi flexpriority

Intel CPU : vmx
AMD CPU : svm

Install KVM and other recommended packages via yum.
[root@f15 ~]# yum install kvm virt-manager libvirt libvirt-python python-virtinst

start libvirtd if you have not started it.
[root@f15 ~]# /etc/init.d/libvirtd start
Starting libvirtd (via systemctl):                      [  OK  ]

If you have enabled SElinux , store VM images under /var/lib/libvirt/images/ directory.
By default , SElinux assings the security labels to VM images and processes dynamically.
 <seclabel type='dynamic' model='selinux'>
<label>system_u:system_r:svirt_t:s0:c515,c855</label>
<imagelabel>system_u:object_r:svirt_image_t:s0:c515,c855</imagelabel>
 </seclabel>

As for VM image files , SElinux assings system_u , object_r and svirt_imagte_t to a VM
[root@f15 ~]# ls -lZ /var/lib/libvirt/images/WinXP.img
-rw-------. qemu qemu system_u:object_r:svirt_image_t:s0:c515,c855 /var/lib/libvirt/images/WinXP.img

Regarding kvm processes , SElinux assings system_u , system_r and svirt_t to a VM.
[root@f15 ~]# ps -eZ | grep qemu-kvm
system_u:system_r:svirt_t:s0:c515,c855 6037 ?  00:11:47 qemu-kvm

Install WIndows XP as a guest VM
Application -> System tool -> start virt-mangeer



Installing Win XP




That’s it.


virsh # list --all
Id Name              State
----------------------------------
 3 WinXP             running

virsh # qemu-monitor-command --hmp WinXP 'info network'
Devices not on any VLAN:
 hostnet0: fd=21 peer=net0
 net0: model=rtl8139,macaddr=52:54:00:5e:3c:85 peer=hostnet0

virsh # qemu-monitor-command --hmp WinXP 'info block'
drive-ide0-0-0: type=hd removable=0 file=/var/lib/libvirt/images/WinXP.img ro=0 drv=raw encrypted=0
drive-ide0-1-0: type=cdrom removable=1 locked=0 file=/dev/sr0 ro=1 drv=raw encrypted=0


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.