Problem setting display using vnc viewer


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problem setting display using vnc viewer
# 1  
Old 01-25-2011
Bug Problem setting display using vnc viewer

Hi All,

I am having a linux machine and i used to work on this machine either directly or by using vncviewer from my windows machine. So everytime i launch new terminal on my vnc view i need to set DISPLAY. So i added the following code in my .cshrc

Code:
if ($?VNCDESKTOP == 1) then
setenv DISPLAY  `echo $VNCDESKTOP | awk '{printf $1}'`
else
setenv DISPLAY ${HOSTNAME}:0
endif

So in this code i am checking that if VNCDESKTOP variable is set, so that means i am using vncviewer and set DISPLAY as per Vncviewer i had opened otherwise i am working directly on Linux machine.

Now this code works fine as long as i work on my own machine. Problem is when i did rsh to some other linux machine.

Problem1:
If i do rsh on my linux standalone machine, then HOSTNAME is changed and else part of code is of no use. So i have to hard code this part. Can some one tell me how can i make it work, i searched on net and found some thing about $REMOTEHOST. So can i use this for this problem.

Problem2:
Problem1 however has a workaround that i can hard code display but problem 2 is more severe. When i do rsh using my vncviewer, i found that VNCDESKTOP is not set there. Hence i again need to set it manually. Is there any other variable or way by which i can detect that i am still on vncviewer and can set DISPLAY.

Thanks
Sarbjit
# 2  
Old 01-26-2011
I usually do a new Xvnc on each host, but you can just script something to rsh/ssh/ssh2 to your target host, with you supplying the password or passwordless using .rhosts or pp keys, send on your $DISPLAY and start your nohup xterm. Note that the rsh/ssh will hang unless killed waiting for xterm to finish, but the script can wait a bit and kill that, too, on one end or the other or both, I forget. To free your term, try to put all but the password part in the background.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Solaris

VNC viewer problem

hi all i cant connect to vnc viewer ... when i try it showing follwing error message write/select : connection aborted (10053) Do you wish to attempt to reconnect to 1##.2##.###.1# # help me any one solved before this problem (3 Replies)
Discussion started by: coolboys
3 Replies

2. Linux

Copy Paste in VNC Viewer

hi, I am running a VNCserver on my Fedora VMWare virtual machine. I make a VNCViewer connection to that from my Windows XP box. Can I have copy, paste functionality from Fedora to Windows (2 Replies)
Discussion started by: rakeshgupta
2 Replies

3. UNIX Desktop Questions & Answers

2 questions about VNC viewer

I am using VNC Viewer 4.0 in my windows enviornment. The questions are: 1. how do you switch the applications in VNC enviornment? ALT-tab doesn't work since it just switchs among VNC viewer itself and other windows applications. 2. how to copy/paste the texts from VNC enviornemnt to... (1 Reply)
Discussion started by: princelinux
1 Replies

4. UNIX for Dummies Questions & Answers

maximized vnc viewer

I would like the vnc viewer to be maxized when it is launched. How to implement this. Thanks (0 Replies)
Discussion started by: cy163
0 Replies
Login or Register to Ask a Question