From 883592d029dd954e0cd759fb055682c013a45162 Mon Sep 17 00:00:00 2001 From: Michael Chus Date: Fri, 27 Mar 2026 22:17:59 +0300 Subject: [PATCH] feat(desktop): switch to LightDM for X startup (matches Ubuntu LiveCD) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit startx from user shell has /dev/fb0 permission issues and is fragile. LightDM starts Xorg as root — standard LiveCD approach that works on server hardware / IPMI KVM with nomodeset + fbdev/vesa. - Add lightdm package, configure autologin as bee/openbox session - Add /usr/share/xsessions/openbox.desktop - Remove startx from .profile (LightDM manages X lifecycle) - Remove Xwrapper.config needs_root_rights workaround (no longer needed) - Enable lightdm.service in setup hook Co-Authored-By: Claude Sonnet 4.6 --- .../config/hooks/normal/9000-bee-setup.hook.chroot | 1 + iso/builder/config/package-lists/bee.list.chroot | 2 +- .../etc/lightdm/lightdm.conf.d/50-bee-autologin.conf | 5 +++++ iso/overlay/home/bee/.profile | 9 --------- iso/overlay/usr/share/xsessions/openbox.desktop | 6 ++++++ 5 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 iso/overlay/etc/lightdm/lightdm.conf.d/50-bee-autologin.conf create mode 100644 iso/overlay/usr/share/xsessions/openbox.desktop diff --git a/iso/builder/config/hooks/normal/9000-bee-setup.hook.chroot b/iso/builder/config/hooks/normal/9000-bee-setup.hook.chroot index 8dd07e4..594120a 100755 --- a/iso/builder/config/hooks/normal/9000-bee-setup.hook.chroot +++ b/iso/builder/config/hooks/normal/9000-bee-setup.hook.chroot @@ -29,6 +29,7 @@ systemctl enable bee-audit.service systemctl enable bee-web.service systemctl enable bee-sshsetup.service systemctl enable ssh.service +systemctl enable lightdm.service 2>/dev/null || true systemctl enable qemu-guest-agent.service 2>/dev/null || true systemctl enable serial-getty@ttyS0.service 2>/dev/null || true systemctl enable serial-getty@ttyS1.service 2>/dev/null || true diff --git a/iso/builder/config/package-lists/bee.list.chroot b/iso/builder/config/package-lists/bee.list.chroot index e68f3cc..b250402 100644 --- a/iso/builder/config/package-lists/bee.list.chroot +++ b/iso/builder/config/package-lists/bee.list.chroot @@ -52,11 +52,11 @@ qrencode openbox tint2 xorg -xinit xterm chromium xserver-xorg-video-fbdev xserver-xorg-video-vesa +lightdm # Firmware firmware-linux-free diff --git a/iso/overlay/etc/lightdm/lightdm.conf.d/50-bee-autologin.conf b/iso/overlay/etc/lightdm/lightdm.conf.d/50-bee-autologin.conf new file mode 100644 index 0000000..4d01324 --- /dev/null +++ b/iso/overlay/etc/lightdm/lightdm.conf.d/50-bee-autologin.conf @@ -0,0 +1,5 @@ +[Seat:*] +autologin-user=bee +autologin-user-timeout=0 +autologin-session=openbox +user-session=openbox diff --git a/iso/overlay/home/bee/.profile b/iso/overlay/home/bee/.profile index ede49c4..ecd1535 100644 --- a/iso/overlay/home/bee/.profile +++ b/iso/overlay/home/bee/.profile @@ -1,10 +1 @@ export PATH="/usr/local/bin:$PATH" - -# On tty1 (IPMI KVM console): start X desktop directly on VT1 -# so the KVM shows the graphical UI without switching VTs. -if [ "$(tty 2>/dev/null)" = "/dev/tty1" ] \ - && [ -z "${DISPLAY:-}" ]; then - startx /usr/local/bin/bee-openbox-session -- :0 vt1 -nolisten tcp - echo "" - echo "X session ended. Type 'startx' to retry or use the shell." -fi diff --git a/iso/overlay/usr/share/xsessions/openbox.desktop b/iso/overlay/usr/share/xsessions/openbox.desktop new file mode 100644 index 0000000..0b1c0bf --- /dev/null +++ b/iso/overlay/usr/share/xsessions/openbox.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Openbox +Comment=Bee Hardware Audit Desktop +Exec=/usr/local/bin/bee-openbox-session +TryExec=openbox +Type=Application