Tell me more ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I've launched into X using startx, but now can't shutdown my pi, as I have no mouse, and I can't seem to access anything with the keyboard alone. What can I do?

share|improve this question
Which OS do you have? – finnw Jun 21 '12 at 22:49
1  
@finnw The recommended Debian – Tom Medley Jun 22 '12 at 8:52

4 Answers

up vote 13 down vote accepted

Try pressing Ctrl+Alt+F1.

This will switch you to a different tty. After logging in on this you can run commands as normal

Any F key under 6 will do.

share|improve this answer
This switched out to the console running X, I could then terminate X with ctrl-c and shutdown the machine. – Tom Medley Jun 20 '12 at 9:41
@TomMedley Glad I could help. – Jivings Jun 20 '12 at 10:02
This is a bit of a sledge hammer solution I think. – Skizz Sep 7 '12 at 9:15
@Skizz It's the only solution that will work in any session. – Jivings Sep 7 '12 at 14:10

Try Ctrl+Alt+Backspace.

This will kill the running X server.

share|improve this answer
2  
This doesn't work by default on recent versions of X. – Jivings Jun 20 '12 at 7:25
I wasn't sure to be honest! – Alex Chamberlain Jun 20 '12 at 8:10
No harm done. It's still useful to know. Some Window Managers re-enable it. – Jivings Jun 20 '12 at 8:38

Pressing ctrl-esc brings up the 'start' menu (for want of a better word) and then you can use the arrow keys to select 'logout'.

Which is the same as Windows - if you've not got a Windows key then ctrl-esc does the same thing (OK, a bit off topic but thought I'd make sure everyone understodd I wasn't just thinking it was Windows and that it also works on the default Pi destkop).

share|improve this answer
However, this is dependant on the display manager, whereas my solution will work in any X session. – Jivings Sep 7 '12 at 14:09

Why not stop it with sudo /etc/init.d/lightdm stop

share|improve this answer
I doubt that that would be possible, unless there was a terminal window open, and currently focused when the mouse was removed. – bearbin Sep 17 '12 at 18:19
If there is no window manager, decorator, etc. it means that startx didn't launch lightdm. Then lightdm status is not set as started/running and thus it can't be stopped with sudo /etc/init.d/lightdm stop – Avio Sep 27 '12 at 20:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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