The XenServerConsole – available from the Xen.org git repository – has been updated to include two examples of using the Java VNC applet for accessing XenServer Consoles.

The first example is a stand-alone Java application, which can be tested from the command line (the jar files referenced are available in the XenServerJava download on the SDK download page):

bobba@bobba:~/XenServerConsole$ ls ../XenServerJava/
ws-commons-util-1.0.2.jar xenserver-5.6.100-1.jar xmlrpc-client-3.1.jar xmlrpc-common-3.1.jar
bobba@bobba:~/XenServerConsole$ ant -lib ../XenServerJava/
Buildfile: /home/bobba/XenServerConsole/build.xml
all:
[javac] /home/bobba/XenServerConsole/build.xml:10: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 15 source files to /home/bobba/XenServerConsole
[jar] Building jar: /home/bobba/XenServerConsole/XenServerConsole.jar
[zip] Building zip: /home/bobba/XenServerConsole/XenServerConsole.zip
[zip] Building zip: /home/bobba/XenServerConsole/XenServerConsole-src.zip
BUILD SUCCESSFUL
Total time: 1 second
bobba@bobba:~/XenServerConsole$ java -cp ../XenServerJava/xenserver-5.6.100-1.jar:../XenServerJava/xmlrpc-common-3.1.jar:../XenServerJava/xmlrpc-client-3.1.jar:../XenServerJava/ws-commons-util-1.0.2.jar:. com/citrix/xenserver/console/examples/Standalone

Note that on Windows, the class path needs to be specified using a different format, following the standard Java classpath conventions

java -cp ..\XenServerJava\xenserver-5.6.100-1.jar;..\XenServerJava\xmlrpc-common-3.1.jar;..\XenServerJava\xmlrpc-client-3.1.jar;..\XenServerJava\ws-commons-util-1.0.2.jar;. com/citrix/xenserver/console/examples/Standalone

Enter the XenServer connection details into the dialog and retrieve the list of the running VMs for which you can view the console.

Of course, these instructions work just as well for a Windows guest, but note that to view a Linux GUI you will need to connect to the VNC server provided by that user interface.

The second example, applet_test.py is a cgi script which demonstrates the original use for the applet – embedding it in your management web interface.  Before you can test the cgi example on Windows, you need to sign the JAR file created by the ant build script by following these instructionsprovided by Oracle.

Install the applet_test.py script into the CGI directory of your web server, and put the signed applet in the root of the web server (or update the location in the applet_test script) and then you can connect to the virtual machine using Internet Explorer on Windows.

Note that the applet will load in Firefox on Linux, however there is a known issue in getting focus to the VNC viewer element of the applet – although this can be tested by first clicking on one of the applet buttons followed by moving focus to the VNC viewer.