VNCServer does not properly end sessions

Posted on 2007-07-31
Last Modified: 2013-12-16
Running PCLinuxOS .92 and a generic vncserver, every time I end a remote vnc session it stalls at a black screen after logging out of the session.  Then I have to manually kill the vncserver process on the server in order to be able to remotely control it again, otherwise when I access it via remote control I see the black screen.  Suggestions?

Question by:sc456a
    LVL 19

    Expert Comment

    This sounds like you have your VNC session started by (x)inetd, correct?  When started by an inetd session a new X session is created and then closing the VNC session terminates the X session - if the X session does not complete the closing, you get attached to the already-running, but useless, X session from last time.
    LVL 1

    Author Comment

    So what can I do to resolve this?
    LVL 19

    Expert Comment

    What is in your vnc startup script(s) and what parameters are being fed into Xvnc/vncserver?  Is the VNC session being started by (x)inetd (you didn't actually answer that one)?

    Note there's a slip up in my first: if it is being started by inetd/xinetd then you should be getting a completely seperate session each time - the re-use version comes from running Xvnc/vncserver native.
    LVL 1

    Author Comment

    I'm not sure how to check the (x)inetd part, but here is the VNC script:


    # Uncomment the following two lines for normal desktop:
     exec /etc/X11/xinit/xinitrc

    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    startx &
    LVL 19

    Accepted Solution

    Wow, this is long-overdue a reply.  My apologies for dropping the ball here.

    OK, try altering the last line of your script to instead run the window manager of your taste.  For example, for kde:

    kde &

    Does that have any bearing?
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    Updating Wheezy to latest distro 7 39
    Encrypted Laptop running Linux 3 60
    Mail relay on Centos 1 32
    shell script to send sms 2 34
    Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
    Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…

    759 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

    14 Experts available now in Live!

    Get 1:1 Help Now