This on a Raspberry Pi 4 Model B Rev 1, running Buster originally installed as a Stage 4 - Normal Raspbian image.
https://github.com/RPi-Distro/pi-gen
This Pi is headless. RealVNC is enabled via raspi-config.
When I log in to this Pi via VNC the desktop that I see is solid blue (sometimes black) and contains no menu bar or desktop icons. A menu can be enabled by right clicking the desktop. Many menu items do not work at all.
To get a functional desktop I can start a terminal session within the VNC session and enter: startlxde-pi &
That instantly enables the familiar Buster desktop with a menu bar, desktop icons and Burmese temple wallpaper.
Unfortunately, that doesn't survive a reboot.
So, the question is: What do I need to do to establish a persistent lxde-pi DE that starts at boot?
====================
What follows are various configuration options and files that might be useful in helping me figure this out:
Raspberry Pi Software Configuration Tool (raspi-config)
B1 Console Text console, requiring user to login
B2 Console Autologin Text console, automatically logged in as 'pi' user
B3 Desktop Desktop GUI, requiring user to login
B4 Desktop Autologin Desktop GUI, automatically logged [selected]
There are 4 choices for the alternative x-session-manager (providing /usr/bin/x-session-manager).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/startlxde-pi 90 auto mode
1 /usr/bin/lxsession 49 manual mode
2 /usr/bin/openbox-session 40 manual mode
3 /usr/bin/startlxde 50 manual mode
4 /usr/bin/startlxde-pi 90 manual mode
$ sudo update-alternatives --config x-window-manager
There is only one alternative in link group x-window-manager (providing /usr/bin/x-window-manager): /usr/bin/openbox
Nothing to configure.
$ sudo update-alternatives --config x-terminal-emulator
There is only one alternative in link group x-terminal-emulator (providing /usr/bin/x-terminal-emulator): /usr/bin/lxterminal
Nothing to configure.
pi@raspmountain:/etc/xdg/lxsession/LXDE-pi $ cat autostart
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
There is no user autostart file
Interesting lines from .xsession-errors
dbus-update-activation-environment: setting DESKTOP_SESSION=openbox
dbus-update-activation-environment: setting XDG_SESSION_DESKTOP=openbox
dbus-update-activation-environment: setting GDMSESSION=openbox
Openbox-Message: Unable to find a valid menu file "/var/lib/openbox/debian-menu.xml"
Those same lines and more from a different but identical Pi that does have a persistent lxde-pi desktop environment:
dbus-update-activation-environment: setting DESKTOP_SESSION=lightdm-xsession
dbus-update-activation-environment: setting XDG_SESSION_DESKTOP=lightdm-xsession
dbus-update-activation-environment: setting GDMSESSION=lightdm-xsession
** Message: 14:40:24.181: main.vala:101: Session is LXDE-pi
** Message: 14:40:24.182: main.vala:102: DE is LXDE
** Message: 14:40:24.341: main.vala:133: log directory: /home/pi/.cache/lxsession/LXDE-pi
** Message: 14:40:24.341: main.vala:134: log path: /home/pi/.cache/lxsession/LXDE-pi/run.log
Let me know if there are other places I should look.
Historical Perspective
I have three Pi4s that run webcams. One is at my home in Northeast Thailand the other two are at a condo southwest of Bangkok. All are headless. All have RealVNC enabled via raspy-config. The two at the condo are behind a double NAT, so I have a remote (reverse) SSH tunnel set up from them to my desktop Mac at home. Nearly all of the work I do on these three Pi4s is via SSH. I generally have no need for a GUI.
This past December I decided that I wanted to clone the boot SD card for all three Pi4s. For the one at home I logged in via VNC and ran SD Card Copier (piclone) via the GUI. It worked fine.
Then I tried logging in via VNC to the two remote Pi4s. One worked fine and I was able to start SD Card Copier. But on the other Pi all I got via VNC was a blue desktop with no menu bar and no desktop icons. I discovered by accident that if I two-finger tapped on the desktop (a right-click) a hierarchical menu appeared. But, almost none of the software on that menu (including SD Card Copier) would actually run.
Then I set out trying to find out how to get the normal, default Buster desktop on the errant machine.
It took me many months of posting questions and inquiries and a bunch of personal research for me to finally find out that I could get the desktop by running startlxde-pi from a terminal session via VNC. This is all stuff that I know nothing about, so it has been a hard, frustrating slog.
Note that on the errant machine I eventually cloned the SD card using a command-line version of piclone, which worked just fine.
At this point (08 May 2022) I still don't understand why one of the three Pi4s is different from the other two.