If you are running your development environment on a virtual machine (whether by Vagrant, a custom local Virtual Machine or a server elsewhere in vSphere or in the cloud) you may want to run Selenium tests on your code, but have no way to do it as your development environment is headless. On the other hand, you have Selenium Server on your desktop/workstation, but it does not have the software installed to run your application.

You can create a reverse SSH tunnel from your development environment to your desktop/workstation, so that your tests execute on your development environment, but Selenium runs on your desktop/workstation.

To get this to work, first download Selenium Server and make sure Selenium Server is running on your desktop (this assumes on the standard port 4444) via something like this

java -jar selenium-server-standalone-2.40.0.jar

Then create a reverse SSH tunnel to your development environment (hostname)

ssh -R 4444:localhost:4444 hostname -l username

This will route any traffic on port 4444 on your development environment back to your desktop, which is this case is to Selenium Server. If this is working, if you still have the terminal open where you ran Selenium Server you should see some output when the commands are being triggered