How can I make it so that my SSH session does not stop after I type in startx? I am using a Mac to connect.

Background and Replication

I have had a great time figuring out the many intricate workings of SSH and the raspberry pi. One issue that keeps on bugging me is what I like to call the startx problem.

To replicate the issue, open terminal on a machine other than your pi and connect via ssh.

Now that you are connected, type startx. The terminal should respond with a bunch of globity gloop. Here is the exact error message that I get on my Mac.

Error Message

X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-2-mx5 armv7l Debian
Current Operating System: Linux raspberrypi 3.6.11+ #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013 armv6l
Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708.boardrev=0xf bcm2708.serial=0x2e2b9441 smsc95xx.macaddr=B8:27:EB:2B:94:41 sdhci-bcm2708.emmc_clock_freq=100000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Build Date: 10 December 2012  05:45:57AM
xorg-server 2:1.12.4-4 (Julien Cristau <jcristau@debian.org>) 
Current version of pixman: 0.29.1
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.1.log", Time: Sat Apr  6 00:21:55 2013
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Multiple definitions of the FOUR_LEVEL_KEYPAD key type
>                   Earlier definition ignored
> Error:            No Symbols named "mac" in the include file "macintosh_vndr/us"
>                   Exiting
>                   Abandoning symbols file "default"
  • I don't think this is a error message.And your ssh session is still active.It just opens the GUI.you can open a terminal from the desktop if the command line is what you need. – SteveIrwin Apr 6 '13 at 0:38
  • @SteveIrwin in the error message I provided it says Warning: and then Error: That is towards the bottom. – xxmbabanexx Apr 6 '13 at 0:53
  • 1
    If you just want to have control of the command line again rather than it appearing 'locked up' while X Windows is running, try 'startx &', which will run it in the background and return control of the command line. XWindows should be running on the attached monitor, but it won't work in the SSH console. – Octopus Apr 9 '13 at 20:39

startx starts the X Windows GUI. SSH is not designed to run X Windows in that way. If you want to connect to the GUI, you have two options.

1) Setup VNC, which you can use to connect to your pi after you run startx, see: http://learn.adafruit.com/adafruit-raspberry-pi-lesson-7-remote-control-with-vnc

2) run a local X server and connect with SSH -X "hostname" and then start an application with a GUI from the ssh session, such as Firefox.

See also: http://elinux.org/RPi_Remote_Access

| improve this answer | |
  • Prefer ssh -Y to ssh -X. – Bex Apr 17 '15 at 10:17

You can do all of Eric's #2 with

ssh -X raspberrypi exec startlxde

This will start OS X's X client and make your desktop your Raspberry Pi screen.

| improve this answer | |
  • Prefer ssh -Y to ssh -X. – Bex Apr 17 '15 at 10:17

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.