Saturday, May 28, 2011

Installing Fedora 15 to support SPICE on QEMU KVM accessing using Virt-Manager

The primary purpose of this blog entry is to provide a platform to run virtual desktops using QEMU-KVM and SPICE with Bridged Networking on Fedora 15.  The steps below can support Windows XP, Windows 7, Ubuntu 11.04, and Fedora 15 virtual machines.  Other operating systems may work also, these are the only ones I have tried and had success with.
Install Fedora 15 x64 Linux and set a static IP

Install Fedora 15 Updates
Select Activities > Applications > Software Update and click Install Updates

Install QEMU-KVM and supporting SPICE software

Select Activities > Applications > Terminal and run the following
yum -y install qemu-kvm libvirt python-virtinst bridge-utils virt-viewer virt-manager virt-top

After the initial pieces of KVM are installed, run the following install
yum -y install spice-protocol spice-server spice-gtk spice-gtk-python spice-server-devel spice-client spice-vdagent spice-parent spice-gtk-tools tunctl

Enable libvirtd to start automatically
chkconfig libvirtd on

Enable Bridged Networking for Virtual Machine Manager

Select Activities > Applications > Terminal and run the following
service NetworkManager stop
chkconfig NetworkManager off
chkconfig network on

Using gedit, edit the configuration file for the network and enter the bridge information:
sudo gedit /etc/sysconfig/network-scripts/ifcfg-em1
Make the following changes:

Create ifcfg-br0 using gedit
sudo gedit /etc/sysconfig/network-scripts/ifcfg-br0

Insert the following entries:

Turn off the Firewall

Select Activities > Applications > Firewall
Press the Disable button, select Apply, and exit
Select Activities > Applications > Terminal and run the following
/etc/init.d/iptables stop
/etc/init.d/ip6tables stop

Disable SELinux

sudo gedit /etc/selinux/config

Change the SELINUX entry to SELINUX=disabled, save and exit

Turn SSH on

Select Activities > Applications > Terminal and run the following
sudo gedit /etc/ssh/sshd_config

Remove the # character in front of the Port number entry, save and exit
Configure SSH to start
chkconfig sshd on

Upon restarting the computer and coming back up, you are now ready to begin installing VM's using Virtual Machine Manager (virt-manager) GUI, KVM, and SPICE.

Select Activities > Applications > Virtual Machine Manager and login.

You will want to turn your Firewall and SELinux back on.

Magnus Weblog
Blog of Lubos Kocman
Xen Virtualization on Linux and Solaris
SPICE Drivers for Windows
Montana Linux
KVM Linux Resources