How to correctly enable X11 on DietPi without any DE installed?

I mean about launch single apps to GUI (i.e. “psensor”, “gedit”, etc.) via SSH.

I can do that with Debian without Desktop Environment but seem to not working on DietPi.

I tried:

  • Switch to OpenSSH
  • Checked /etc/ssh/sshd_config → X11Forwarding yes
  • Enable IPv6
  • Installing LXDE

You can install X11 without any DE, look for X.Org X Server in the list, or:

sudo dietpi-software install 6

Then SSH X11 forwarding should work.

However, as you installed LXDE as well, it did not work for you afterwards either? Did you restart the SSH server after installing LXDE?

After I installed LXDE, the X11 support was not there.

Now on a fresh install on DietPi, I ran the:

“sudo dietpi-software install 6”

I rebooted DietPi and the SSH server but the result is always:

“X11-forwarding disabled or not supported by server”.

While on many Debian 12 fresh installs without any DE, that support is active and working.

EDIT:

I forgot to switch to OpenSSH, now it seem to be working, thank you.

I recognize just now that Debian builds Dropbear without X11 forwarding enabled. I actually does support it with the respective variable set at compile time: dropbear/src/default_options.h at bd12a8611b3c838f1ed1d1c2cbaff2da1072a315 · mkj/dropbear · GitHub

Oh, has actually been discussed here already, only compile time options have been confused with runtime options :smiley:: Dropbear X11 Forwarding on Mac with Quartz

I also have to add also that after I switched to OpenSSH and installed “X.Org X Server”, the command:

sudo /etc/acpi/powerbtn-acpi-support.sh

Of the package:

acpi-support-base

Did not work anymore.

But, the most common command:

sudo shutdown

Started to work in this DietPi installation.

X11 sessions usually make use of logind, which provides ACPI functionality as well. Even possible that it conflicts with acpid you used before and hence broke that script in turn:

apt autopurge acpi-support-base
apt install dbus # should be installed already
systemctl unmask systemd-logind
systemctl start systemd-logind

shutdown is actually more used for scheduled shutdowns with a bunch of extra features, which depend on logind in some cases as well. poweroff is easier for direct shutdown.