Citrix Logo

Web interface with Java console for XenServer (and Xen Cloud Platform)

by nc on December 4, 2009 · 2 comments

One of the things that is nice with the release of Xen Cloud Platform (which I mentioned previously) is Project XVP. As the site mentions, it has four major components – xvp (a VNC proxy to allow you to connect to the console of a VM hosted on XenServer or Xen Cloud Platform), xvpviewer (TightVNC’s Java client extended to support XenServer-specific functions), xvpweb (a simple web interface to manage your VM’s), and xvpdiscover (an app to build a config file suitable for xvpweb and xvp.)

The executive summary is that there is now an open-source project available to get console access to XenServer machines – without the need for XenCenter on Windows. I believe this is also the only method to get access to the console on Xen Cloud Platform machines, but would love to be proven wrong. ;)

I followed the directions provided at the xvp page to build the RPM’s.. I was building on a CentOS 5.0 x64 system (I’m usually a Debian user and this was a spare VM I had laying around), and while building libxenserver, ran into the following errors:

/usr/bin/ld: skipping incompatible /usr/lib/ when searching for -lgssapi_krb5
/usr/bin/ld: skipping incompatible /usr/lib/libgssapi_krb5.a when searching for -lgssapi_krb5

It looks like older versions of RHEL/CentOS5 on 64-bit put the wrong development libraries in /usr/lib, gah! This page has one method of fixing this; the other is to remove the devel packages, and re-install only the 64-bit versions.. RHEL/CentOS bugs me on 64-bit since they install both 32-bit and 64-bit versions of stuff in the same areas, sigh.

In any case, after fixing the dev libraries, the xvp SRPM built as expected. Be sure that you have the CentOS ‘Extras’ repo enabled (needed for php-mcrypt), and install the RPM’s generated.

To generate a config file, you can run the ‘xvpdiscover’ command. It will prompt you for a hostname, username, and password (these are creds for a XenServer host), vnc password (this is a password needed to VNC in), and output file. Save the output to /etc/xvp.conf, and make sure the permissions are set so that your web server can access it. Once this is done, fire up xvp with ‘/etc/init.d/xvp start’.

After doing this, when I tried to hit the web page. I got a blank page back, and the Apache error log shows:

PHP Parse error: syntax error, unexpected T_STRING in /var/www/html/xvpweb/index.php on line 35

Turns out that CentOS leaves short_open_tags turned on by default. Edit /etc/php.ini, and change ‘short_open_tag = On’ to ‘short_open_tag = Off’, and restart Apache.

After doing that, I hit the web page again, and after a few moments, a list of all the VM’s along with their status popped up. There is a small Console icon by each VM, click it, and you’ve got the console. The console gives you simple operations such as shutting down the VM, rebooting the VM, etc. Nice!

The web interface is actually not necessary at all if you just want to use a raw VNC client and don’t care about those extra functions – you can check /var/log/xvp.log once xvp is started, and get the VNC port number for each VM. Then you can use your favorite VNC client to connect.

Things I’d love to see in the future:

  1. Automatic reconfiguration — if you add or remove a VM right now, you will need to regenerate the config file. You can do this via cron, but it’d be nice if it could happen dynamically.
  2. Ability to authenticate both the web page and the VNC passwords against the XenServer database. I guess VNC password doesn’t matter if you never manually connect to VNC, but it would be great to not have to configure authentication sources in two different places.
  3. Ability to see tags, descriptions, etc in the web interface, and sort in various ways (next item down covers this, though.)
  4. The web interface is very, very basic. It’d be nice to see other simple features integrated – IE, reboot, live migrate, etc. Shouldn’t be hard at all to do, just needs someone to do it.
  5. It would also be nice to see the web interface extended to fully replace XenCenter, at least for monitoring functions (ie, graphing, etc.). That will take a lot of development. ;) I’d love to be able to delete XenCenter (and my Windows VM).
  6. Debian or Ubuntu packages. ;) This would not be difficult at all.

In any case, this means I no longer have to fire up a Windows VM just to access the consoles of my XenServer VM’s, which is very much appreciated!

{ 2 comments… read them below or add one }

Colin Dean December 16, 2009 at 2:38 pm

Nate: Much of what you’d like to see from xvp in the future is already on my To Do list. Most of the work so far has gone into the underlying architecture, so yes the web interface is very basic right now, and authentication not as well integrated as we might like. However, time permitting, and if there’s enough interest, I’m hoping to continue to develop xvp next year. Colin.


nc December 16, 2009 at 2:39 pm

Very glad to hear it!! If I end up with some spare time on my hands over the holidays, I’ll take a gander at the source too.. hey, anything can happen, right? :)

Thanks for the comment — oh, and for the great product. ;)


Leave a Comment

Previous post:

Next post: