Skip to content

Commit 35bd976

Browse files
Johanclaude
andcommitted
fix: disable kdeconnect autostart + document taskbar limitation
Bootstrap now creates the kdeconnect.daemon.desktop override with Hidden=true so new KDE VNC containers don't get Bluetooth/network discovery spam from kdeconnectd in the journal. README documents the known task manager limitation: minimized windows disappear from taskbar because kwin_wayland does not expose org_kde_plasma_window_management in nested mode. Alt+Tab workaround documented. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9d0964a commit 35bd976

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ SDDM and plasmalogin both require `/dev/tty1` which does not exist in nspawn con
8383

8484
**Keyboard layout** is selected at bootstrap time (Swedish, English/US, Spanish, or German). The layout is applied to both labwc (outer compositor, where wayvnc receives raw VNC key input) and kwin (inner KDE session). KDE Plasma 6's default decoration shows only a close button — the bootstrap overrides this via a system-wide dconf rule so that minimize, maximize, and close all appear.
8585

86+
**Known limitation — task manager:** The taskbar shows open windows but does not track minimized windows. This is a Wayland protocol limitation: KDE's task manager (`libtaskmanager`) requires `org_kde_plasma_window_management`, a KDE-specific protocol that kwin_wayland does not expose to clients when running as a nested compositor inside labwc. There is no fallback in KDE 6.6 — neither `zwlr_foreign_toplevel_manager_v1` nor `ext_foreign_toplevel_list_v1` is used by the task manager. In practice: **use Alt+Tab** to switch between windows and restore minimized ones. Alt+Tab is handled entirely inside kwin and works correctly.
87+
8688
The initial lead that pointed toward the wlroots-compositor approach came from a [community gist on headless KDE Plasma under Wayland](https://gist.github.com/GithubUser5462/9cad267d7a87d1f178c89271c2c00e46), which in turn traced back to a [discussion on the KDE forums](https://discuss.kde.org/t/headless-remote-access-under-wayland/19055). The nested kwin architecture was worked out through direct experimentation in a Fedora 44 container.
8789

8890
## cockpit-nspawn is tested on

src/CreateMachineDialog.jsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,11 +703,17 @@ export function CreateMachineDialog({ images, onClose, onRefresh, onAddNotificat
703703
);
704704
// kwinrc: set SSD button layout (I=minimize, A=maximize, X=close on right)
705705
// This affects kwin's own decorations and is read by xdg-desktop-portal-kde.
706+
// Desktops.Number=1: enforce a single virtual desktop so the task manager
707+
// never loses minimized windows to a different virtual desktop.
706708
const kwinrcContent = [
707709
'[org.kde.kdecoration2]',
708710
'ButtonsOnLeft=',
709711
'ButtonsOnRight=IAX',
710712
'',
713+
'[Desktops]',
714+
'Number=1',
715+
'Rows=1',
716+
'',
711717
].join('\n');
712718
await cockpit.file(
713719
`/var/lib/machines/${name}/home/kdeuser/.config/kwinrc`,
@@ -900,6 +906,32 @@ export function CreateMachineDialog({ images, onClose, onRefresh, onAddNotificat
900906
append(`Varning: dconf update misslyckades (${dconfErr.message}).\n`);
901907
}
902908

909+
// Disable kdeconnect autostart: kdeconnectd tries to use Bluetooth and
910+
// broadcasts network discovery, which generates harmless but noisy errors
911+
// in the journal inside a container (no Bluetooth hardware available).
912+
await cockpit.spawn(
913+
['mkdir', '-p', `/var/lib/machines/${name}/home/kdeuser/.config/autostart`],
914+
{ superuser: 'require', err: 'out' }
915+
);
916+
await cockpit.file(
917+
`/var/lib/machines/${name}/home/kdeuser/.config/autostart/org.kde.kdeconnect.daemon.desktop`,
918+
{ superuser: 'require' }
919+
).replace('[Desktop Entry]\nHidden=true\n');
920+
921+
// Mask fwupd: firmware update daemon cannot function in a container
922+
// (no hardware devices, no kernel firmware interfaces). Without masking,
923+
// fwupd.service fails to start and KDE Discover shows "unit failed" in
924+
// its Updates section when it tries to poll the fwupd D-Bus backend.
925+
try {
926+
await cockpit.spawn(
927+
['systemd-run', `--machine=${name}`, '--wait', '--pipe', '--',
928+
'systemctl', 'mask', 'fwupd', 'fwupd-refresh.timer'],
929+
{ superuser: 'require', err: 'out' }
930+
).stream(append);
931+
} catch (fwupdErr) {
932+
append(`Notera: fwupd-mask misslyckades (${fwupdErr.message}).\n`);
933+
}
934+
903935
append(`\nKDE Plasma VNC-server kör på port 5900.\n`);
904936
append(`Anslut med VNC-klient (t.ex. Remmina) till port 5900 — inget lösenord.\n`);
905937
} else {

0 commit comments

Comments
 (0)