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. |
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)
|
Quote:
I've updated the original post/question to hopefully make the goal (and problem) clearer. Please post any new ideas. Thanks! |
start the vncserver session with a nohup signal that should keep it running even if the parent process is exited.
|
Quote:
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. |
If you run ps -aux or pstree after logging out of your intial session do you see everything running that you left 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.
|
Quote:
|
Quote:
|
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/.
|
On my server, I have this line in /etc/rc.local just before the final exit 0
Code:
su - tred -c " cd /home/tred && vncserver :1 -geometry 1024x768 -depth 24" It starts a vncserver on display :1 as myself ( tred ) at boot time. I can connect to it with Code:
vncviewer server:1 HTH |
Quote:
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!!!!). http://www.linuxquestions.org/questi...96#post3573596 |
All times are GMT -5. The time now is 08:09 PM. |