ubuntu 14.04 - How could I ssh to vncserver session -


i want launch web page tests, use selenium run test on firefox.

in meantime want use vnc viewer see progressing tests.

but don't want type commands in vnc viewer. ssh vnc session, can launch test via putty or other ssh clients.

for example, if type firefox command can see browser opening in viewer.

thanks

long post warning!

here think asking:

  • you have instance of vnc server running on selenium.
    • this instance controlled either script on selenium, or other vnc client.
    • this instance has virtual frame buffer , xwindows session can run test on.
  • then want 2 kinds of connections
    • a command entry capability, ssh shell on terminal of x-session on selenium box
    • a viewing capability from putty-based system can start , stop without affecting running of programs on selenium box. assume viewer windows system because putty runs on.

this requires set 4 things.

1) session on selenium box; 2) putty based vnc tunnels 3) control vnc session, , 4) viewer sessions.

1) need xvnc session on selenium box. going want start using vncserver because lot of things you. pick unused vnc port (they in range of 5900 + display number). provide display number (e.g., :2), geometry, (i find have provide depth), , security, argument localhost.

this makes command this:

vncserver :2 -geometry 1280x1024 -depth 24 -localhost -alwaysshared 

if first time have run command, ask password, , default password use 1 -way encryption , stored in home directory, ~/.vnc/passwd . (check man pages permissions required.) again, if first time, vncserver script setup 1 more file, , every time start creates 2 new files: (.log , .pid).

  • xstart shell script starts x session in virtual frame buffer. if provide reference - touchy, , seems different on each system. complicated using files off home directory. recommend having different user in space can run these tests. more have success xstart file provided vncserver
  • hostname:session.log contains output of commands xstart script. can handy figure out going wrong.
  • hostname:session.pid contains process id of xvnc server vncserver -kill :2 knows kill.

2) need set putty tunnels. putty can connect using ssh remote selenium box. sounds if have used before, show how make tunnels local host server box. these 2 pictures below putty configuration screens make have tunnels.

putty -> configuration -> ssh -> auth (where tell private key is.

putty -> configuration -> ssh -> auth (where tell private key is

this enter port names tunnels - entries set add remote:5902 <-> localhost:5901

this enter port names tunnels - entries set add remote:5902 <-> localhost:5901

3) set control connection have 2 choices.

  1. you can set display variable in putty terminal

bash % export display=:2
bash % firefox &

  1. once have tunnels , running, can connect both command vnc client , viewing vnc client. use tightvnc on windows, , works fine. note instead of giving name of remote host in tightvnc, provide connection localhost:2 shown in picture below:

use red circled configuration button following menu - note use hostname 'localhost'

use red circled configuration button following menu

the 2 red circles show how 2 options want set

the 2 red circles show 2 options want set. control connection, uncheck view checkbox.

** 4) viewing connection! ** set same way option 2 above, check view checkbox.

in both cases want check request shared session

let me know how works you.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -