I am in the middle of a project where I repeatedly have to stop X11 to debug. I stop with Ctrl+Alt+F1 then login and

$ sudo /etc/init.d/gdm stop

Then I go about my debugging. then restart gdm with

$ sudo /etc/init.d/gdm start

and I get back the login screen when I login yet again, and execute "users" and get back

$ users
aredd aredd aredd aredd

making me think that my I'm still logged in form the first time, the terminal without gnome, gnome again, and another instance. If my old gnome session is still logged in how do I resume that session instead of starting a new one?


Can't you just Ctrl+Alt and then hit F-x keys until you get back to GNOME? That's what I do.

On my ubuntu machine Ctrl+Alt+F7 gets me back to my gnome session.

|improve this answer|||||
  • F7 has been the start of X TTYs on every Linux computer I've ever used, so that's a pretty safe first guess – Michael Mrozek Nov 11 '10 at 2:36

Quoth the manual:

The gnome-session-save program can be used from a GNOME session to save a snapshot of the currently running applications. This session will be later restored at your next GNOME session.

Is that what you are looking for? From your question it is unclear if you are concerned about saving the state or of truly logging out your gdm.

|improve this answer|||||
  • I would rather just shut off X11 since that is where the problem is, but AFAIK that is not possible without turning off gdm. The problem seems to be that the programs I leave running when ctrl+alt+F1 seem to be still running, and I would like to get back to my same state when returning to gnome after doing what I need with X11 off. – Andrew Redd Nov 10 '10 at 17:20

Depending on your distribution's startup scripts, and perhaps on what you're doing to your X server, stopping the gdm service may or may not kill the X display and the programs running on it.

The easiest way to kill your X server is to press Ctrl+Alt+Backspace. If that X server is running in a virtual machine, make sure you send the key combination to the VM and not to the host (e.g. under VirtualBox, press Host+Backspace). This will kill your session and typically will give you a login prompt as gdm restarts the X server. Make sure you don't have the DontZap option in your xorg.conf (it disables Ctrl+Alt+Backspace; it's off by default).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.