LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-01-2008, 08:49 PM   #1
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
How to gracefully exit a VNC/NX session?


Running Ubuntu 8.10 Intrepid. FreeNX server. Gnome desktop integrated VNC server (vino - calls x11vnc, vncviewer).

I connect fine from the free NoMachine NX client on a Windows box. The VNC session runs over NX, which runs over ssh. All works fine. Faster than plain old VNC connections.

Now how do I disconnect (gracefully) from the client (Windows) side? I've found no key combos or menu choices on the Windows client side to shut things down. Ctrl-Alt-Del to Task Manager and forceable killing the NX client works, but leaves the x11vnc and vncviewer processes running on the Linux (server) end.

It also works to fire up a Linux terminal window while still in the VNC session and then run "pkill x11vnc". This shuts down the VNC/NX session instantaneously and cleans up everything nicely on the Linux end, because the shutdown is being initiated on the Linux end. The NX client on the Windows side instantaneously dissappears too when you pkill the Linux server end.

Is there a better way to initiate the shutdown from the client (Windows) end? While the pkill seems to work fine, it feels a little "kludgy" - like you're hitting something with a big hammer when a small hammer would do. But I don't know the small hammer.

Thanks!
 
Old 12-01-2008, 09:32 PM   #2
sunshineforall
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
just stop the service. Pkill is killing a process, you are correct, this may leave stuff hanging around on your system. Basically as far as i understand it (i use centos) your linux system is running a process in the background waiting for connections. the correct way to stop this would be something like "service vncserver stop" or something to that effect. try "service vncserver status" to see if this command might work. I have no experience with your os, so check out how the service was started.

The other thing is all this could be typed from your nx or vnc server session, just by opening a shell, rather than opening another ssh or whatever to your linux box. i have never tried this but logic dictates that it might work.


this is definately not from a linux guru, just scrolling through the questions and this seemed like a logical respomse.

good luck.
 
Old 12-01-2008, 10:37 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Original Poster
Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
I don't want to kill the entire vnc service because I will want to use VNC to access the machine again later. I just want to terminate the current session, leaving the vnc server running to accept future connections again later. The default Gnome/Ubuntu vnc server is named "/usr/lib/vino/vino-server" and that needs to stay running after I terminate my individual session. x11vnc is maintaining the session, and killing that doesn't affect vino-server ... that keeps running as I want it to.

I was just wondering if there is some way - on the client end (Windows) - to terminate the session (under the hood this client-side termination would have to indirectly kill x11vnc and vncviewer on the remote Linux end).

Using pkill is OK with me, I guess. It works. But I was thinking that other users who are not that familiar with VNC might end up scratching their heads wondering how to exit the session. They may be running the client on a Windows box and would expect a "Windows way" to exit. i.e., "click on something". Firing up a terminal window and running "pkill x11vnc" just doesn't strike me as something the average Windows user would think to do. Of course it could be argued that the average Windows user wouldn't be using NX and VNC to access a Linux Gnome desktop in the first place! So maybe pkill really is the officially approved way to end your NX/VNC session.
 
Old 08-20-2009, 11:53 PM   #4
travelinrob
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Rep: Reputation: 0
RE: How to gracefully exit an nxclient session

When I set up nxclient on my machine it put a shortcut on my desktop. It worked when I clicked the icon and logged in, but I could not figure out how to end the session for the life of me. I tried killing the process, etc, but then I could not log into a new session.

I found that if instead of clicking the shortcut I typed in
'/usr/NX/bin/nxclient --admin', not only could I initiate a session, but I had the option to end a session and even discard the log file. So, I simply right clicked on the desktop icon, selected properties, and altered the 'Command' line under the 'Launcher' tab to the above command and now it works perfectly.
 
Old 08-21-2009, 12:03 AM   #5
travelinrob
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Rep: Reputation: 0
FYI, I am not sure if it is because my nxserver is an old machine, but after I tell it to close the session, although it closes the session windows right away, it takes about 30 seconds to actually list the session as closed. Then, I right click on the session listing again and tell it to remove the session.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to gracefully start and stop VNC? landev Linux - General 2 02-02-2008 06:06 PM
Xsession:warning:unable to write to /tmp;X session may exit with an error gabsik Linux - Desktop 9 05-31-2007 09:51 PM
How do I exit a full screen Tsclinet session? fabre Linux - Software 2 03-15-2006 06:09 AM
Exit Session - Sort Of... GNewbie MEPIS 2 02-01-2006 01:00 AM
Exit X Window System session Azzath Linux - Software 4 01-04-2005 02:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration