Thursday, March 25, 2010

KVM: How to Setup KVM on Scientific Linux 5.4 (RHEL54) 64-bit

1. Install SL5.4 x86_64, choosing only GNOME Desktop in the software list;

2. login as root, install the necessary packages

yum upgrade
yum install -y kvm virt-manager libvirt libvirt-python python-virtinst virt-viewer

3. Now we install a SLC54 Client:
  • Prepare a directory for the new VM
mkdir /scratch/SLC54_64_BASE_KVM
cd /scratch/SLC54_64_BASE_KVM
  • Download the SLC54 64bit network install disk
wget ftp://ftp.scientificlinux.org/linux/scientific/54/x86_64/images/boot.iso
  • Create a new VM with name "SLC54_64_BASE_KVM", and a 20GB disk image
virt-install --connect qemu:///system -n SLC54_64_BASE_KVM -r 512 --vcpus=1 --os-type=linux -b virbr0 --arch=x86_64 --disk path=./SLC54_64_BASE_KVM.img,size=20 --vnc --accelerate --disk path=./boot.iso,device=cdrom
  • Now the new VM will boot just follow the instructions to install it

XEN: How to Setup Xen on Scientific Linux 5.4 (RHEL54) 64-bit

1. Install SL5.4 x86_64, choosing only GNOME Desktop in the software list;
2. login as root, install the necessary packages

yum upgrade
yum install -y xen kernel-xen virt-manager libvirt libvirt-python python-virtinst virt-viewer


3. Restart computer and make sure the Xen kernel is booted.

4. Now we install a SLC54 Client:
  • Prepare a directory for the new VM
mkdir /scratch/SLC54_64_BASE_XEN
cd /scratch/SLC54_64_BASE_XEN
  • Download the SLC54 64bit network install disk
wget ftp://ftp.scientificlinux.org/linux/scientific/54/x86_64/images/boot.iso
  • Create a new VM with name "SLC54_64_BASE_XEN", and a 20GB disk image
virt-install --connect xen:///system -n SLC54_64_BASE_XEN -r 512 --vcpus=1 --os-type=linux --os-variant=rhel5 -b virbr0 --arch=x86_64 --disk path=./SLC54_64_BASE_XEN.img,size=20 --hvm --vnc --disk path=./boot.iso,device=cdrom

Now the new VM will boot just follow the instructions to install it