How can I know the display number from the issuing vncviewer side?

Corné Beerse cbeerse "at" gmail.com
Mon Mar 17 21:22:01 2008


Tom Wurgler wrote:
> I have a remote Linix computer setup with free realvnc 4.1.2 server to be
> started via -inetd.  I start the free vncviewer 4.1.2 on my client system and
> VNC comes up on the remote and all works great.  I want to write a script to
> drive all this and start some applications etc and what I need to know (while in
> the script) is the display number that will be used.  How can get at the display
> number inside the script?
>   

Best to do it in 2 ways: first on the desktop, that fires vnc. The 
second part on the server, that fires the remote windows application. 
Either by logging in and start it that way (if you have a login manager 
or such running) or by a dedicated vnc strartup scenario that just 
starts Xvnc and the application you like. Then, you can also use the vnc 
(not so) security.

It will be reasonably hard to send a login sequence to a login box 
inside a vnc session. Maybe you can do that by keystrokes (tab to walk 
the fields and return to select) Doing it by mouse will be proune to 
problems due to slightly changed positions.

If you want to transfer the display number from the remote server to the 
local machine, there is no way that vnc can help you. If your desktop is 
X11 as well (e.g. no msWindows) you should have a look at the ssh 
protocol. That has a pre-defined way to handle X11 trafic from server to 
display, lincluding $DISPLAY transfer and such. And it is a little more 
secure. If security is not an issue, you can also rsh/rlogin and the X11 
protocol itself. Then you have to transfer the local $DISPLAY to the 
remote site, that has been done in many ways.

Success

Corni Beerse


> Thanks!
> _______________________________________________
> VNC-List mailing list
> VNC-List "at" realvnc.com
> To remove yourself from the list visit:
> http://www.realvnc.com/mailman/listinfo/vnc-list
>
>