Softpanorama

May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

VNC on Solaris

News VNC -- The Essential Sysadmin Tool Recommended Links Recommended Articles Viewer Server
Starting VNC server RC scripts The vncserver  modification .Xdefaults Xstartup X11vnc
X11VNC on Solaris Typical  mistakes VNC on Windows VNC on Linux Humor Etc

VNC was originally written for Solaris and Solaris 8, 9 and 10 supports VNC extremely well.  For Solaris 10 X11vnc is also an interesting option and is easier to install an configure, but old good VNC can also be installed.

VNC is heterogeneous client-server application that uses it own protocol. In a way it is similar to Windows Remote Desktop but it can be run for each user and users can have different desktops.  That creates the possibility of implementing cheap and effective "X terminal server" and avoid buying expensive Exceed licenses. The most typical usage of VNC is when the client (VNC viewer) is running on Windows and server on Unix, in our case this is a Solaris server.

Bandwidth can be problem on slow links although much depends on your skills in configuring X (tip:  use 8bit colordepth). VNC works less efficiently on slow lines then Windows Remote Desktop but it does work. For more details see  main VNC page.

You have several options as for viewer on Windows and VNC server on Solaris.

Viewer

As for viewer TightVNC is recommended as a client on Windows. It's perfectly compatible with all existing VNC servers (you do not need to run TightVNC as the server if you are using TightVNC viewer on Windows.

ReadVNC viewer from free version of RealVNC is also good and can be used. It allow you to save sessions parameters in files.

Both are compatible with x11vnc.

NOTES:

Server

If we are are talking about the source the sky is the limit. You can compile TightVNC or whatever server you might want.

If we are talking about precompiled packages that there are three major solutions for VNC server in Solaris:

  1. Solaris 10 Update 5 comes with VNC. Use the version of RealVNC supplied with the Solaris Companion CD. That's the most safe option. It simply works. Please note that like any other package from Companion CD it installs in subdirectories of the /opt/sfw file system rather than in /usr/local. This is a better solution for Solaris 10 due to availability of zones (/usr is usually shared between zones).
  2. Use the version of RealVNC from www.sunfreeware.com (the site does not provide VNC package for Solaris 10, only Xvnc).
  3. Use x11vnc which allows one to remotely view and interact with real X displays (i.e. a display corresponding to a physical monitor, keyboard, and mouse) with any VNC viewer. In this way it plays the role for Unix/X11 that WinVNC plays for Windows. This is the option for those Solaris 10 users who like me have problems making regular VNC to display CDE or other desktops. There are precompiled packages for Solaris 10 on www.sunfreeware.com (the current version is 0.9, not 0.7):

Installation consists of three simple steps:

The vncserver script modification

The script vncserver is a Perl script that serves simultaneously an installation script and optionally can serve as a startup script.

As an installation scrip it creates and populates ~/.vnc directory with several files. The most important of those is xstartup. This directory also stores password for the session. To start VNC you need to launch XVNC with proper environment and parameters.

You can use CDE (launch dtwm manager), GNOME (gnome-session or startgnome) or KDE (startkde) as a windows manager in VNC. Each of them should have proper, verified path -- wrong path is the most common installation mistake people make.

One way to specify windows manager is to edit vncserver Perl script. The variable that specifies the default manager is $defaultXStartup. It contains several parameters and the windows manager is specified at the very end of the value of this variable (usually on the last separate line). In this case when vncserver will run the first time it will create .vnc directory and populate it with files that contain the necessary parameters (the name of the windows manager gores to xstartup).

In you have several windows managers installed then you can modify vncserver Perl script and set one on them to be the default windows manager. Common options include:

  1. CDE (launch /usr/dt/bin/dtwm manager). You need to verify that all the necessary libraries are available in the PATH, so that your environment permit finding of the necessary libraries. Otherwise VNC will run the default windows manager. This is the most common choice and works well in the Solaris environment.
  2. If you have a development machine with GNOME installed then you can use gnome-session or startgnome. Please remember that GNOME 2.x is a classic example of bloatware and as such might be not a good choice for production server, especially if you expect several user simultaneously use VNC, although it is nice on desktop or workstation. The main advantage for development is that installation of Gnome provides most libraries necessary for other applications and thus simplifies the usage of many interesting open source applications making Solaris much more "linux compatible".
  3. KDE (startkde). KDE is pretty rare on Solaris.

Here is an example, where vncserver Perl script was edited to set the default windows manager to CDE ("safe choice"):

$defaultXStartup
= ("#!/bin/sh\n\n".
"[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n".
"xsetroot -solid grey\n".
"xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n".

"/usr/dt/bin/dtwm &\n");

Typical installation mistakes:

If you still want bloated Gnome 2.0 as your desktop here is an example (gnome-session should in your path or you need to specify the directory; you can use gnome-session instead of startgnome; ensure the correct path and that all the necessary libraries are present in the path):

$defaultXStartup = ("#!/bin/sh\n\n". "xrdb \$HOME/.Xresources\n". "xsetroot -solid grey\n"

. "xterm -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n"

. "/opt/gnome-1.4/bin/gnome-session &\n");

See VNC on Solaris 10 for details necessary for gnome in case it is also your default desktop (do not use the ksh installation script provided -- it makes several assumptions and perform actions without proper verification if the conditions for those actions are present on your system).

Running vncserver script

After that you can run vncserver script and it will ask you for the session password. this password will be used by VMS to connect you and is independent of password for your user account (although it is logical to make them the same). During this invocation it will create the directory .vnc in your home directory and will put into it several files. One of them is xstartup that contains the content of the Perl variable that we discussed above:

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

/usr/dt/bin/dtwm &

You can edit this file to change windows manager to the manager that you personally prefer if you change your mind later on (it's shown in red).

You can also change several parameters in .vnc/xstartup to make VNC more customized to your taste, for example:

#!/bin/sh

xrdb $HOME/.Xresources

xsetroot -solid grey

xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

#/usr/openwin/bin/twm &

/opt/gnome-1.4/bin/gnome-session &

Here are some recommendations for .Xdefaults

XTerm*geometry: 80x32

XTerm*scrollBar: on

XTerm*saveLines: 750

XTerm*Background: blue

XTerm*Foreground: white

*Font: -adobe-courier-bold-r-*-*-14-*-*-*-*-*-*-*

Xdefaults configuration

A separate page .Xdefaults is devoted to this topic. Check out these links for some real world examples of Xdefaults, contributed by fellow community members:

http://dotfiles.org/~buttons/.Xdefaults
http://code.suckless.org/hg/dextra/file/513faba2591f/dolby/Xdefaults
http://github.com/stxza/arch-linux-configs/tree/master/.Xdefaults
http://dotfiles.org/~wraith/.Xdefaults
http://dotfiles.org/~tdy/.Xdefaults

Xstartup

When setting up Solaris you will probably get a grey screen. The Q&A suggests using a different desktop type. For a full list of the options check:

http://www.ifh.ee.ethz.ch/~ballisti/computer_topics/docs/vnc_docs/vnc.html
<http://www.ifh.ee.ethz.ch/~ballisti/computer_topics/docs/vnc_docs/vnc.html>

CDE works well with vnc and is a preferred solution

The VNC software create a subdirectory in your home directory called .vnc (note the "." before the name vnc). In this subdirectory there is a file called xstartup in which we can write the commands which starts a Desktop.

Content for ~/.vnc/xstartup is:

#!/bin/sh
xrdb $HOME/.Xdefaults
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
your_windows_manager &

For CDE:

xrdb $HOME/.Xdefaults
/usr/dt/bin/dtwm

For KDE

xrdb $HOME/.Xdefaults
/path_to_executable/startkde-1.1 &

For fvwm2

/path_to_executable/fvwm2 &

Gnome

xrdb $HOME/.Xdefaults

/opt/gnome-1.4/bin/gnome-session &

Starting a VNC server

Once your password has been created you are ready to start a VNC server session. This session should run on a sun machine. You use a VNC client to connect to that session. You can modify the vncserver program to run a Xsession automatically. This will give you the default CDE environment. Here is an example:

softpano@sandbox $ vncserver -depth 8 -geometry 1280x1024

Note that lesser color depth means lower bandwidth consumption. Generally 8 bit should be enough. In the message that following that server will communicate that display number VNC will use, for example "New 'X' desktop is sandbox:1"

The vncserver program creates a default startup file in your personal ~/.vnc directory. This file runs Xsession to start CDE for you. The two command line arguments I used are all you will ever really need. The first, -depth 8, specifies that the VNC server start an X session at 8 bit color depth.

If you run PC at 32 bit color depth, you might want your VNC session and home PC's color depth to match, but you better not do that .

On Solaris, because of Solaris X-server-isms, you should generally use 24 bit color with vncserver if you run 24 or 32 bit color at home. Yes, they do not exactly match, but programs like netscape won't work unless you do this.

The next command line option, -geometry 1280x1024, specifies that the VNC session desktop will be 1280x1024 in size. The default is 1024x768, but that might be too small for those with 21' displays :-).

If you use the Windows vncviewer program it is possible to specify that it use your whole Windows desktop, in which case you would want to start vncserver with the same resolution as your Windows desktop.

When you are finished with your VNC session, after reading the notes on exiting CDE and VNC below, you can kill the vncserver like this:

softpano@sandbox rowland]$ vncserver -kill :1
Killing Xvnc process ID 3859    

Login to the remote mashine on which you started vncserver and kill it with the -kill display_number command line option. Yes, that display number has importance!

Users sometimes forget to kill their vncserver process, instead opting for starting yet another one. This unreasonably eats system resources. You might benefit from a wrapper script that checks there is a vncserver process running for you on the current Solaris login server. If there is, it tells you how to kill it. This is important to conserve resources. VNC login sessions consume a lot of resources.

One of the most important pieces of information about your VNC session is what display it is running on. When you started vncserver on the remote machine it printed out something like the following:

New 'X' desktop is sandbox:1    

In this case the VNC server is running on sandbox:1. Here :1 means display number 1. This number should be used in vncviewer on your PC to connect to this host. In Windows the vncviewer program has a GUI interface and you can right click on the taskbar and set some connection options (for example fullscreen).

The vncserver starts a small HTTP daemon that serves Java class files that your browser can execute if you connect it to the proper port: http://vncserver_host:58nn The vncserver_host is the remote host you started the VNC server on. The port specifies the display number. In my case I would connect to sandbox on port 5801, since my display was 01:

http://sandbox.softpanorama.org:5801    

NOTE: You can close your vnclient and leave the server running remotely. You can then connect to it again, and everything is still running like you left it. This is a very cool feature.


Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

[Jul 26, 2007] VNC for Solaris10

Hi, I use RealVNC 4 and it works perfectly, these are steps I follow to make it work- I use running SSH and it works really well, I run Putty and create the connection, then I run vnc viewer. I use this on a Sparc5, Ultra 5 and Blade 100. I hope it works for you:

VNC Solaris 10 RealVNC ver. 4.0 running under SSH.

a)
File to use: "vnc-4.0-sparc_solaris_2.5.tar.gz"
(I use this version because I have absolutly no problems with it)
#gunzip vnc-4.0-sparc_solaris_2.5.tar.gz
#tar –xvf vnc-4.0-sparc_solaris_2.5.tar
#cd vnc-4.0-sparc_solaris_2.5

b) To install (copy) the files to the path run the following:
#./vncinstall /usr/bin

c) Add this line to .profile (under the user):
PATH=/usr/dt/bin:/usr/openwin/bin:$PATH
vncserver -depth 24 -geometry 800x600

d) NOTE: (Most likely this file will be created when logged the first time using SSH under the user, so it may no be needed under root):

Create a /.vnc directory with the xstartup file inside:

echo "#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
gnome-session
#startkde
#/usr/dt/bin/dtsession
" > xstartup
chmod 744 xstartup To make it executable

note:
CDE gnome-session < To login running CDE, gnome or kde sessions:>
Gnome /usr/dt/bin/dtsession< comment with '#' the one you don't >
KDE startkde < want to use, here it will start kde.>


*** Sample used on .profile file (under user)

$ cat .profile
#
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
# ident "@(#)local.profile 1.10 01/06/23 SMI"
stty istrip
PATH=/usr/bin:/usr/ucb:/etc.
export PATH
PATH=/usr/dt/bin:/usr/openwin/bin:$PATH
vncserver -depth 24 -geometry 800x600
$

NOTE: This can be added under /etc/profile to be run for

[Jul 26, 2007] VNC for Solaris10

lmccodj
Posts:5
Registered: 8/25/06

Re: VNC for Solaris10
Feb 9, 2006 7:39 AM (reply 1 of 9)

Hi,
I am not using the one from sunfreeware.com I have the one that is delivered with the Solaris 10 Companion CD. The package name is SFWvnc.
The binary /opt/sfw/bin/Xvnc requires the two libraries
- /usr/sfw/lib/libgcc_s.so.1
- /usr/sfw/lib/libstdc++.so.6
available in the package SUNWgccruntime
set LD_LIBRARY_PATH to /usr/lib:/usr/sfw/lib:/lib in the startup script and you should be in business.

In your case you might be missing a library, check with ldd on x11vnc binary

[Apr 2, 2007] Solaris 10, gcc and VNC server by /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.

#!/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!

[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.
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]

[Dec 06, 2006] BigAdmin Description: How to enable XDM and VNC for Linux and Solaris

[Dec 06, 2006] Enhanced TightVNC Viewer TightVNC viewer enhanced with SSL tunnelling and other features.

C, Tcl, Unix Shell

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.

Free TridiaVNC Download

x11vnc a VNC server for real X displays allows remote viewing and interaction with real X displays via keyboard and mouse.

Virtual Network Computing (VNC) Utility

  1. Short description and name of binaries
  2. Usage: how to start, how to use it
  3. Making the connection secure with SSH
  4. Official Documentation on local server
Let try to use VNC between two SUN machines (this do not make much sense but is good as a test):

Machine AA is the display server, i.e. your local one.
Machine BB is the application server, i.e. the remote one.

Please note: do NOT use ssh at this stage because VNC will not work then.

AA% rlogin BB
BB% top <== check that there is enough memory and CPU power
BB% vncserver :1

Comment:
The ":1" here means DISPLAY no. 1.
Please do NOT use display nr. 0 as this is already your present (telnet or rlogin) session.
In some special cases (for instance if you are running more then one vnc server) there is a conflict with the display numbering: just enter an higher number.
Check your ~/.vnc/server_name:1.log file to see if everything is OK
For instance this is a possible log file's name:
~/.vnc/sirrah.ee.ethz.ch:71.log for machine 'sirrah' and DISPLAY ':71'
The content of this file looks like this:

24/11/03 15:05:04 Xvnc version 3.3.3r1
24/11/03 15:05:04 Copyright (C) AT&T Laboratories Cambridge.
24/11/03 15:05:04 All Rights Reserved.
24/11/03 15:05:04 See http://www.uk.research.att.com/vnc for information on VNC
24/11/03 15:05:04 Desktop name 'X' (sirrah.ee.ethz.ch:71)
24/11/03 15:05:04 Protocol version supported 3.3
24/11/03 15:05:04 Listening for VNC connections on TCP port 5971
24/11/03 15:05:04 Listening for HTTP connections on TCP port 5871
24/11/03 15:05:04   URL http://sirrah.ee.ethz.ch:5871

If this is the first time that you are using vncserver then you will be asked to enter (define) a password.

You may want to check if the server is really running. Do it with the command:

ps -ef | grep Xvnc | grep -v grep

you should see something like this:
BB% ps -ef | grep Xvnc | grep -v grep
your_name 335 1 0 18:53:41 pts/4 0:01 Xvnc :1 -desktop X -httpd /usr/pack/vnc-3.3.3r1-rb/vnc_sun4_sosV_5.5/classes -a

in the case above we are using the display BB:1.0 (more about it later)
To kill the server program LATER on (but do NOT forget it), execute:
BB% vncserver -kill :1

you can now exit the application server leaving the VNC-server program running

BB% exit

Back on your local machine (here AA) starts the Viewer having the name of the server and the DISPLAY number as parameter:

AA % vncviewer BB:1
VNC server supports protocol version 3.3 (viewer 3.3)
Password:
VNC authentication succeeded
Desktop name "your_name's X desktop (BB:1)"
Connected to VNC server, using protocol version 3.3
VNC server default format:
8 bits per pixel.
True color: max red 7 green 7 blue 3, shift red 0 green 3 blue 6
Using default color map and translating from BGR233. Pixel format:
8 bits per pixel.
True color: max red 7 green 7 blue 3, shift red 0 green 3 blue 6
Got 8 exact BGR233 colors out of 256
Using 77 existing shared colors

On your screen you will see a big window which represent a desktop similar to the one that you would have if you would have logged on the application server's console.
In this big windows one xterm is already open and there you can start all the utilities you wish on the server.

How to choose the Desktop type

In the example above we used the default Desktop wich is the X one.
The VNC software create a subdirectory in your home directory called .vnc (note the "." bevore the name vnc). In this subdirectory there is a file called xstartup in which we can write the commands which starts a Desktop.

Default content for "~/.vnc/xstartup" is:

For X11 (tested and OK):
#!/bin/sh
xrdb $HOME/.Xdefaults
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

This will start a X-Desktop (and has been tested).

But you may want KDE or others. Here a list (please tell me your experience with it):

The two lines:

xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

can be added to each of the files below.

For KDE (tested and OK)(well this was in year 2000....):

#!/bin/sh
xrdb $HOME/.Xdefaults
/usr/sepp/bin/startkde-1.1 &

ATTENTION: recently we got problems with the command above.
PLEASE substitute the line with startkde-1.1 with:
launchx KDE

For fvwm2 (tested and OK):

#!/bin/sh
xrdb $HOME/.Xdefaults
/usr/sepp/bin/fvwm2 &

For CDE (tested ):

#!/bin/sh
xrdb $HOME/.Xdefaults
/usr/dt/bin/dtwm

VNC over SSH2 - A TightVNC Tutorial Van Emery - June, 2003

TightVNC:

Main Links

x11vnc a VNC server for real X displays

x11vnc allows one to remotely view and interact with real X displays (i.e. a display corresponding to a physical monitor, keyboard, and mouse) with any VNC viewer. In this way it plays the role for Unix/X11 that WinVNC plays for Windows.

I wrote x11vnc because x0rfbserver was basically impossible to build on Solaris and had poor performance. The primary x0rfbserver build problems centered around esoteric C++ toolkits. x11vnc is written in plain C and uses only standard libraries. I also added a few enhancements to improve the interactive response, add esoteric features, etc. The FAQ contains a lot of information and solutions to problems, but please feel free to contact me if you have problems or questions.

VNC (Virtual Network Computing) is a very useful network graphics protocol (applications running on one computer but displaying their windows on another) in the spirit of X, however, unlike X, the viewing-end is very simple and maintains no state. It is a remote framebuffer (RFB) protocol

Some VNC links:

For Unix, the VNC implementation includes a virtual X11 server Xvnc (usually launched via the vncserver command) that is not associated with a physical display, but provides a "fake" one X11 clients (xterm, mozilla, etc.) can attach to. A remote user then connects to Xvnc via the VNC client vncviewer from anywhere on the network to view and interact with the whole virtual X11 desktop.

The VNC protocol is in most cases better suited for remote connections with low bandwidth and high latency than is the X11 protocol (the exception is cached pixmap data on the viewing-end). Also, with no state maintained the viewing-end can crash, be rebooted, or relocated and the applications and desktop continue running. Not so with X11.

So the standard Xvnc/vncserver program is very useful, I use it for things like:

  • Desktop conferencing with other users (e.g. codereviews).
  • Long running apps/tasks I want to be able to view from many places.
  • Motif, GNOME, and similar applications that would yield very poor performance over a high latency link.

However, sometimes one wants to connect to a real X11 display (i.e. one attached to a physical monitor, keyboard, and mouse: a Workstation or a SunRay session) from far away. Maybe you want to close down an application cleanly rather than using kill, or want to work a bit in an already running application, or would like to help a distant colleague solve a problem with their desktop. This is where x11vnc is useful.

X11vnc Solaris 10 packaged on www.sunfreeware.com

x11vnc-0.7-sol10-sparc-local.gz x11vnc is a vnc server for X displays. It allows remote viewing and interaction with real X displays via keyboard and mouse - installs in /usr/local. This package also needs to have the following packages installed - zlib, jpeg, and /usr/local/lib/libgcc_s.so.1 from either libgcc-3.3 or gcc or later. You will need a vnc viewer on your client machines. I have tested the tightvnc java based viewers for Solaris and Mac OSX and will be offering a compiled version of the tightvnc vncviewer for Solaris here shortly.

x11vnc-0.7-sol10-intel-local.gz x11vnc is a vnc server for X displays. It allows remote viewing and interaction with real X displays via keyboard and mouse - installs in /usr/local. This package also needs to have the following packages installed - zlib, jpeg, and /usr/local/lib/libgcc_s.so.1 from either libgcc-3.3 or gcc or later. You will need a vnc viewer on your client machines. I have tested the tightvnc java based viewers for Solaris and Mac OSX and will be offering a compiled version of the tightvnc vncviewer for Solaris here shortly.

SV Solaris Management Console via VNC Cruz Walter Walter.Cruz "at" telenor.se
Fri Oct 29 13:51:01 2004


Hi!

I worked hard to get some Solaris stuff to work through VNC.
Some started with the wrong fonts so it was unreadable, some didn't even
start at all.

What I did to solve this was to tell the VNC-server to use a
font-server. X11 standard worked fine for me = xfs

Though I'm using a FreeBSD as main host, I'm not sure if the font-server
is the same in Solaris.
But the solution is the same, because Xvnc is not capable of reading ALL
fonts.

So instead of using a font-PATH, just use a xfont-server and give the
path to it.
Then the font-server will serve Xvnc with fonts, that did the magic and
I no longar have troubles with it.
How you call/configure the font-server is up to you system. Make a "man
X" it should say what standard Font-server are supposed to work for you. 
Then I supossed that u are running Xfree86. When you know how to config
the font server, then you just add the call to start the server in xstartup 
And then you tell your x-server to use a font-server instead of a
font-path.


// Walter


>Need some input on trying to get SMC 2.0 to run via VNC on Solaris 8.
VNC 
>works fine and all utils seem to work fine but everytime I try and
launch 
>SMC I receive the following - I get the initial image and it says 
>Initializing console..., Setting look and feel..., Initializing
console..., 
>Starting console... and then the images dies and the SMC server never
comes 
>up. Running SMC on the console works fine. My xstartup has been
modified so 
>that the window manager has been commented out. In this case, "#twm". I
have 
>appended the contents of the "/usr/dt/bin/Xsession" minus the
additional 
>"#!/bin/ksh" to the xstartup file. Any ideas are appreciated.
>
>_________________________________________________________________
>On the road to retirement? Check out MSN Life Events for advice on how
to 
>get there! http://lifeevents.msn.com/category.aspx?cid=Retirement

VNC with CDE problems

[email protected] [email protected]
Thu, 25 Oct 2001 22:04:05 -0500


sure enough!

you need to set Xvnc owner/group/perms to match those of Xsun.

ie chgrp root;chmod 2775

also, if you want to run dtwm, you need to rip out all the useless stuff it
puts in the default startup script and just use Xsession.

/usr/openwin/bin needs to be in the path so things can be found, such as
Xauth.

I've got a little script that runs vnc:

#!/bin/ksh
PATH=$PATH:/usr/dt/bin
cd ~
vncserver -depth 24 -geometry 1152x900 :1

and /etc/init.d/vnc

#!/bin/ksh
#start and stop vnc sessions.
case "$1" in
'start')
     printf "Starting VNC servers for: "
	for a in /export/home/*/bin/vnc
	do
		cd ${a%%/bin/vnc}
		id=`pwd|sed -e 's-/export/home/--'`
		printf "%s, " $id
		su - $id bin/vnc&
	done
	printf "\n"
	;;

'stop')
      echo Stopping vnc sessions
	 ps -ef|grep -v awk|awk '/Xvnc :/ {print $9}'|while read session
      do
           /usr/local/bin/vncserver -kill $session
      done
	;;
*)
	echo "Usage: $0 {start|stop}"
	exit 1
	;;
esac
exit 0


and /etc/rc2.d/S99vnc:

#!/bin/ksh
#start and stop vnc sessions.
printf "Starting VNC servers for: "

case "$1" in
'start')
        /etc/init.d/vnc $1
        ;;

'stop')
      echo Stopping vnc sessions
         ps -ef|grep -v awk|awk '/Xvnc :/ {print $9}'|while read session
      do
           /usr/local/bin/vncserver -kill $session
      done
        ;;
*)
        echo "Usage: $0 {start|stop}"
        exit 1
        ;;
esac
exit 0

(that little fiddly bit needed to get the init.d script to run under ksh)

all this so that vnc is up and running for everybody on the box right after
boot.

Sun Microsystems Support Forums

rhaertle wrote on Mon, 28 June 2004 15:40
Hello,

I am having trouble getting VNC working with JDS R2.

This is NOT remote desktop admin. I want to use the machine with no terminal.

I have done this with various other linuxes. Sometimes it works to start vncserver in a file in rc.d/init.d. The best way is to start vncserver as a service that executes Xvnc whenever there is a connection attempt on port 5900 or 5901 (add a line to /etc/services and an entry in inetd.conf or a file in xinetd.d).

I have tried a whole bunch of different stuff on JDS R2 without getting it to work.

Can anybody help? Again, this is not Remote Desktop the way it ships with the system.

On Suse you get to vnc via Launch->Preferences->Remote Desktop

That gives you a GUI to enable VNC server. You can also run: /usr/X11R6/bin/vncserver in a terminal
it will setup fine. You'll need to provide a password. If you've run vnc with other Linux distributions, then this is no different than SuSE as far as VNC is concerned.

You can also run the command: vncviewer and it will ask for an IP and password to get a remote desktop.
It's pretty normal. You can also create a launcher for the viewer.

==========================

That approach won't solve the issue. The built-in "Remote Desktop" only allows remote access to a desktop that has already been started, and this PC has no running desktop.

Here's a reference that explains the theory, from Linux Mag's Guru Guidance column:
http://www.linux-mag.com/2003-03/guru_01.html

Running vncserver in a terminal is also not an option, since there is no desktop or terminal running. In an emergency, I can telnet or ssh to the machine, start vncserver by hand, and then access the machine via VNC, but that's too much trouble to do every day.

I want to start Xvnc automatically when the machine boots. The PC is without monitor, and vnc will be the only way I connect to it. I have done this with various other linuxes, I just haven't gotten it working in JDS. Sometimes it works to fire vncserver during startup (in an rc file), and sometimes it works to fire Xvnc via inet as a service when it gets a connect attempt on port 5900. I've even done it with xdmcp, but none of my attempts have worked in JDSR2.

If you can get this working, let me know. To test it, turn your machine on, and let it boot to rl5 (the display manager login screen). Then go to another machine, and connect to it via vnc.

Thanks.

rhaertle
Messages: 0
Registered: June 2004
Junior Member
I finally got this working. The machine is now running deadheaded with no monitor.

1) vnc is not installed in the default configuration. Don't pick it off the yast install list; I could not get the version shipped with JDS to work. I used realvnc. Download it as a tarfile. Run ./vncinstall to /usr/local/bin and /usr/local/man.

2) Use gdmsetup, or in /etc/X11/gdm/gdm.conf, set xdmcp Enable=true. By the way, while the system is coming up, you'll see init throw a "failed" message for gdm, I don't know why. This change is causing the failure, but everything seems to work. I'm not going to spend alot of time figuring out how to clean up whatever is reporting bad status, since it's running.

3) In /etc/services, add "vncserver 5901/tcp #vncserver". The 01 means screen :1. When the system gets a connect attempt on that port, it'll run the vnc server.

4) Using launch / prefs / system / sw & services / start & stop or edit inetd.conf to add the service. Add "vncserver stream tcp nowait root /usr/sbin/tcpd /usr/local/bin/Xvnc -once -securitytypes=none -inetd -query localhost". You can add -geometry and -depth if you want. You can add multiple lines here (inetd.conf) and to /etc/services for different geometries.

5) Load vnc into XF86. Use the XF86 config scripts, or in /etc/X11/XF86Config, add "load vnc" to the modules section.

Restart init and gdm or reboot. Now, when the machine boots, and you connect via vnc, you'll get a gdm login screen.

Don't do this unless your network is already completely secure.

ReVNC - X Windows

>OK. I just downloaded the latest version of VNC. And it now works. At least
>you can connect now. However it doesn't bring up KDE. It just has a terminal
>session running. How would you go about getting it to start KDE or GNOME
>instead of the terminal session?

Yep, this is very normal. Depending on how you start x you will get diffrent configuartions of window manager/etc... Normally if you have xdm a script~ in /etc/X11/xdm called Xsession get run, if you do a startx (which is a script itself), it runs /etc/X11/xinit/xinitrc as the startup file. THese startup files fire up a window manager, etc... Becuase the window manager or session manager are components of an X environment, and not "integrated" into the graphics subsystem. I don't know if you knew all that, but some Windows-backgrounded people don't, so I mention it for completeness.

When you run "vncserver" (which is a script that starts Xvnc), it looks in a sub-dir called .vnc in your home for a file called "xstartup", which it uses to build your prefered X environment (window/session managers, etc...). If you wish this to be the same as when you login to the system locally make it a sym-link to /etc/X11/xinit/xinitrc, and that should do the trick. Or else
you can hack "vncserver" to not bother with the home directory stuff at all and just start a certain window manager (which is what I do, in fact, I have it start star office with no window manager at all).~

For those of you curious I have found that Star Office running to a remote X display eats about 15-20% of one of the CPU's even when idle and on another virtual desktop. If I run it in a local Xvnc and then connect over a network with VNC, idle means idle, and it consumes no CPU resources when not in focus. Someone explain that on too me please? (Not that I really mind, VNC with zlib compressesion uses alot less bandwith than X anyway).

Re: VNC - X Windows

I start a VNC server on Solaris like this:

vncserver -depth 8 -geometry 800x600 -cc 3 -query localhost -once

This gives me a normal CDE login screen.

My ~/.vnc/xstartup is empty.

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.

Solaris 10 Update 5 comes with VNC so no extra packages are required. Instructions for it's configuration will appear here as soon as I get time to write them! Meantime, check docs.sun.com.

For Update 4 or older, carry on….

Everything you need to setup VNC on Solaris is included in this zip file Here.

Or follow these instructions to configure it for yourself....

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:

# cd /cdrom/cdrom0/sparc/Packages

# pkgtrans . /opt/SFWgcmn.pkg SFWgcmn

# pkgtrans . /opt/SFWgcc34l.pkg SFWgcc341

# pkgtrans . /opt/SFWvnc.pkg SFWvnc

Add the three packages in the following order:

# cd /opt

# pkgadd -d SFWgcmn.pkg

# pkgadd -d SFWgcc34l.pkg

# 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.

# mkdir -p /etc/dt/config

# cp /usr/dt/config/Xservers /etc/dt/config/

# cp /usr/dt/config/Xconfig /etc/dt/config/

# 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:

# 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.

# HOME=/opt/sfw/vnc

# export HOME

# mkdir $HOME/.vnc

# /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:

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

# 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:

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

# 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:

# pkill –HUP inetd

# /etc/init.d/dtlogin stop

# /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:

# cd /etc/gconf/gconf.xml.defaults/apps/gnome_settings_daemon/keybindings/

# mv %gconf.xml %gconf.xml.orig

# 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>

Things i've learned about Solaris...

as to VNC, you need to reset the permissions on xstartup in the .vnc folder before it can execute its script and start your desktop. Otherwise you'll only get a blank checkerboard screen and the oh-so-familiar X cursor. You can reset them like so:

chmod 0744 $home/.vnc/xstartup

If you want to start KDE, you can place startkde in your xstartup file. I've found that the JDS 3.0 works just fine with VNC, instead of startkde, use gnome-session. My xstartup looks like so:

#!/bin/sh

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session

Now to figure out how to start this bugger automagically at boot....

VNC for Solaris10

This was remarkably easy to get going on my X2100, with the first and U2 releases of Solaris 10.

With 11/06 (U3), it does not work for me; I see only the grey X desktop and no login window. For 11/06 I recommend using (howto).

  1. Download RealVNC server package (Download & Use -> confirm form -> Find the latest Solaris package) (update: As of March 2007 there is no Solaris/x86 package available for download - it has been removed. I don't know why; it worked just fine for me. Try the Solaris Companion DVD's SFWvnc package instead - pkgadd -d /mnt/tmp/Solaris_Software_Companion/Solaris_i386/P ackages SFWvnc)
  2. Install package
    pkgadd -d vnc-4_1_1-x86_solaris.pkg
  3. Add the 'vnc' service to /etc/services:
    echo 'vnc 5900/tcp' >>/etc/services
  4. Convert and import the inetd configuration line to Solaris 10's new Service Management Framework:
    echo 'vnc stream tcp nowait nobody /usr/local/bin/Xvnc Xvnc -inetd -query localhost -once securitytypes=none' >> vnc.inetd.conf
    inetconv -i vnc.inetd.conf
    (note, if using the Companion CD package, command is /opt/sfw/bin/Xvnc)

    To later change the resolution of the spawned server, or any other options, change the exec property as follows:

    inetadm -m network/vnc/tcp exec="/usr/local/bin/Xvnc -inetd -query localhost -once securitytypes=none -screen 0 1280x1024x16"
    Then you can use inetadm to manage it:
    inetadm -l svc:/network/vnc/tcp:default (show details - giving full service name)
    inetadm -d network/vnc/tcp (disable - you can abbreviate the service name like this)
    inetadm -e network/vnc/tcp (enable)
    May be necessary to restart inetd:
    svcadm restart inetd
  5. Connect to VNC port 5900 to see the desktop login!

Recommended Links

Google matched content

Softpanorama Recommended

Top articles

Sites

RealVNC - Wikipedia, the free encyclopedia

TightVNC - Wikipedia, the free encyclopedia

TightVNC:

Main Links

Articles:

x11vnc:

Solaris 10

x11vnc-0.7-sol10-sparc-local.gz x11vnc is a vnc server for X displays. It allows remote viewing and interaction with real X displays via keyboard and mouse - installs in /usr/local. This package also needs to have the following packages installed - zlib, jpeg, and /usr/local/lib/libgcc_s.so.1 from either libgcc-3.3 or gcc or later. You will need a vnc viewer on your client machines. I have tested the tightvnc java based viewers for Solaris and Mac OSX and will be offering a compiled version of the tightvnc vncviewer for Solaris here shortly.

x11vnc-0.7-sol10-intel-local.gz x11vnc is a vnc server for X displays. It allows remote viewing and interaction with real X displays via keyboard and mouse - installs in /usr/local. This package also needs to have the following packages installed - zlib, jpeg, and /usr/local/lib/libgcc_s.so.1 from either libgcc-3.3 or gcc or later. You will need a vnc viewer on your client machines. I have tested the tightvnc java based viewers for Solaris and Mac OSX and will be offering a compiled version of the tightvnc vncviewer for Solaris here shortly.



Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to to buy a cup of coffee for authors of this site

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: March 12, 2019