How to get vncserver (Xvnc) and its apps to survive logout nicely???? [RHEL 5.1]
Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to get vncserver (Xvnc) and its apps to survive logout nicely???? [RHEL 5.1]
Using RHEL 5.1, I would like to login as a regular user, launch vncserver (which seems to be a perl frontend for Xvnc), use vncviewer to launch apps, quit the vncviewer, and logout with all the apps and vncserver running. And then (the part that I haven't made work yet), login as the same user, launch vncviewer and see exactly what I left before logging out.
Using a specially crafted ~/.vnc/xstartup (with a bunch of nohup's), I was able to keep apps running after logout. However, after logging back in and using vncviewer, there is only a blank screen without even a window manager. ps shows that the processes are running and the servers launched within vnc still respond correctly ... I just can't see the GUIs now. I thought that's what vnc would do for me.
Do the launched apps "forget" what X11 server they are using? Is the Xvnc X11 server somehow different after logout/login? Any solutions/recommendations?
[Update to clarify with example]
Here's what I want ...
1. Graphical login as normal user on RHEL 5.1
2. launch Xvnc via vncserver
3. run vncviewer and within its X11 window launch GUI apps (e.g., wireshark, xcalc, etc.)
4. quit vncviewer (no Xvnc logout, etc., just vncviewer quit)
5. logout of original login from step 1.
6. sometime later, graphical login as same normal user on RHEL 5.1 (as in step 1)
7. run vncviewer and see exactly what was present just before step 4.
In addition, everything launched in step 3 continues to run normally regardless of whether vncviewer is running (or not) and regardless of whether normal user is logged in (or not).
The killer seems to be step 5, but surely there is a workaround.
Last edited by rickhg12hs; 06-11-2009 at 10:12 PM.
Reason: clarify, provide example
Well what you are logging out of is the Desktop environment and/or windows manager that the Xserver presents to you after you start it. Unlike console access when you logout VNC viewer does not go to like a login screen, it leaves the xserver window up with nothing running. In order to do what you want or that it seems you want, you will need to just disconnect from the VNC session, not log of. Or (I have never tried this) maybe you could get the vncserver to run xdm, gdm or kdm and then when you initially connected to the vncserver you would see a user logon, you then log on and then when you logoff the vnc server goes back to the user logon screen. (I have seen this done in tutorials before but it has been a long time)
start the vncserver session with a nohup signal that should keep it running even if the parent process is exited.
Actually, vncserver is a perl script that launches Xvnc. I copied the script to a local dir and modified it so that Xvnc is launched with nohup. It does continue to run after logout, however after logging back in and launching vncviewer, it shows just a blank screen without even a window manager.
Something must change with the logout/login such that the X11 apps and/or vncviewer don't know that they are associated.
How to get vncserver (Xvnc) and its apps to survive logout nicely???? [RHEL 5.1]
Using RHEL 5.1, I would like to login as a regular user, launch vncserver (which seems to be a perl frontend for Xvnc), use vncviewer to launch apps, quit the vncviewer, and logout with all the apps and vncserver running. And then (the part that I haven't made work yet), login as the same user, launch vncviewer and see exactly what I left before logging out.
Using a specially crafted ~/.vnc/xstartup (with a bunch of nohup's), I was able to keep apps running after logout. However, after logging back in and using vncviewer, there is only a blank screen without even a window manager. ps shows that the processes are running and the servers launched within vnc still respond correctly ... I just can't see the GUIs now. I thought that's what vnc would do for me.
Do the launched apps "forget" what X11 server they are using? Is the Xvnc X11 server somehow different after logout/login? Any solutions/recommendations?
[Update to clarify with example]
Here's what I want ...
1. Graphical login as normal user on RHEL 5.1
2. launch Xvnc via vncserver
3. run vncviewer and within its X11 window launch GUI apps (e.g., wireshark, xcalc, etc.)
4. quit vncviewer (no Xvnc logout, etc., just vncviewer quit)
5. logout of original login from step 1.
6. sometime later, graphical login as same normal user on RHEL 5.1 (as in step 1)
7. run vncviewer and see exactly what was present just before step 4.
In addition, everything launched in step 3 continues to run normally regardless of whether vncviewer is running (or not) and regardless of whether normal user is logged in (or not).
The killer seems to be step 5, but surely there is a workaround.
In /etc/sysconfig/vncserver edit VNCSERVERS="1:$USERNAME" and replace USERNAME with any valid unprivileged accountname. Login to the USERNAME account, run 'vncpasswd', log out. Run 'service vncserver start' to see if it works OK. Login to your own account and run vncviewer, provide the password set by running vncpasswd from USERNAMEs account and you're in $USERNAME's session without futher login. Now logging out of $USERNAME's KDE/GNOME/XFCE/whatever else session will close the session but just pressing F8 will only close vncviewer. Logging out of your account, logging back in and running vncviewer should get you back to $USERNAME's session with everything still running.
In /etc/sysconfig/vncserver edit VNCSERVERS="1:$USERNAME" and replace USERNAME with any valid unprivileged accountname. Login to the USERNAME account, run 'vncpasswd', log out. Run 'service vncserver start' to see if it works OK. Login to your own account and run vncviewer, provide the password set by running vncpasswd from USERNAMEs account and you're in $USERNAME's session without futher login. Now logging out of $USERNAME's KDE/GNOME/XFCE/whatever else session will close the session but just pressing F8 will only close vncviewer. Logging out of your account, logging back in and running vncviewer should get you back to $USERNAME's session with everything still running.
This sounds like what I was looking for. I'll give it a go tomorrow. Thanks!
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is temporarily closed awaiting merge with duplicate http://www.linuxquestions.org/questi...el-5.1-732086/.
This sounds like what I was looking for. I'll give it a go tomorrow. Thanks!
Worked great! Thanks!
BTW, this solution appears to be the "redhat way" of what senior member tredegar suggested in the other thread I started (and was reminded not to do anymore!!!!).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.