Sponsored Content
Full Discussion: vnc only allows 2 users
Operating Systems Solaris vnc only allows 2 users Post 302932572 by DGPickett on Thursday 22nd of January 2015 02:58:32 PM
Old 01-22-2015
It looks like another app is using 59?? ports. Does vncserver check for taken ports both 60?? and 59??, if not a vnc bug. Yes, vncserver checks both ports:
Code:
#
# GetDisplayNumber gets the lowest available display number.  A display number
# n is taken if something is listening on the VNC server port (5900+n) or the
# X server port (6000+n).
#
sub GetDisplayNumber
{
    foreach $n (1..99) {
        if (&CheckDisplayNumber($n)) {
            return $n+0; # Bruce Mah's workaround for bug in perl 5.005_02
        }
    }
    die "$prog: no free display number on $host.\n";
}
 
#
# CheckDisplayNumber checks if the given display number is available.  A
# display number n is taken if something is listening on the VNC server port
# (5900+n) or the X server port (6000+n).
#
sub CheckDisplayNumber
{
    local ($n) = @_;
    socket(S, $AF_INET, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n";
    eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))';
    if (!bind(S, pack('S n x12', $AF_INET, 6000 + $n))) {
        close(S);
        return 0;
    }
    close(S);
    socket(S, $AF_INET, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n";
    eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))';
    if (!bind(S, pack('S n x12', $AF_INET, 5900 + $n))) {
        close(S);
        return 0;
    }
    close(S);
    if (-e "/tmp/.X$n-lock") {
        warn "\nWarning: $host:$n is taken because of /tmp/.X$n-lock\n";
        warn "Remove this file if there is no X server $host:$n\n";
        return 0;
    }
    if (-e "/tmp/.X11-unix/X$n") {
        warn "\nWarning: $host:$n is taken because of /tmp/.X11-unix/X$n\n";
        warn "Remove this file if there is no X server $host:$n\n";
        return 0;
    }
    if (-e "/usr/spool/sockets/X11/$n") {
        warn("\nWarning: $host:$n is taken because of ".
             "/usr/spool/sockets/X11/$n\n");
        warn "Remove this file if there is no X server $host:$n\n";
        return 0;
    }
    return 1;
}

It'd be interesting to see the lsof of those ports, who is using them for what, but you need to be root for that (to see all user info). You'd think 100 ports would be enough.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Vnc

Anyone know of a site where I can download a copy (non-evaluation copy and preferably free. ;) nods to Neo's post in UNIX Operating System thread) of VNC for RedHat 8? Thanks in advance. (7 Replies)
Discussion started by: google
7 Replies

2. HP-UX

VNC depot

Hi All, I'm having a very difficult time compiling VNC for HPUX 11.0. Is there a vnc depot sitting somewhere out there ? Thanks a bunch, KENT (1 Reply)
Discussion started by: kxchen_home
1 Replies

3. Shell Programming and Scripting

VNC Timer

Hello fellows, I am new in this forum, i would appreciate your assistance. I need a timming system for my vnc desktops (Cybercafe timer stuff). Each unix user login to my server only with vnc, and i want to write a program that can generate timer tickets and have control on the time used for... (0 Replies)
Discussion started by: foweja
0 Replies

4. UNIX for Advanced & Expert Users

Timer for VNC

Hello fellows, I am new in this forum, i would appreciate your assistance. I need a timming system for my vnc desktops (Cybercafe timer stuff). Each unix user login to my server only with vnc, and i want to write a program that can generate timer tickets and have control on the time used for... (1 Reply)
Discussion started by: foweja
1 Replies

5. UNIX for Dummies Questions & Answers

Problem with VNC

Hi all, I have vncserver installed on Sun Solaris 8. The xstartup file looks like: #!/bin/sh && xrdb $HOME/.Xresources xsetroot -solid grey xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & /usr/dt/bin/dtwm & I have installed VNC on /usr/local/bin. When I try to... (0 Replies)
Discussion started by: naw_deepak
0 Replies

6. Solaris

VNC Connect

Hi all, Almost at my wit ends, trying to connect to vnc port 0 on Solaris 10. configured Xservers with the followin: :0 Local local_uid@none root /usr/X11/bin/Xserver :0 -rfbauth /etc/.vnc/passwd -rfbport 5900 :1 Local local_uid@none root /usr/X11/bin/Xserver :1 -rfbauth... (1 Reply)
Discussion started by: srage
1 Replies

7. Solaris

VNC in solaris 10

First you need to know that I'm 100% new to solaris/unix. I'm trying to setup VNC on my sparc based server that I just installed solaris 10 on but when I type in vncserver to start it, I get "couldn't find "xauth" on your PATH" What do I do so I can get a gui up and running remotely on my... (20 Replies)
Discussion started by: QuadRunner750
20 Replies

8. Solaris

To restrict the users not to change the passwords for NIS users

Hi All, How to restrict the NIS users not to change their passwords in for NIS users?? and my NIS user is unable to login to at client location what could be the problem for this ? Any body can help me. Thanks in advance. (1 Reply)
Discussion started by: Sharath Kumar
1 Replies

9. Red Hat

Showing all users in 'users' and 'top' commands

Hi All, I work in a multi user environment where my school uses Red Hat Linux server. When I issue commands such as "top" or "users", I get to see what others are doing and what kinds of applications they are running (even ps -aux will give such information). "users" will let me know who else is... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

10. Shell Programming and Scripting

Create multiple users with individual passwords to users

hi, i am new to shell scripts i write a shell script to create multiple users but i need to give passwords to that users while creating users, command to write this script (1 Reply)
Discussion started by: DONFOX
1 Replies
vncserver(1)							     TightVNC							      vncserver(1)

NAME
vncserver - a wrapper to launch an X server for VNC. SYNOPSIS
vncserver [:display] [-geometry widthxheight] [-depth depth] [-pixelformat rgbNNN|bgrNNN] [-name desktop-name] [Xvnc-options...] vncserver -kill :display vncserver -help DESCRIPTION
vncserver is a wrapper script for Xvnc, the free X server for VNC (Virtual Network Computing). It provides all capabilities of a standard X server, but does not connect to a display for itself. Instead, Xvnc creates a virtual desktop you can view or control remotely using a VNC viewer. OPTIONS
You can add Xvnc options at the command line. They will be added to the invocation of Xvnc without changes. The options provided by the vncserver itself are as follows: :display The display number to use. If omitted, the next free display number is used. -geometry widthxheight Set desktop width and height. -depth depth Set the colour depth of the visual to provide, in bits per pixel. Must be a value between 8 and 32. -pixelformat rgbNNN|bgrNNN Set colour format for pixels representation. The viewer can do the conversion to any other pixel format, but it is faster if the depth and pixel format of the server is the same as the equivalent values on the viewer display. -name string This specifies the name of the desktop. -kill :display Stops the session running on the specified display. -help Prints a short usage notice to stderr. EXAMPLES
vncserver Invokes Xvnc on the next available display and with suitable defaults. vncserver :1 Invokes Xvnc on display :1. vncserver -geometry 800x600 -depth 16 :1 Invokes Xvnc on display :1 with desktop size of 800x600 pixels and color depth of 16 bits per pixel. vncserver -kill :1 Shuts down Xvnc server on display :1. SEE ALSO
Xvnc(1), vncviewer(1), vncpasswd(1), vncconnect(1) AUTHORS
Original VNC was developed in AT&T Laboratories Cambridge. TightVNC additions were implemented by Constantin Kaplinsky. Many other people participated in development, testing and support. Man page authors: Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>, Tim Waugh <twaugh@redhat.com>, Constantin Kaplinsky <const@tightvnc.com> August 2006 vncserver(1)
All times are GMT -4. The time now is 01:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy