VNC: Difference between revisions

From CLONWiki
Jump to navigation Jump to search
No edit summary
Boiarino (talk | contribs)
No edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''VNC''' stands for ''Virtual Network Computing package'' and is included into both Solaris and Linux installations.
'''VNC''' stands for ''Virtual Network Computing package'' and is included into both Solaris and Linux installations.
'''Standard DAQ VNC on clon machines'''
As 'clasrun':
To start server (to stop it, replace 'start' with 'stop'):
daqvnc.py -config $CLON_PARMS/vnc/sro.json start - on clonfarm1
daqvnc.py -config $CLON_PARMS/vnc/srodaq3.json start - on clondaq3
To connect to server:
daqvnc.py -config $CLON_PARMS/vnc/sro.json connect
To get help:
daqvnc.py --help (or -h)
''' General information:'''


To start ''vncserver'' do following:
To start ''vncserver'' do following:
Line 12: Line 32:
2. Edit ''boiarino/.vnc/xstartup'': change window manager from ''twm'' to ''startkde'' (for KDE) or to ''exec gnome-session'' (for GNOME)
2. Edit ''boiarino/.vnc/xstartup'': change window manager from ''twm'' to ''startkde'' (for KDE) or to ''exec gnome-session'' (for GNOME)


3. /etc/init.d/vncserver start
3. As root run ''/etc/init.d/vncserver start''
 
4. As root run ''vncpasswd'' and set password
 
5. Make it start automatically at boot time:
/sbin/chkconfig --level 3 vncserver on
/sbin/chkconfig --level 4 vncserver on
/sbin/chkconfig --level 5 vncserver on
/sbin/chkconfig --list | grep vncserver
      vncserver      0:off  1:off  2:off  3:on    4:on    5:on    6:off


4. vncpasswd
6. Since 590X ports blocked by computer center, use tunneling; for example to connect to vncserver running on clontrig0, run following on your desktop:
ssh -L 5902:localhost:5902 clontrig0
and keep it running; type:
vncviewer localhost:5902
enter password and VNC window will shows up.




Line 45: Line 78:


'''SOLARIS 10''':
'''SOLARIS 10''':
Login as ''clasrun'' and the do ''su''.


Download, install and use ''x11vnc'' as following (as 'root'):
Download, install and use ''x11vnc'' as following (as 'root'):


   cd /usr/local/src/x11vnc-0.9.1
   cd /usr/local/src/x11vnc-0.9.13
   ./configure --without-ssl
   ./configure <<<--without-ssl>>>
   gmake
   gmake
   gmake install
   gmake install
NOTE: following line was changed in file 'x11vnc/sslhelper.h' BEFORE running 'gmake':
  /*sergey: undefined symbol, define it here until figure it out ...*/
  /*extern char *certret_str;*/
  static char *certret_str;


Now create password (we assume that x1vnc server will be running as 'clasrun'; it is important that all clon workstations usually logged in as clasrun):
Now create password (we assume that x1vnc server will be running as 'clasrun'; it is important that all clon workstations usually logged in as clasrun):
Line 67: Line 96:
   x11vnc -rfbauth /home/clasrun/.vnc/passwd -display :0.0 -forever -shared
   x11vnc -rfbauth /home/clasrun/.vnc/passwd -display :0.0 -forever -shared
   x11vnc -rfbauth /home/clasrun/.vnc/passwd -display :0.1 -forever -shared
   x11vnc -rfbauth /home/clasrun/.vnc/passwd -display :0.1 -forever -shared
Those commands are collected in script ''$CODA/common/scripts/vnc_start'', run it as ''root'' to start all necessary vnc servers.


Option '-shared' allows more then one client to connect, and '-forever' will prevent server from dying when last client disconnected. Now you can connect from another machine, for example to connect to two 'clon06' screens type follwoing on your machine:
Option '-shared' allows more then one client to connect, and '-forever' will prevent server from dying when last client disconnected. Now you can connect from another machine, for example to connect to two 'clon06' screens type follwoing on your machine:

Latest revision as of 10:45, 15 June 2020

VNC stands for Virtual Network Computing package and is included into both Solaris and Linux installations.

Standard DAQ VNC on clon machines

As 'clasrun':

To start server (to stop it, replace 'start' with 'stop'):

daqvnc.py -config $CLON_PARMS/vnc/sro.json start - on clonfarm1
daqvnc.py -config $CLON_PARMS/vnc/srodaq3.json start - on clondaq3

To connect to server:

daqvnc.py -config $CLON_PARMS/vnc/sro.json connect

To get help:

daqvnc.py --help (or -h)


General information:

To start vncserver do following:

LINUX RHEL5: as 'root' do following:

1. Edit /etc/sysconfig/vncservers, two lines must be uncommented (will be running as boiarino):

VNCSERVERS="2:boiarino"
VNCSERVERARGS[2]="-geometry 1600x1024 -nolisten tcp -nohttpd -localhost"

2. Edit boiarino/.vnc/xstartup: change window manager from twm to startkde (for KDE) or to exec gnome-session (for GNOME)

3. As root run /etc/init.d/vncserver start

4. As root run vncpasswd and set password

5. Make it start automatically at boot time:

/sbin/chkconfig --level 3 vncserver on 
/sbin/chkconfig --level 4 vncserver on
/sbin/chkconfig --level 5 vncserver on 
/sbin/chkconfig --list | grep vncserver
     vncserver       0:off   1:off   2:off   3:on    4:on    5:on    6:off

6. Since 590X ports blocked by computer center, use tunneling; for example to connect to vncserver running on clontrig0, run following on your desktop:

ssh -L 5902:localhost:5902 clontrig0

and keep it running; type:

vncviewer localhost:5902

enter password and VNC window will shows up.


LINUX RHEL4: as 'root' do following:

/etc/init.d/vncserver start
     Starting VNC server:                                       [  OK  ]
vncpasswd
     Password:  
     Verify: 
vncserver
     New 'clonweb:1 (boiarino)' desktop is clonweb:1
     Creating default startup script /root/.vnc/xstartup
     Starting applications specified in /root/.vnc/xstartup
     Log file is /root/.vnc/clonweb:1.log

So what did we do there? First, we started the vncserver service. It may or may not have already been running on your system. Next we set a password to access the VNC desktop. When you set the password, you will not see any characters on the screen, and you must enter the password twice. You will only need to do this the very first time you run vncserver. The password will be saved in the Linux filesystem, and you can change it at any time by invoking the vncpasswd command again. Last, to activate the VNC desktop, we simply invoked the vncserver command. Notice the output; the desktop is named "clonweb:1" which can also be replaced via the machines IP address.

To kill server type:

vncserver -kill :1

NOTE: do we need to do following ??? :

/sbin/chkconfig --level 3 vncserver on 
/sbin/chkconfig --level 4 vncserver on
/sbin/chkconfig --level 5 vncserver on 
/sbin/chkconfig --list | grep vncserver
     vncserver       0:off   1:off   2:off   3:on    4:on    5:on    6:off


SOLARIS 10:

Login as clasrun and the do su.

Download, install and use x11vnc as following (as 'root'):

 cd /usr/local/src/x11vnc-0.9.13
 ./configure <<<--without-ssl>>>
 gmake
 gmake install

Now create password (we assume that x1vnc server will be running as 'clasrun'; it is important that all clon workstations usually logged in as clasrun):

 x11vnc -storepasswd

It will create password which will be used by vncviewer. Now start server(s) (one per screen), for example if two monitors connected to the workstation run two servers:

 x11vnc -rfbauth /home/clasrun/.vnc/passwd -display :0.0 -forever -shared
 x11vnc -rfbauth /home/clasrun/.vnc/passwd -display :0.1 -forever -shared

Those commands are collected in script $CODA/common/scripts/vnc_start, run it as root to start all necessary vnc servers.


Option '-shared' allows more then one client to connect, and '-forever' will prevent server from dying when last client disconnected. Now you can connect from another machine, for example to connect to two 'clon06' screens type follwoing on your machine:

 vncviewer clon06:0
 vncviewer clon06:1

If running 'vncviewer' from Solaris but from non-solaris terminal it maybe useful to specify flag '-bgr233' to get better colors.



TRIED, DID NOT WORK:

Tell dtlogin to run Xvnc rather than the normal X server:

 # mkdir /etc/dt/config
 # cat >/etc/dt/config/Xservers <<EOF
 :0   Local local_uid@none root /opt/csw/bin/Xvnc :0 -geometry 1024x768 -depth 24
 EOF
 #

Restart dtlogin:

 # /etc/init.d/dtlogin stop
 # /etc/init.d/dtlogin start
 #

After a couple of seconds, it’s worth checking that Xvnc is actually running:

 # ps -ef | grep Xvnc
   root 102525 102484   0 15:48:15 ?           0:00 /opt/csw/bin/Xvnc :0 -auth /var/dt/A:0-7Zavqg
 # 
==========

[Apr 2, 2007] Solaris 10, gcc and VNC server by jalzabrewer

May 28, 2005 (forum.java.sun.com) VNC is on the SUN Supplimental SFW disk for Soalris 10 system SFWvnc vnc - Virtual Network Computing. Here is my implementaion using dtlogin xdm login feature of broadcast, if any one comes up with a way to use sse, let me know!

1. pkgadd -d . SFWvnc

2. Add to /etc/services

nc1024 stream tcp nowait root /usr/local/bin/Xvnc-1024 Xvnc-1024

3. Add to /etc/inetd.conf

vnc1024 stream tcp nowait root /usr/local/bin/Xvnc-1024 Xvnc-1024

4. Create /usr/local/bin/Xvnc-1024 script , perm 755.

  1. !/bin/sh

/opt/sfw/bin/Xvnc -inetd -broadcast -once -geometry 1024x768 -depth 8


5. Stop dtlogin

/etc/init.d/dtlogin stop

6. [Restart indentd] kill -HUP inetd-pid

7. Start dtlogin

/etc/init.d/dtlogin start

8. /usr/sbin/shutdown -y -g0 -i6 to test startup.

9. svcs should show:

bash-3.00# svcs |grep vnc

online 16:06:49 svc:/network/vnc1024/tcp:default

Have fun!


[Apr 2, 2007] VNC on Solaris 10 Installing and configuring VNC from the software companion CD

Solaris 10 can be downloaded from sun’s web site. Also available from the download pages is an image of a “Software Companion CD”.

This CD contains extra freeware products which can be added post-installation. One of these is the excellent Virtual Network Computing (VNC) package.

VNC allows remote desktop access to computers over a network. It can be used between Microsoft and Unix/Linux operating systems.

Insert the Solaris Companion CD and allow the volume management daemon to mount it. There are three packages which are required. In this example they are converted into package datastreams on the hard disk:

  1. cd /cdrom/cdrom0/sparc/Packages
  1. pkgtrans . /opt/SFWgcmn.pkg SFWgcmn
  1. pkgtrans . /opt/SFWgcc34l.pkg SFWgcc341
  1. pkgtrans . /opt/SFWvnc.pkg SFWvnc

[Mar 24, 2007] freshmeat.net Project details for Enhanced TightVNC Viewer

Enhanced TightVNC Viewer 1.0.14 released

The Enhanced TightVNC Viewer package is part of the x11vnc VNC server project. It provides a native VNC viewer that takes advantage of new features in x11vnc, e.g. cursor alpha blending and automatic SSL tunnelling. Some features apply to any VNC server, e.g. automatic SSH tunnelling. Another goal is to provide a package that conveniently bundles everything needed for the user to have the enhanced viewer running quickly. This includes pre-built binaries of the viewer and utility programs for Windows and many Unix variants, and a GUI to configure and launch the viewer. The short name for this project is "ssvnc", for SSL/SSH VNC viewer. Release focus: Minor bugfixes

Changes: Using port numbers lower than VNC's default port (5900) now works on Windows (for example, myhost.com:443).

Author: Karl Runge [contact developer]

[Feb 20, 2007] VNC on Solaris 10

A good explanation of details

Insert the Solaris Companion CD and allow the volume management daemon to mount it. There are three packages which are required. In this example they are converted into package datastreams on the hard disk:

  1. cd /cdrom/cdrom0/sparc/Packages
  2. pkgtrans . /opt/SFWgcmn.pkg SFWgcmn
  3. pkgtrans . /opt/SFWgcc34l.pkg SFWgcc341
  4. pkgtrans . /opt/SFWvnc.pkg SFWvnc

Add the three packages in the following order:

  1. cd /opt
  2. pkgadd -d SFWgcmn.pkg
  3. pkgadd -d SFWgcc34l.pkg
  4. pkgadd -d SFWvnc.pkg

Xwindows is configured with text files under /usr/dt but these shouldn’t be modified, make copied of them under /etc/dt and modify the copies.

  1. mkdir -p /etc/dt/config
  2. cp /usr/dt/config/Xservers /etc/dt/config/
  3. cp /usr/dt/config/Xconfig /etc/dt/config/
  4. cp /usr/dt/config/Xsetup /etc/dt/config/

Edit the /etc/dt/config/Xservers to configure the extra connections to Xwindows. The :0 server is the default one which you log in to locally. In this example one extra connection is being configured:

  1. vi /etc/dt/config/Xservers
  :0   Local local_uid@console root /usr/X11/bin/Xserver :0 -nobanner
  :1   Local local_uid@console root /opt/sfw/bin/Xvnc :1 -httpd /opt/sfw/vnc/classes -depth 16 -geometry 1024x768 -r fbwait 120000 -rfbauth /opt/sfw/vnc/.vnc/passwd -rfbport 5901 -httpport 5801 -fp tcp/localhost:7100 -alwaysshared

There are only two lines in my example file, it has just word wrapped on this web page. Here are some of the important options:

-depth 16

This is the colour depth. An 8bit colour depth uses less network bandwidth but looks a bit blocky.

-geometry 1024x768

Choose whichever resolution you want. Yes, that is an “x” between the two numbers not an “*”.

-rfbport 5901

The port number for the client to connect to. Each different server must use a different port number. For example :1 uses 5901 and :2 could use 5902

-httpport 5801

You can point a web browser at the Unix host with this port number and get a java based connection to the Unix host. For example:

http://10.0.0.1:5801

Configure a password, this is prompted for before the user sees a login screen.

  1. HOME=/opt/sfw/vnc
  2. export HOME
  3. mkdir $HOME/.vnc
  4. /opt/sfw/bin/vncpasswd

Password: password Verify: password

To enable vnc to start when dtlogin does, uncomment the Dtlogin*grabServer line in /etc/dt/config/Xconfig or do this sed command which will do the same thing:

  1. sed '/Dtlogin\*grabServer/s/^#//' /etc/dt/config/Xconfig >/tmp/Xconfig
  2. mv /tmp/Xconfig /etc/dt/config/Xconfig

This would work but the fonts will not be right. Add the font server to the /etc/inetd.conf and convert it into a new SMF managed network service:

  1. echo "fs stream tcp wait nobody /usr/openwin/lib/fs.auto fs" >>/etc/inetd.conf
  2. inetconv

That should be it! I rebooted here but I think you should be able to get away with hupping the inetd and stopping and restarting dtlogin:

  1. pkill –HUP inetd
  2. /etc/init.d/dtlogin stop
  3. /etc/init.d/dtlogin start

Any time you change the /etc/dt/config/Xservers file, you will need to stop and restart dtlogin. In previous versions you could just /usr/dt/bin/dtlogin –reset but it doesn’t seem to work in Solaris 10.

Java Desktop

There is a bug which will prevent text being entered in terminal windows in the Java Desktop. This can be solved by modifying the file shown below:

  1. cd /etc/gconf/gconf.xml.defaults/apps/gnome_settings_daemon/keybindings/
  2. mv %gconf.xml %gconf.xml.orig
  3. vi %gconf.xml

<gconf>

       <entry name="volume_up" mtime="1110896708" type="string">
       <stringvalue></stringvalue>
       </entry>
       <entry name="volume_mute" mtime="1110896705" type="string">
       <stringvalue></stringvalue>
       </entry>
       <entry name="volume_down" mtime="1110896702" type="string">
       <stringvalue></stringvalue>
       </entry>
       <entry name="help" mtime="1110896698" type="string">
       <stringvalue></stringvalue>
       </entry>

</gconf>

The next time you log in to a Java Desktop, it will work.