3

I was working with my Raspberry Pi, and I ended up messing up my Ubuntu machine. I ssh -X'd into the Pi from my Ubuntu 14.04 desktop, and was trying to get a graphical session to start on the pi so I could see it with X11 forwarding. I ran startx and that got an error, so looking around I saw this discussion on raspberrypi.org, and (not really knowing what I was doing) tried lxsession&.

This changed Ubuntu so it looked like some version of Windows, with a task bar at the bottom of the screen and a different look for all of my programs, most noticeably the tabs on my web browsers. This persisted after I closed the Pi session (except for the task bar: it is gone).

This is what I did in the terminal:

pi@raspberrypi ~ $ startx

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.18.7+ #755 PREEMPT Thu Feb 12 17:14:31 GMT 2015 armv6l
Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708.boardrev=0xe bcm2708.serial=0xc4895bc4 smsc95xx.macaddr=B8:27:EB:89:5B:C4 bcm2708_fb.fbswap=1 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Build Date: 11 February 2015  09:31:17PM
xorg-server 2:1.12.4-6+deb7u6 (Julien Cristau <jcristau@debian.org>) 
Current version of pixman: 0.33.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.0.log", Time: Fri Apr 24 02:10:24 2015
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
FATAL: Module g2d_23 not found.
^Cxinit: connection to X server lost

waiting for X server to shut down Server terminated successfully (0). Closing log file.

xinit: unexpected signal 2
pi@raspberrypi ~ $ lxsession&
[1] 2290
pi@raspberrypi ~ $ 
(lxpanel:2297): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-can-change-accels after class was initialised

(lxpanel:2297): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-menu-popup-delay after class was initialised

(lxpanel:2297): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-menu-popdown-delay after class was initialised

** (lxpolkit:2301): CRITICAL **: polkit_agent_listener_register_with_options: assertion 'POLKIT_IS_SUBJECT (subject)' failed

(lxpolkit:2301): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(lxpanel:2297): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-menu-images after class was initialised

(lxpanel:2297): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-label-select-on-focus after class was initialised
pi@raspberrypi ~ $ Openbox-Message: A window manager is already running on screen 0

(lxpanel:2297): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-button-images after class was initialised

(pcmanfm:2298): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-can-change-accels after class was initialised

(pcmanfm:2298): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-menu-popup-delay after class was initialised

(pcmanfm:2298): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-menu-popdown-delay after class was initialised

(pcmanfm:2298): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-label-select-on-focus after class was initialised

(pcmanfm:2298): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-menu-images after class was initialised
tray: another systray already running
^C
pi@raspberrypi ~ $ sudo shutdown -h now

Broadcast message from root@raspberrypi (pts/0) (Fri Apr 24 02:22:27 2015):
The system is going down for system halt NOW!
pi@raspberrypi ~ $ Connection to 192.168.254.7 closed by remote host.
Connection to 192.168.254.7 closed.
max@max-ubuntu:~$ ^C
max@max-ubuntu:~$ man lxsession
No manual entry for lxsession
max@max-ubuntu:~$ lxsession -help
The program 'lxsession' is currently not installed. You can install it by typing:
sudo apt-get install lxsession
max@max-ubuntu:~$ lxsession& -help
[1] 25443
No command '-help' found, did you mean:
 Command 'dhelp' from package 'dhelp' (universe)
-help: command not found
max@max-ubuntu:~$ The program 'lxsession' is currently not installed. You can install it by typing:
sudo apt-get install lxsession
ok
ok: command not found
[1]+  Exit 127                lxsession
[1]+  Exit 127                lxsession

What causes this problem and how can it be fixed? Will a reboot on the Ubuntu machine get back the Ubuntu look, or will it make this permanent?

This is what my Firefox browser looks like now. Most noticeably, the tabs and scroll bars look different:

The tabs don't look like normal Ubuntu.

EDIT: I fixed it by rebooting, but I'd still be interested to know why this happens.

3 Answers 3

2

The Fix

Rebooting is sufficient to fix this, but not necessary. You can fix your desktop by logging out and back in. You would do this on the affected system, that is, the system whose desktop was messed up, the Ubuntu system that was used as the SSH client, not the Rapsberry Pi that was the SSH server. Note that just locking and unlocking the screen will not work--but logging out is enough.

If you're using Unity, it's likely running compiz --replace on the affected machine would also work and avoid the need to log out, but I recommend logging out and back in.

Rebooting fixed the problem because it involved logging out and back in. It's okay, but not necessary.


What Happened

When you use ssh -X and run a graphical program, the program:

  • runs on the SSH server (here, the Raspberry Pi)
  • displays on the SSH client (here, your Ubuntu system)

LXSession is LXDE's session manager. Running lxsession on the SSH server from within the ssh -X session starts a graphical LXDE session on the server using the client's display. This produces the two major changes you noticed:

lxsession runs lxpanel. LXDE uses LXPanel as its panel. It somewhat resembles the Windows taskbar in that it has a single panel defaulting to the lower edge of the screen that, unless customized, has (a) a single nested menu openable from the left edge of the panel from which applications are placed in groups and (b) a window list inside the panel itself that facilitates switching between applications.

lxsession runs openbox. LXDE uses Openbox as its window manager (see also this article and this page). Window managers control how windows are displayed; they are what allow you to switch, move, and resize windows; and they provide borders and styling. Your Unity interface uses the Compiz window manager. Because it was connected to the display on the SSH client, the openbox instance running on the SSH sever attempted to manage the windows on the SSH client.

When you shut down and disconnected from the SSH server, all programs running on the SSH server that were using the SSH client's display stopped. The panel disappeared, as you observed. Openbox also stopped attempting to manage windows on the SSH client, but it had already displaced Compiz.

Other Possible Fixes

Those were the two major changes, but probably not the only ones. If you really wanted to know everything lsession ran, you could consult both its documentation and read the configuration files on the Raspberry Pi that it uses, or you could try replicating the problem and running pstree on the SSH server to see everything lxsession started. But this is unnecessary. Logging out and back in is sufficient to set everything right again. Rebooting, as you did, is also sufficient.

Because the major problem was that Compiz was no longer working properly, running compiz --replace on your Ubuntu system (the SSH client) would have fixed that. But logging out and back in is easy, simple, and doesn't require you to spend more time analyzing the problem.

Why You Didn't Find lxsession on the SSH Client

After you closed the connection to the Raspberry PI (the SSH server), you tried the commands man lxsession and lxsession on your Ubuntu system that was the SSH client. You didn't have that manpage or that executable, however, because lxsession wasn't installed--or running--on the SSH client. It was running on the SSH server and some of the programs it ran affected the SSH client.

If this were a Lubuntu system or you had otherwise installed LXDE--or lxsession specifically--then you would have been able to view the manual page and run the program. This would not necessarily have been the same version of lxsession as you have on the Raspberry Pi. You can try SSHing to the Raspberry Pi and running man lxsession there. (Unless you are trying to reproduce the problem, I recommend against running lxsession on the Raspberry Pi.)


What You Meant To Do

You could run X11 on Ubuntu without a session manager or even a window manager, and you could run ssh -X and then lxsession on the Raspberry Pi. With nothing like a existing X session already running, your desktop would not be disrupted. But I doubt this is what you want. You probably want one of three things:

  • To run individual graphical programs that are installed on the SSH server through ssh -X. In that case, just run those programs, e.g., xclock, firefox, libreoffice. SSH will forward them to the GUI on the SSH client. (If you want to be able to disconnect and reconnect without quitting the program, then one of the next two options may interest you, but see this answer and that one.)
  • To run a persistent graphical desktop on the SSH server that you can disconnect from and connect to, without ending and restarting the desktop session. In that case, you won't want programs like lxsession to be limited to one SSH session or to directly use and rely on the SSH client's display. In this situation, one solution is to keep a graphical desktop running on the SSH server and connect to it from the client. This can be done, for example, with VNC or xrdp. (Remmina is a popular client.) Readers may need to ask new questions based on their specific situations, but see How do I set up xrdp session that reuses an existing session?
  • To make the SSH server fully manage a desktop on the SSH client. If you really want this, and you're already using a GUI on the client that you don't want to be disrupted--which is what happened to you--then you can run a second X server at the same time on the SSH client. Of these three options, I think this is the one you are least likely to want--though it is the most similar to what you did--and specific details of how to do it are beyond the scope of this answer. But see this question and that one.
1

It was because you did lxsession& not just lxsession.

When you put & at the end of a command, it will run in the background, so when you closed the session, the process was still active.

This is why rebooting fixed it as all the processes got shut down. including the background ones you created like lxsession&.

Maybe next time try running it without the &.

0

Rebooting fixes the problem, giving me a normal screen again:

fixed, normal Ubuntu look

However, when I rebooted, I was shown a giant raspberry on my desktop momentarily, as would be seen when shutting down the Pi with a GUI started. (At this point, the raspberry pi was turned off and disconnected for quite some time.)

So, if anyone has this problem, rebooting your computer will fix it.

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.