opennode-os

KVM Guest virt-install examples with virtio drivers

As a GUI alternative its possible to use virt-manager application for KVM VM installs. Please see this howto for more details: KVM VM management with virt-manager GUI tool

####Windows Server 2008 R2 KVM Guest VM install example

# Place WinServ ISO into /storage/local/iso/
# Download VIRTIO driver iso image to use during install
cd /storage/local/iso/
wget http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/virtio-win-0.1-52.iso

# Pre-create VM disk image
qemu-img create -f qcow2 -o preallocation=metadata /storage/local/images/winserv1.qcow2 50G

# Launch installation inside screen
screen
virt-install --connect qemu:///system --name WinServ1 --ram 2048 --vcpus 2 \
--disk path=/storage/local/images/winserv1.qcow2,format=qcow2,bus=virtio,cache=none \
--disk path=/storage/local/iso/virtio-win-0.1-52.iso,device=cdrom \
--cdrom /storage/local/iso/winserv.iso \
--network=bridge:vmbr0,model=e1000 \
--vnc --os-type=windows --os-variant=win2k8 \
--noautoconsole --accelerate --noapic --keymap=en-us
# Detach screen
CTRL+A+D

# Run virt-manager for VNC display (make sure you have X forwarding enabled on your ssh session for remote display)
virt-manager
# OR
virt-viewer -c qemu:///system WinServ1

####RHEL6 (CentOS6) KVM Guest VM install example

# Pre-create VM disk image
qemu-img create -f qcow2 -o preallocation=metadata /storage/local/images/centos6vm.qcow2 10G

# Launch installation inside screen
screen
virt-install --connect qemu:///system \
--name centos6vm --ram 1024 --vcpus 1 \
--disk path=/storage/local/images/centos6vm.qcow2,format=qcow2,bus=virtio,cache=none \
--network=bridge:vmbr0,model=virtio --vnc --os-type=linux --os-variant=rhel6 \
--cdrom /storage/local/iso/centos63-x86_64.iso --accelerate --noautoconsole --keymap=en-us
# Detach screen
CTRL+A+D

# Run virt-manager for VNC display (make sure you have X forwarding enabled on your ssh session for remote display)
virt-manager
# OR
virt-viewer -c qemu:///system centos6vm