User avatar
Mortimer
Posts: 923
Joined: Sun Jun 10, 2012 3:57 pm

How to exit x?

Wed Jul 04, 2012 10:33 pm

How to get into the GUI is obvious, the RPi even tells me after every boot and login.

Is there a way to exit the GUI and return the command line?
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: How to exit x?

Wed Jul 04, 2012 10:38 pm

Switch back to the console from which you started X (Ctrl/Alt/F1) then hit ^C.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
penguintutor
Posts: 376
Joined: Tue May 08, 2012 9:11 am
Location: UK
Contact: Website

Re: How to exit x?

Wed Jul 04, 2012 10:53 pm

Choose logout from the program menu - or the red power off button in the bottom right - it will then return you back to the shell.

Nr90
Posts: 216
Joined: Sat Nov 26, 2011 12:39 pm

Re: How to exit x?

Wed Jul 04, 2012 10:54 pm

Open up terminal and type pkill x

User avatar
Mortimer
Posts: 923
Joined: Sun Jun 10, 2012 3:57 pm

Re: How to exit x?

Wed Jul 04, 2012 10:55 pm

Thanks that works.

What does the LXDE logout menu option actually do, because that seems to kill the RPi? I would have expected that to drop me back out to the command line.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: How to exit x?

Wed Jul 04, 2012 11:25 pm

Mortimer wrote:Thanks that works.
Which 'that'?
Mortimer wrote: What does the LXDE logout menu option actually do, because that seems to kill the RPi? I would have expected that to drop me back out to the command line.
According to the parallel thread on this topic, that no workie and is to be avoided.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
Mortimer
Posts: 923
Joined: Sun Jun 10, 2012 3:57 pm

Re: How to exit x?

Wed Jul 04, 2012 11:50 pm

Joe Schmoe wrote:
Mortimer wrote:Thanks that works.
Which 'that'?
Sorry the ctrl-alt-F1, ctrl-C method worked for me.

I didn't notice the pkill x post from Nr90, but I have no reason to suspect that won't work either.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

User avatar
clickykbd
Posts: 117
Joined: Wed Jun 06, 2012 2:21 am
Location: Austin, Texas
Contact: Website

Re: How to exit x?

Thu Jul 05, 2012 12:03 am

Joe Schmoe wrote:
Mortimer wrote: What does the LXDE logout menu option actually do, because that seems to kill the RPi? I would have expected that to drop me back out to the command line.
According to the parallel thread on this topic, that no workie and is to be avoided.
that parallel thread is here:
http://www.raspberrypi.org/phpBB3/viewt ... 63&t=10227

User avatar
grumpyoldgit
Posts: 1452
Joined: Thu Jan 05, 2012 12:20 pm

Re: How to exit x?

Thu Jul 05, 2012 12:37 am

Mortimer wrote:
Joe Schmoe wrote:
Mortimer wrote:Thanks that works.
Which 'that'?
Sorry the ctrl-alt-F1, ctrl-C method worked for me.

I didn't notice the pkill x post from Nr90, but I have no reason to suspect that won't work either.
Yeah. This has only been a development in the last few days if the Pi is kept up to date. Previously you could just exit from x and had to give a sudo halt to close it down.

User avatar
penguintutor
Posts: 376
Joined: Tue May 08, 2012 9:11 am
Location: UK
Contact: Website

Re: How to exit x?

Thu Jul 05, 2012 7:45 am

The logout menu option should work. I hadn't noticed a problem before, but then once I've gone into x I don't normally come out of it much and I usually access the Pi remotely.

I've just tried a few times and sometimes it works and other times it's crashing (unable to connect by network so it's not just the screen session that's hanging).

There is already a bug report for this for Wheezy:
https://github.com/asb/spindle/issues/79

User avatar
Mortimer
Posts: 923
Joined: Sun Jun 10, 2012 3:57 pm

Re: How to exit x?

Thu Jul 05, 2012 8:16 am

I didn't know about ctrl-alt-backspace, that works for me too.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

User avatar
clickykbd
Posts: 117
Joined: Wed Jun 06, 2012 2:21 am
Location: Austin, Texas
Contact: Website

Re: How to exit x?

Thu Jul 05, 2012 8:45 am

For others reading, If ctrl-alt-backspace doesn't do it for you, you may have opted to exclude it in your keyboard configuration step, which you can redo using the raspi-config script or

Code: Select all

sudo dpkg-reconfigure keyboard-configuration

Babbage6913
Posts: 4
Joined: Tue Jul 03, 2012 6:09 pm

Re: How to exit x?

Thu Jul 05, 2012 9:42 pm

Have also had some problems with the Pi hanging on reboot

So today, I setup 2 different SD cards

First card was a 2GB integral, and I just re-imaged via win32image. Then I did my standard setup as follows:

Boot then reboot to set the card up, get rid of nfs fails etc. BTW using Debian image from download section.

Then I 'sudo apt-get update' twice. First time to update, second to clear errors. If I then 'startx' everything is fine, reboot menu option works ok, as does 'sudo reboot'.

Then I 'sudo apt-get upgrade' and reboot. Now if I 'startx' using the reboot option on menu gets through the shutdown sequence to the 'system halted' ok. Then the composite signal drops and the Pi hangs, all leds lit and doesn't reboot. Same if I 'sudo reboot'. Or doesn't bring composite signal back up. I think the Pi is booting as all the leds do what they normally do. Not sure if this is what others are getting.

Second card, 4GB PNY, I reformatted back to FAT32, then re-imaged the Debian.

This time I did the 'sudo apt-get update', again twice. Then I did the steps needed to run rpi-update.
Once rpi-update finishes, reboot, after 'startx' everything is fine. Using the reboot menu option works, as does 'sudo reboot'.

If I type 'sudo shutdown -h -P now' the Pi shuts down, after 'system halted' appears, composite signal drops, network leds go off, ok flashes then left with just power led lit.

NADinmore
Posts: 1
Joined: Tue Dec 11, 2012 12:48 pm

Re: How to exit x?

Tue Dec 11, 2012 1:05 pm

Thanks for the tips on exiting X with keyboard shortcuts. I started my (son's) RPi yesterday, but something happened to the display in the GUI and the menu bar at the bottom disappeared...(I tried changing the TV aspect ratios to no avail).
Any tips on resolving this would be appreciated!

UsedBits
Posts: 3
Joined: Tue Oct 15, 2013 3:44 am

Re: How to exit x?

Tue Oct 15, 2013 3:53 am

My pi is headless. It is accessed from my Windows XP box via Putty and TightVNC.

I made the mistake of logging out of the X screen via the 'red power button' at the bottom right-hand corner of the virtual window. The desktop, the one with the huge raspberry in the middle, remains, but all of the desktop icons are gone. That said, can still work the desktop from the bottom left-hand corner of the windows, e.g. all of the menu items pop up and are active. Ctrl-alt-backspace does nothing, as does ctrl-alt-F1.

How does one log back in? I'd like to access those desktop icons.

Oh, once logged out of the desktop, the red power button is replaced by a little green running man.

From the 'run' command, one can run 'lxde-logout', but there appears to be no corresponding 'lxde-login'.

I've tried terminating and restarting tightvncserver, and rebooting the pi. Nothing, so far, has been able to restart a remote X session with the desktop icons restored.

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: How to exit x?

Tue Oct 15, 2013 7:28 am

UsedBits wrote:My pi is headless. It is accessed from my Windows XP box via Putty and TightVNC.

I made the mistake of logging out of the X screen via the 'red power button' at the bottom right-hand corner of the virtual window. The desktop, the one with the huge raspberry in the middle, remains, but all of the desktop icons are gone. That said, can still work the desktop from the bottom left-hand corner of the windows, e.g. all of the menu items pop up and are active. Ctrl-alt-backspace does nothing, as does ctrl-alt-F1.

How does one log back in? I'd like to access those desktop icons.

Oh, once logged out of the desktop, the red power button is replaced by a little green running man.

From the 'run' command, one can run 'lxde-logout', but there appears to be no corresponding 'lxde-login'.

I've tried terminating and restarting tightvncserver, and rebooting the pi. Nothing, so far, has been able to restart a remote X session with the desktop icons restored.
You don't actually need to log out of X using the menu, you can just close your VNC viewer program on Windows and use this command in Putty.

Code: Select all

vncserver -kill :1

UsedBits
Posts: 3
Joined: Tue Oct 15, 2013 3:44 am

Re: How to exit x?

Tue Oct 15, 2013 11:33 am

But I already *have* logged out. And killing the X, then restarting, doesn't reinstate the desktop icons.

So, again, how does one log back into the X screen after having logged out via the 'red power button' at the bottom right-hand corner of the screen?

anonymous6546
Posts: 1
Joined: Wed Nov 23, 2016 9:57 pm

Re: How to exit x?

Wed Nov 23, 2016 10:01 pm

Killall5 into the run box on menu or in terminal

brat.ibr
Posts: 7
Joined: Sat Dec 19, 2015 12:55 am

Re: How to exit x?

Sun Dec 18, 2016 2:12 am

RPi 3 running Jesse connected to monitor via HDMI cable
Go to Menu (top left corner of the X screen)
Click Shutdown
which will provide you with Three options :
Shutdown -or- Reboot -or- Exit to command line

User avatar
PeterO
Posts: 4953
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to exit x?

Sun Dec 18, 2016 8:59 am

anonymous6546 wrote:Killall5 into the run box on menu or in terminal
Before you reply to any more threads, please check how old they are. This thread had been dead for 3 years !!!
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

hcostelha
Posts: 2
Joined: Tue Jan 24, 2017 5:51 pm

Re: How to exit x?

Tue Jan 24, 2017 5:54 pm

I know this is an old thread, but since it is the top result when searching for it online, here goes my suggestion:

Code: Select all

sudo service lightdm stop
Using "pkill x", Ctrl+Backspace or similar is not the best option, since X is restarted immediately.
Of course there is always the option to disable starting X automatically.

Martin Frezman
Posts: 1020
Joined: Mon Oct 31, 2016 10:05 am

Re: How to exit x?

Wed Jan 25, 2017 1:01 am

It depends on why you are doing it. I.e., what the overall goal is.

Usually, when I want to "exit X", the reason I am doing it is precisely so that it will restart. I.e., it has gotten mucked up and I want a fresh start.

If your goal is to change your system so that it no longer runs the GUI, then your method will work, but your method is just the "hands on" way of doing what the clicky-clickly folks do in either the text mode or GUI version of "raspi-config". Of course, I suppose your method has the benefit that it takes effect immediately, while the raspi-config method requires a reboot (I have not tested this).

Anyway, whatever works... Note that the original post was created well before Raspbian did either of these things:
1) Ran systemd
2) Booted automatically (in the default, out-of-the-box setup) into a GUI
If this post appears in the wrong forums category, my apologies.

hcostelha
Posts: 2
Joined: Tue Jan 24, 2017 5:51 pm

Re: How to exit x?

Wed Jan 25, 2017 2:44 am

Martin Frezman wrote:[...]

If your goal is to change your system so that it no longer runs the GUI, then your method will work, but your method is just the "hands on" way of doing what the clicky-clickly folks do in either the text mode or GUI version of "raspi-config". Of course, I suppose your method has the benefit that it takes effect immediately, while the raspi-config method requires a reboot (I have not tested this).

[...]
Note that my suggestion only stops X for the current "session". If you reboot it will start normally. Changing in raspi-config disables it until you change the configuration again.

adamreisnz
Posts: 7
Joined: Sat Sep 16, 2017 9:29 am

Re: How to exit x?

Sun Sep 17, 2017 7:11 pm

Running pkill x through ssh (or in the background) was the only one that worked for me.
The keyboard combinations had no effect whatsoever.

Return to “Beginners”