Learning a little Xen on CentOS 5 Beta
I got a bit farther with Xen this time. I did another CentOS 5 Beta install and made sure to add the Virtualization package set. It's not like I needed to do another install but I've been doing a few installs just to test out differences with the various package sets.
I originally tried out Xen about a year and a half ago on a Fedora Core 4 host on rather underpowered hardware and a lot has changed since then.
Installing Fedora Core 6 into a Xen Virtual Machine
So there I am, in the graphical desktop on a machine running the Xen kernel. I ran the GUI Virtual Machine Manager again. I went through the various installation steps... give it a name, remote http URL for Fedora Core 6 install tree, creating a disk image, how much RAM (512MB), how many CPUs (1).
A new window appeared for the FC6 install process and I went with the default install which happens to include GNOME and OpenOffice.org... about 2GB of stuff. After about 30 minutes the install was done. That was a pretty silly selection because why would anyone wnat to run a desktop machine in Xen? ...but this is just a test.
One thing I did differently this time though is I added a line to the kernel command in the GRUB setup section:
According to the Release Notes for RHEL5 and CentOS 5 Beta, if you do a para-virtualized OS install (no VT support here)... you have to add
console=xvnc0 as a kernel boot parameter in your virtual machine's GRUB config... if you want to be able to connect to the conole. I didn't notice that little piece of information last time. After the install as done, I clicked on the reboot now button to restart the machine the virtual machine.
Using the xm command
Ok, my machine shutdown after the install but it didn't start back up. Why is that? Well, again... according to the Release Notes, the Virtual Machine Manager doesn't have an equivalent for the
xm create command which is the Xen way to start a virtual machine. Xen stores its configs in
/etc/xen/ and in this case, since I named the machine
devel4 there was a file there named
devel4 which contains the Xen config for the virtual machine. So I read a little more about Xen and decided to do the following:
xm create -c devel4
That starts up the Xen machine and makes a console login prompt appear once the machine has booted. Bingo, it showed up as running in the Virtual Machine Manager. Since I remembered to put
console=xvnc0 into the virtual machine's GRUB parameters, I was able to right-click on the virtual machine's name in the Virtual Machine Manager and select Open. Bingo, a window appeared showing FC6's graphical
firstboot. I went through that and configured everything.
Rather than waiting for graphical login screen to appear... I ssh'ed into the virtual machine, set the default runlevel to be 3 (edited
/etc/inittab) and then did an
init 3... making the graphical login go away. I Then I logged in as the user I had created during
firstboot and I decided to use VNC to try out the graphical desktop so I ran
vncserver. I edited the
~/.vnc/xstartup and changed
gnome-session so it would load GNOME rather than twm. Again, why would one want to run a graphical environment in a Xen machine? They wouldn't... but with VNC one can run a graphical desktop on demand that can easily be accessed remotely.
yum to do system updates and there were approx. 467MB worth. Wow, I really should update my FC6 install tree on the fileserver to be based off of one of the FC6 respins, eh?
If I had to do it all over again
What would I do differently next time? I'd do a minimal install and eliminate runlevel 5 being the default, stopping the graphical boot, and avoid installing a few hundred packages that make up Xorg, GNOME and OpenOffice.org. After all, who wants to run a graphical desktop machine in a Xen virtual machine? Not me. Xen is for servers, right?
How is Xen different from VMware Server?
I'm glad you asked. :) Xen supposedly has a lot less overhead because it uses the hypervisor approach. A para-virtualized guest is an OS that is not only aware it is running in Xen but it has been modified to work better with Xen and as a result should be a lot closer to native OS performance than what VMware can offer. Now having said that, VMware does offer a more advanced product line than the free (as in beer) VMware Server... namely VMware ESX... which IS hypervisor based but retails for about $6,000. Any questions about the differences now?