Tuesday, July 28, 2009

Connecting to Solaris from Windows via GUI

Had an interesting dilemma recently that I thought I would immortalize into a blog post, as it took me a few days (on and off) to overcome. All applications used/mentioned are open source.

I am using an application called Jmeter to Load Test a web application. We procured a remote box from which to run Jmeter, b/c we discovered that if I run Jmeter from within the company network I could get false readings and/or slow down other business critical applications in use. The remote box I was given to generate the Jmeter load is running on Solaris 10 with a desktop environment installed. Solaris is ok in this case since Jmeter is pretty much O/S independent. To fully utilize Jmeter's listening features though, I need to open and run it in GUI mode from this remote box (as opposed to running it from command line).

The task:
Connect to the Solaris box from my Windows lapt
op in GUI mode, and run the Jmeter GUI.

It would be great if I could just use Window's Remote Desktop application to connect, but that would be too easy (and it doesn't work in this case). I need to use an X Window manager to accomplish this task.

First step, I made sure I could establish an SSH connection to the remote box. I use PuTTY for quick SSH connections, which is a quick and easy (and free) SSH client.

Next, I downloaded and installed XWinLogon (Download | Documentation), which is a simple and free interface to the X Server which allows you to connect to a Unix/Linux box from your Windows computer. Once connected (I selected SSH to connect), it runs another application called Cygwin/X which allows you to use applications from the Unix/Linus box via GUI on your Windows machine.

Cygwin/X comes installed already with XWinLogon, so no need to install it separately (in fact, they recommend you do not). Here are some info links to Cygwin/X nonetheless: (User Guide | FAQ)

Finally, I needed to install Jmeter on the Solaris machine. Fortunately installing Jmeter is as simple as moving files over - which I accomplished using SFTP via FireFTP. Make sure you put it in a folder you have admin rights to and can easily get to via SSH command line.

Ok now for the fun:
  1. Open XWinLogon and connect to the remote box (fig 1)
  2. A Cygwin/X window should open, asking for a password. Enter it. (fig 2)
  3. You should be logged in now at the SSH command line. Navigate to your Jmeter directory and run Jmeter. (Common SSH Commands)
Your commands may look something like this:
user@machine01$ cd jakarta-jmeter-2.3.4
user@machine01$ cd bin
user@machine01$ sh jmeter

The Jmeter GUI should display (running on the remote box though) and you should be able to use it with your mouse and keyboard. Hurray!!!! (fig 3)

Note, however, that the GUI (fig 3) is not as stable and user friendly as you might be used to in a Windows environment for instance. Also, the connection to the remote box could be delayed, making actions (like mouse clicks) take several seconds to register. Be patient and deliberate so as to not make any mistakes and get stuck. It is advisable that you create your Jmeter scripts from a more stable platform (like directly on your Windows machine) and then transfer the .jmx files to the remote box, using Jmeter on the remote box ONLY to run and view the scripts.

fig 1

fig 2

fig 3


  1. I was looking to do exactly the same thing and was stuck for several days. Your post helped me a lot.