Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
cancel
Showing results for 
Search instead for 
Did you mean: 

Doubt in Display env variable

Nirmalkumar
Frequent Advisor

Doubt in Display env variable

Hi all,

We are using VNC viewer tool to see the UNIX GUI mode.In vnc viewer our unix guys configured one server(say server A) in VNC viewer.i login to serverA through VNC viewer and then i login into another server (Say ServerB)by giving ssh uname@serverB.After login in to serverB i couldnt able to see the GUI mode screen of ServerB.

For this issue what is the value of DISPLAY variable i have to set in environment variable.

Note:1.The Vncviewer is installed in my local desktop machine.

Help appericiated...

Thanks,
Nirmal.


2 REPLIES
Patrick Wallek
Honored Contributor

Re: Doubt in Display env variable

Before ssh'ing over to server do an 'echo $DISPLAY' and note what it's value is. Now do an 'xhost +serverb'.

After you successfully connect to serverb, set you DISPLAY to whatever the output was of the echo statement above.

For example:

On servera

servera$ echo $DISPLAY
DISPLAY=servera:0.1
servera$ xhost +serverb
servera$ ssh serverb
Now you are connect to serverb
serverb$ export DISPLAY=servera:0.1
Srimalik
Valued Contributor

Re: Doubt in Display env variable

I will give you three options:

1) use : "ssh -X uname@server2" from server1

the will automatically set the DISPLAY variable so that the screens are displayed on server1.

They will be visible to you as using vnc viewer.


2) you can directly connect to server2 using putty(ssh protocol) from your PC (no need to go through server1)
before connecting through putty please enable X11 tunneling
no need to set the DISPLAY manually

3)Install a X server on your PC
connect to server2 using telnet
export the DISPLAY to :0.0
eg export DISPLAY=10.211.14.21:0.0
start an x command (gnome-session will start the desktop)

cheers
Srikrishan





abandon all hope, ye who enter here..