I would like to use Xming to connect a server and managed to get it to work. I am now trying to get it to connect to a different server but i am not sure which X Window system is installed. I tried it through putty and i get the following error/warning:
/usr/java/jdk1.7.0_67/bin> jvisualvm
/usr/java/jdk1.7.0_67/lib/visualvm/platform/lib/nbexec: WARNING: environment variable DISPLAY is not set
I have previously used a windows BAT script to launch XWindows - Shown below:
@echo off
SET LOCAL_HOST=localhost
SET PATH=C:\wresourcex\bin\Xming
SET REMOTE_HOST=%1
SET SCREEN=%2
REM Default to archie with screen 1
if "%1"=="" SET REMOTE_HOST=MySever.com
if "%2"=="" SET SCREEN=0
SET DISPLAY=%LOCAL_HOST%:%SCREEN%.0
REM For XDM logon just run this line
REM run Xming -query %REMOTE_HOST% -lesspointer -emulate3buttons
REM For SSH Tunneling use these 2 lines
rem run Xming :%SCREEN% -lesspointer -notrayicon -emulate3buttons
run plink -ssh -X %REMOTE_HOST% /usr/dt/bin/Xsession
REM Use this if want Gnome instead
rem run plink -ssh -X %REMOTE_HOST% /usr/bin/gnome-session
The above works in one server but not on the one i am using now. I have looked at both the /usr/dt/bin/ and /usr/bin folders and both program (referred to in the script) do not exist in those locations. I am guessing that i need to use a different program but how do i know which "Xwindow" program is installed on the server i want to connect to or does it matter?
Note - I do not have admin access on the server so cannot install anything.
Probably none. You do not need an Xserver installed on your server, only on your client. An Xserver is a sort-of driver software for your graphics hardware and you need that only where you have such a hardware. XMing is such an Xserver software.
Then set it! On the shell prompt enter:
# export DISPLAY=<IP-address of your client>:0.0
Then try to start an Xclient (like "xterm"). You might have to allow the sever in question to display a window on your Xserver (in UNIX there is the "xhost" tool to do so, what XMing uses instead i do not know). Issue:
# xterm &
And see if this opens a window on your screen. If everything works you can put the line with the DISPLAY variable setting into your profile or your shells rc-file (for you: kind of AUTOEXEC.BAT-analogon on UNIX) so that you do not have to enter the line for every new session.