Solved

VNC Server

Posted on 2004-10-05
27
2,610 Views
Last Modified: 2013-12-16
Hi,

I'd admin a small group of pc - I'd like people to log onto the linux box through vnc, and be presented with the normal linux (red hat) login screen.

The problems I'm experiencing are the following:

1. twm is starting, which I'm not really familar with.
2. How do i get the regular login screen to appear? (is this a relatively secure way of doing things in a small closed group?)
3. I keep getting dcop connection errors appearing on the linux box while connected via the vnc viewer on pc - i believe this is an issue with kde 3 - is there a way around this or can i safely ignore it?


this is my current xstartup (in the root directory)

#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
exec startkde &


All or any help appreciated
0
Comment
Question by:pixitron
  • 13
  • 5
  • 4
  • +2
27 Comments
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 12225398
0
 

Author Comment

by:pixitron
ID: 12225463
thnaks i looked at that page - however since it refers to redhat 7.1 much of the files it talks about are different from redhat 9.

Any other links would be welcome though
0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 12225582
0
 

Author Comment

by:pixitron
ID: 12236259
sorry that link wasn't of much help....

I'm increasing the points for this....
0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 12236326
0
 

Author Comment

by:pixitron
ID: 12247486
ok,

So my vnc session is working ok - ish.

i created a user called vncuser, and start a avnc session with vncserver. ON the windows client i can log in.....but

I'm logging in as vncuser....I'd ideally like to be presented with the login screen and log on as another system user - is this possible???????

My xstartup file now simply contains the following......
unset SESSION_MANAGER
exec gnome-session &
0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 12247564
I would have thought you could repeat the proceedure for any user.
0
 

Author Comment

by:pixitron
ID: 12247721
but that requires me to log in that user and type "vncserver" from the remote host machine... surely there must be a more elegant solution?
0
 

Expert Comment

by:poush
ID: 12251878
Standard vnc server installations on linux (or unix) don't serve display :0.  In the configuration file (/etc/sysconfig/vncservers) you can let each user have his own X desktop (VNCSERVERS="1:user1 2:user2").  But regardless of how many displays the server is running, they all share the same password.  This is only good for multiple users if perhaps you are talking about a tight family group where trust between members is never in question. It has the advantage of allowing users to simultaneously use different desktops without interfering with one another.

It seems that the only way you might be able to serve display :0 would be to use RealVNC with some non-standard modifications (http://www.realvnc.com/v4/x0.html).  This will allow users to access the login screen on the native display.  But has the disadvantage that different users could not simultaneously work on different desktops.  (In this case you wouldn't serve on any other displays and all users still use the same vnc password.)
0
 

Author Comment

by:pixitron
ID: 12252146
interesting and useful post Poush.

I am actually using realvnc....

It doesn't seem like i can setup a few thin client machines which access the applications on the more powerful server and still use individual linux logins and accounts for each of the users on teh thin clients? Is that correct?
0
 

Expert Comment

by:poush
ID: 12253891
You could conceivably run several virtual machines (i.e. vmware workstation:  http://www.vmware.com/products/desktop/ws_features.html) from within the Linux system, each with its own desktop and vncserver, all capable of being used simultaneously.  But there are drawbacks to that too of  course being that each vm will use resources (most notably ram and hard drive space).  But if you have 2 GB of RAM and only perhaps 3 users that would each have a vm using 512MB of RAM (or 6 users, each with a vm using 256mb) its quite doable.  Keep in mind that you would need to purchase one vmware workstation license and OS licenses for the appropriate number of user vms.
0
 

Author Comment

by:pixitron
ID: 12254540
ok thanks - i'm really looking for a free or very very low ocst solution - it appears it doesn't exist
0
 

Author Comment

by:pixitron
ID: 12254584
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Expert Comment

by:poush
ID: 12256764
It certainly appears doable.  I expect it would take at least 40 hours to get it working.  If you go that route, use symantec ghost to make an image of the server that can be restored quickly in the event of hard drive failure.  This kind of setup is not one that you would really want to be forced to recreate from scratch.  One change I would make would be not to use boot floppies since a) floppies are slow  b) the space on a floppy is very small  c) its quite easy to make a bootable cd using isolinux  d) all pcs made in the last several years have a bios setting that will allow booting from cd drive.  Another change would be to enable the local hard drives on the thin clients and have user files automatically backed up (hourly or more often) from the server to the respective clients.  It's always good to have backups and the users still have access to their data even if network or server were to go down.  Don't use NFS, but use secure copy (over ssh) for this.  If any of your clients will be remoting in from outside then you need  to run ssh server anyway since vnc is unencrypted.
0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 12256899
If you want to use a virtual machine, user model linux is worth a look. Its gpl.
http://user-mode-linux.sourceforge.net/
0
 

Author Comment

by:pixitron
ID: 12257309
Poush, i think that was an interesting website article - i certainly dont intend going to the extreme of using floppy drive based distribuations. I have old, yet still relatively powerful pc's (P3 500mhz etc) as the thin clients. So in theory at least it should be a simplier problem.

But the issues still remains as regard how exactly to setup realvnc to support such a structure.
0
 

Accepted Solution

by:
poush earned 330 total points
ID: 12259538
On the server set up similar to the following (use one or more display resolutions appropriate for your client machines).  This setup doesn't use realvnc but only Xvnc which is part of the default RH install.  You could probably substitiute realvnc binary in the appropriate "server" line of /etc/xinetd.d/vnc.  This setup causes a VNC server to start anew for every connection, disallows multiple connections to one desktop, and shuts down after the original connection exits.  So it loses statefulness and the ability to share the desktop both remotely and locally.  In my opinion, statefulness is not necessary if you have a stable network that rarely (if ever) would drop a connection between the client and server.  Even so, you would want to make sure that files being edited are autosaved regularly.  And if you want clients to be able to share their desktop (which I would do in your shoes so I wouldn't have to go to the users desk to give help) you just run realvnc on each client.  Set them all with the same password and keep it to yourself for admin use.

    *  Add the following lines to the end of /etc/services file.

       # VNC Servers
       vnc-1024x768x16  5900/tcp
       vnc-800x600x16   5901/tcp

    * Create a file called vnc in the directory /etc/xinetd.d/ which contains the following:

      service vnc-1024x768x16
      {
        flags = REUSE
        protocol = tcp
        socket_type = stream
        wait = no
        user = nobody
        server = /usr/bin/Xvnc
        server_args = -inetd -query localhost -once -geometry 1010x738 -depth 16
        log_on_failure += USERID
        disable  = no
      }
      service vnc-800x600x16
      {
        flags = REUSE
        protocol = tcp
        socket_type = stream
        wait = no
        user = nobody
        server = /usr/bin/Xvnc
        server_args = -inetd -query localhost -once -geometry 790x572 -depth 16
        log_on_failure += USERID
        disable = no
      }

    * Note that the service names ( vnc-1024x768x16 , vnc-800x600x16 ) must match the names entered into /etc/services. A large number of entries may be created for specific screen sizes and colour depths. Note that in the examples above the actual geometries configured for PROTOR have been reduced from the full screen size to allow for window decorations.
    * In the above examples when you wish to connect with a screen size of 1024x768 and depth 16 then connect using port 5900 or if using vncviewer then connect using <hostname>:0. Use port 5901 or <hostname>:1 to connect with 800x600 and depth 16.
    * You now need to restart xinetd. Use the command:

       service xinetd restart

    * In order to connect from a remote X-server or X-terminal you now need to enable XDMCP (X Display Manager Control Protocol ) both in general and for the specific Display Manager you are currently using (either xdm , gdm or kdm ).
    * Firstly you must edit the file /etc/X11/xdm/xdm-config . Ensure the line (usually the last line ) is commented out.

        !DisplayManager.requestPort:    0

    * Now edit the file XDMCP control file /etc/X11/xdm/Xaccess . Uncomment the following line.

         !*     # any host can get a login window

    * Enable XDMCP for gdm by running the configuration program gdmconfig. Enter Expert mode and the XDMCP page. Ensure that XDMCP is enabled. The port number should already be set to 177. Alternatively edit the file /etc/X11/gdm/gdm.conf .
    * Enable XDMCP for kdm by editing the file /etc/kde/kdm/kdmrc. There is a [Xdmxp] section in this file. In this section edit the line:

          Enable = false
   to be
          Enable = true

and uncomment the line

          Port = 177

You now need to restart the X-window system. Probably easiest is to use init 3 followed by init 5 or alternatively perform a complete system shutdown and restart.

End of server setup.


Client setup as follows will make using vnc (almost)transparent to the user since the remote login screen is brought up automatically.  I say almost because multimedia is no good over vnc and there is a noticable (but slight) delay at times.

Edit $HOME/.xsession so that it looks like this:

exec vncviewer -passwd $HOME/.vnc/passwd
-fullscreen localhost:1
0
 

Author Comment

by:pixitron
ID: 12270061
wow thanks for that!

so in my case, if i want an even simpler setup (doesn't automatically launch the vnc viewer), all i'd need to do is provide the link to the vnc client (realvnc client)von the windows desktop. What desktop will they connect to - ie IP_ADDRESSS:X, whats the value of X? from the above it seem to be dependant on  which resolution you want - am i correct?

After connecting via the vnc client, will each user have their own area (eg home area etc) - or are they just sharing an account?

thanks again for the great post above
0
 

Author Comment

by:pixitron
ID: 12275060
incidently i followed your instructions above, reboot the machine, logged in as normal (non-root user) and then tried to connect to this machine via a windows client using realvnc viewer and the ip address of the server machine - i couldn't establish a connection saying: uable to connect to host.

I tried from another linux based machine and tried to connect to the server, but also couldn't - again using realvnc vncviewer.

any thoughts?
0
 

Expert Comment

by:poushag
ID: 12278526
try connecting server to itself  (i.e. localhost:1)
0
 

Expert Comment

by:poushag
ID: 12278543
I remembered the pw on my original account and switched back to it.  If you ever decide to award any points (hint hint), please do it on this account.  Thanks.
0
 

Author Comment

by:pixitron
ID: 12327484
Hi, sorry for the delay in getting back to this question, i've been away.

Poushag - i will defintely award you the points - but i've a few niggling issues to sort out first.

I still cant connect to the server machine....I tried (on the server) vncviewer localhost:1 .... and the connection is refused.

I've setup the server as you outlined above - so once i sort out the niggling problem with the client the points are yours!
0
 

Author Comment

by:pixitron
ID: 12327510
let me update that - once i start the vncserver on the server and i can then connection with the vncviewer (on both server and client) ...however this is not giving me a login screen? (this is the inital question i asked)
0
 

Expert Comment

by:poushag
ID: 12327529
Well I have an idea - lets open a new question (that references this one) and then close this one.  I suggest this because I don't think your problem is vnc related at all  Post a link to the new question in this one right before you close it.
0
 

Author Comment

by:pixitron
ID: 12327756
ok fair enough - but what question will i ask!?
0
 

Expert Comment

by:poushag
ID: 12327808
Ask why theres no login screen when you run vnc thru XDMCP and xinetd (and make sure theres a link to this question).
0
 

Expert Comment

by:danlarkin
ID: 12327916
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now