VNC Server

Rick Stevens rstevens at vitalstream.com
Mon Jul 12 18:09:04 UTC 2004


Graeme Nichols wrote:
> On Fri, 2004-07-09 at 02:22, Rick Stevens wrote:
> 
>>Graeme Nichols wrote:
>>
>>>On Wed, 2004-07-07 at 03:30, Rick Stevens wrote:
>>>
>>>
>>>>Graeme Nichols wrote:
>>>>
>>>>
>>>>>Hello Rick, I am having trouble with Evolution at the moment where I am
>>>>>unable to reply to your post containing the instructions to get VNC
>>>>>working. I have tried four times so far and all messages have been
>>>>>empty. Perhaps the time has come to invoke yum and update Evolution :-)
>>>>>
>>>>>Anyway, to continue... The xstartup file created by the first invocation
>>>>>of vncserver did not contain the line 'unset SESSION_MANAGER'. After
>>>>>inserting that line I managed to get the XWindow I was expecting.
>>>>>However, to get the vncviewer to work I had to use the following
>>>>>command:- 'sudo vncviewer -via barney barney:1' Without the 'sudo' it
>>>>>failed with the 'unable to read password' error. Using sudo it asked for
>>>>>root's password on barney, then my user password on barney and it all
>>>>>worked.
>>>>
>>>>On the remote end, you have to run "vncserver" or "xvnc" as the user you
>>>>intend to log in as remotely.  
>>>
>>>
>>>Hello Rick,  
>>>
>>>Yep! I started vncserver as my login name, graeme.
>>
>>Ok.
>>
>>
>>>>You probably ran vncserver on the remote
>>>>end as root, so you have to be root at the local end, too.  
>>>
>>>
>>>Nope. Started it as my mortal self.
>>>
>>>
>>>
>>>>The "can't
>>>>read password" error is caused by the vnc server running as root and you
>>>>trying to log in as a mortal user.  The mortal user you tried to log in
>>>>as probably doesn't have a ~/.vnc/passwd file.
>>>
>>>
>>>Maybe I'm wrong, but I don't think so, because if I start vncviewer on
>>>the same machine I started vncserver the password is read no problem. It
>>>is only when I start vncviewer on the 'other' machine.
>>
>>Uh, you realize that using the "-via" bit requires you to use the ssh
>>password to get into the machine, then you need the vnc password to
>>access the vnc server?  Which password is pooping out?
>>
>>
>>>>>One thing I would like to change if I can is the size of the TightVNC
>>>>>window that comes up. The argument 'fullscreen' defaults to 'no' but
>>>>>that is almost as big as fullscreen. It is larger than the screen size
>>>>>and results in a scroll bar right and bottom. Is there a way to set the
>>>>>screen size?
>>>>
>>>>You mean the local VNC window is smaller than the screen size of the 
>>>>remote end, hence you have scroll bars.  You can either turn on
>>>>fullscreen (which really only works if your local screen size is the
>>>>same or larger than the remote end) or you can use the "-geometry"
>>>>option to specify your local window size.  If you use a 1280x1024
>>>>display locally, fullscreen mode is essentially:
>>>
>>>
>>>No, both machines have a 1024x768 screen size, the machine running the
>>>server and the machine running the viewer. When I log in from the
>>>machine running the viewer the window, labeled 'TightVNC: Graeme's X
>>>Desktop etc...', has scroll bars which interfere with the application.
>>>The 'actual' window size appears to be 1024x768, the same physical size
>>>as the screen, but the scroll bars take up display area causing the
>>>problem.
>>
>>Ah, yes, that would be an issue.  The scroll bars do occupy desktop
>>space.  You could specify a smaller desktop on the server using the
>>"-geometry" parameter:
>>
>>	vncserver -geometry 800x600
>>
>>The vncviewer should have a bigger desktop than the server to prevent
>>that issue.  See next paragraph.
>>
>>
>>>
>>>
>>>>	-geometry 1280x1024x0x0
>>>
>>>
>>>If I start vncviewer with the command 'vncviewer -geometry 800x600x0x0
>>>-via barney barney:1' to stick the window in the top right corner, or
>>>wherever, it still comes up bigger than the screen's real estate with
>>>the scroll bars. If I then click on the full screen icon (trc) the
>>>scroll bars disappear but the window is slightly larger than the
>>>machine's screen resolution/size (1024x768). The docs for X mention the
>>>the -geometry option but I wasn't able to get it to work when I start an
>>>Xterm for a particular size, simply puts up the usage screen saying the
>>>-geometry option was not valid. Perhaps the problem with vncviewer is
>>>linked with the X problem, I don't know.
>>
>>That's because the server is using a 1024x768 display (default) but
>>you've specified an 800x600 window to show it in.  Of course you'll have
>>scroll bars.  If you use:
>>
>>	vncserver -geometry 800x600
>>
>>on the server and
>>
>>	vncviewer -via barney barney:1
>>
>>the viewer shouldn't have scrollbars.  Granted the desktop will be
>>smaller, but no scrollbars.
>>
>>
>>>Thanks Rick, sorry to be a nuisance but I would like to sort it if I
>>>can.
> 
> 
> Rick, thank you very much, you're a wiz. I hadn't picked up on the
> ability to size the server desktop, I was mistakenly trying to size the
> viewer, Duh! As for the password problem I guess it must be the ssh
> password. Prefixing the command to start the viewer with 'sudo' results
> in being asked for root's password on barney followed later by the
> prompt 'password'. Entering my own login password at this prompt up
> comes the viewer screen.
> 
> It all works like a dream now, thanks in no small measure to your help,
> and I now know a LOT more about Linux. The 'fun is in the learning'.

You have a very strange idea of "fun", but I get your drift.  ;-)
Glad to help.  It is kinda nifty, isn't it?

By the way, you can speed up the display a bit by using the "-C" option
(compress) to ssh.  To do this, set up something like:

	VNC_VIA_CMD="/usr/bin/ssh -f -C -L "$L":"$H":"$R" "$G" sleep 20"
	export VNC_VIA_CMD

then run "vncviewer -via gateway host".
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-      I won't rise to the occasion, but I'll slide over to it.      -
----------------------------------------------------------------------





More information about the Redhat-install-list mailing list