Skip to content

Set up a Linux desktop on Fedora, Arch and openSUSE too (851-4493) - #1497

Merged
pondorasti merged 1 commit into
mainfrom
alexandru/851-4493-linux-desktop-step-3-codevisor-desktop
Nov 27, 2026
Merged

pondorasti merged 1 commit into
mainfrom
alexandru/851-4493-linux-desktop-step-3-codevisor-desktop

Conversation

@pondorasti

@pondorasti pondorasti commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Fixes 851-4493. Part of 851-4479 (Linux desktops), step 3 of the design.

codevisor desktop setup now installs what is missing with dnf, pacman and zypper, next to apt. No app UI changes.

What changes

  • Three more package managers. The command and the server build the root commands from the same table (apps/server/src/desktop/package-managers.ts), from the machine's own /etc/os-release and the programs it finds. Nothing in the server's answer chooses a command; the status's packageManager now names the real one and is only shown, never run.
  • Already installed. When every program is there, there is no root step and nothing probes or asks for sudo (unchanged behaviour, now tested on every system, and run for real with the account's sudo rights taken away).
  • No known package manager. One message that names the programs to install, exit code 1, before anything is changed. Before, the question about an older root desktop came first, so that desktop could be removed and setup still stop. The same message, with its own reason, where the system's package manager is missing or the system's files are read-only (Fedora Atomic, MicroOS, SteamOS; told by /proc/mounts, not tested on such a machine).
  • Carry-over from Set up, check and remove a Linux desktop with codevisor desktop (851-4485) #1492. A process-mode desktop of this server that is alive and shared is reported as running also when the account's desktop unit belongs to another server, with its own log and "doesn't start at boot" instead of the other server's unit's. Setup says "already running" for it, and status says it won't come back by itself once it stops (the server doesn't start a desktop beside another server's unit). When it is alive but not shared, status keeps its own reason, and setup refuses with that reason and says to remove this desktop; nothing is restarted, because both desktops would use the same socket path.

Packages per system

Debian, Ubuntu (apt) Fedora (dnf) Arch (pacman) openSUSE (zypper)
Xvnc (TigerVNC) tigervnc-standalone-server tigervnc-common tigervnc-server-minimal tigervnc xorg-x11-Xvnc
Xfce (startxfce4, xfconf-query) xfce4 xfce4-terminal xfce4-session xfwm4 xfce4-panel xfdesktop xfce4-settings xfce4-terminal xfconf the same seven the same seven, plus xfce4-panel-branding-upstream
dbus-run-session dbus-x11 dbus-daemon dbus dbus-1 dbus-1-daemon
xclip xclip xclip xclip xclip
python3 python3 python3 python python3
Fonts, icons fonts-dejavu-core adwaita-icon-theme dejavu-sans-fonts adwaita-icon-theme ttf-dejavu adwaita-icon-theme dejavu-fonts adwaita-icon-theme
Without extras --no-install-recommends install_weak_deps=False --needed --no-recommends
Size on disk, fresh image about 640 MB about 450 MB about 980 MB about 740 MB
Waiting for the lock (10 min) update retried on the lists lock; DPkg::Lock::Timeout dnf waits for another dnf itself; retried while /var/log/dnf5.log names the rpm lock retried while db.lck exists and a pacman runs ZYPP_LOCK_TIMEOUT

All of them are in the default repositories of the five test systems; none needed an extra repository.

Choices I made

  • dnf on Fedora and on systems that use Fedora's repositories (ID or ID_LIKE names fedora: Fedora Asahi Remix, Ultramarine and the like; unit tests from os-release samples, not run on one). Left out: anything that also names rhel or centos, plus Oracle Linux (ol) and Amazon Linux (amzn), which name only fedora but have no Xfce in their own repositories. SUSE Linux Enterprise is left out the same way for zypper. They get the "install these yourself" message.
  • Fedora 41 or newer. The rpm-lock retry reads dnf 5's log. dnf waits for another dnf by itself, but fails at once when something else (rpm, PackageKit) holds the rpm lock, and says why only in that log.
  • Arch: no pacman -Sy <package> (a partial upgrade). Setup installs from the lists the machine has and downloads them only when there are none. Old lists make pacman fail with "not found", and setup adds the hint to run pacman -Syu first. A lock file nobody holds stops setup at once with the hint to remove it, instead of a ten-minute wait.
  • openSUSE: the stock Xfce panel. The openSUSE panel setup names three plugins (sound, power, notifications) that an install without recommended packages doesn't bring, and Xfce opens an error box for each. Setup installs xfce4-panel-branding-upstream, unless the openSUSE one is already on the machine. dbus-run-session moved from dbus-1 (Leap 15) to dbus-1-daemon, so both are named and zypper skips the unknown one. zypper's "installed, but" exit codes 102, 103 and 107 count as installed. 106 (a repository was skipped) counts as installed only when all six programs are there afterwards; otherwise the step fails with zypper's output and a last line that names the reason. I chose this over dropping 106 because one unreachable extra repository would otherwise fail an install that worked. Checked in a container with a broken repository: all six programs present gives success, otherwise exit 106.
  • No PolicyKit agent in the desktop. Fedora's Xfce session starts xfce-polkit, which opens an error box in a desktop that is no login session. The runner hides that one autostart entry through a folder of its own at the front of XDG_CONFIG_DIRS (next to the socket, made fresh at every start, removed when the desktop stops). The account's own config is not touched.

Found by the container run: the desktop was refused on Ubuntu without systemd

The design left one question for this step: the private-socket check refuses a folder a group can write to. On Ubuntu 24.04 an account's umask is 002, so ~/.codevisor is mode 775. When the server has no runtime folder in its environment (a container, or a system unit with User=), the socket is in ~/.codevisor/run, and the desktop started but was refused as "reachable by other accounts".

The check stays strict. Instead the server closes its own folders before it starts the desktop: run becomes mode 700 and ~/.codevisor loses group and other write access. Folders that aren't Codevisor's are left alone and still refused, with the folder named. A socket under /run/user/<uid> was never affected, which is why step 2's systemd VM run passed.

Proof

Unit tests (175 in the desktop suites) cover each package manager's commands on the server and in the command, the systems that are left out, the no-root-step path on every system, the unknown-system message with an older root desktop present, the carried-over status case, and the folder closing. The status test and the unknown-system test were run without their fix and fail.

Container run, one container at a time, on the build that is pushed here (run again after the review fixes), the server's account codevisor without systemd. Every step passed on every system:

Step Debian 12 Ubuntu 24.04 Fedora 45 Arch (arm64) openSUSE Tumbleweed
Status before: "No desktop on this machine" exit 0 exit 0 exit 0 exit 0 exit 0
Setup without sudo rights: prints its own commands exit 1 exit 1 exit 1 exit 1 exit 1
Fresh setup (server installs with sudo -n) exit 0, 47 s exit 0, 52 s exit 0, 41 s exit 0, 53 s exit 0, 69 s
Status: running; packageManager apt apt dnf pacman zypper
TigerVNC 1.12.0 1.13.1 1.16.2 1.16.2 1.16.1
Listening TCP ports (the server's only) 49361 49361 49361 49361 49361
Relay's first bytes RFB 003.008 RFB 003.008 RFB 003.008 RFB 003.008 RFB 003.008
Second setup: "already running" exit 0 exit 0 exit 0 exit 0 exit 0
Remove; desktop processes left 0 0 0 0 0
Setup with xclip removed and the lock held 40 s exit 0, 53 s exit 0, 74 s exit 0, 55 s (3 refusals in dnf's log) exit 0, 55 s exit 0, 59 s
Setup with sudo rights taken away, nothing missing exit 0, no sudo in the server log the same the same the same the same
Last remove; processes left, config gone 0 0 0 0 0

Also on Arch: a lock file nobody holds stops setup in 4 s with pacman's message and the hint. The openSUSE list was also installed on Leap 15.6 (TigerVNC 1.13.1, all six programs found) and dry-run on Leap 16.0. A picture of each desktop was taken with test-only tools after setup; all five show the panel, icons and fonts, and no error box.

About the test machines: Arch's official image is amd64 only, so Arch ran on the arm64 image menci/archlinuxarm (Arch Linux ARM, ID=archarm, ID_LIKE=arch), with pacman's own download sandbox switched off in the container's pacman.conf because Docker refuses Landlock. That is a property of the container; setup's commands don't touch it.

After your review at 5bb0312

  • Status in the two-servers case, and the not-shared case keeping its own reason (above).
  • zypper's 106 (above).
  • Fedora derivatives on Fedora's repositories (above).
  • A root step that runs out of time is now stopped whole: the server runs it under timeout --kill-after=30 1200, as root, which signals the step's whole process group. The server's account can't signal root's processes itself, so the runner's way (stop the group from the parent) doesn't work under sudo. Checked in a container: with the limit nothing of the step is left; the old way left the package manager's stand-in running.

Code review

Two passes of the code-review skill (medium): on the branch before pushing, and on this PR.

Fixed from the first: a left-behind pacman lock meant a ten-minute wait; zypper's "installed, but" exit codes were read as failure; the autostart folder was left behind after remove; the unknown-system message contradicted itself on Fedora without dnf.

Fixed from the second: my first fix for the carried-over case restarted this server's process desktop beside another server's unit, which could remove that server's live socket (now refused, as before, and status says the same); status took "starts at boot" and the log hint from the other server's unit; the autostart folder could be one another account had made, where a hand-made config puts the socket in a shared folder (now made fresh and skipped otherwise); image-based systems got a failing install instead of the message; a folder that can't be made private threw a raw error (now left to the socket check, which names the folder); a table field nothing read.

Left, with the reason:

  • pacman's retry decides from the lock file after pacman failed, so a lock released in that instant reads as "lists are old". The window is a few milliseconds and the result is one more run of setup; deciding from pacman's output would hide its live output in the terminal. The same hint also follows a failed download of the lists on a fresh image; it starts with "If packages were not found", and pacman's own error is right above it.
  • XDG_CONFIG_DIRS is now always set for the session. With none inherited it is <own folder>:/etc/xdg, which is what startxfce4 sets by itself, so the session sees the same folders as before plus ours. The five pictures show each system's defaults.
  • The dnf retry reads only dnf 5's log (Fedora 40 and older, with dnf 4, are out of support), and gives up if that log is rotated during the one attempt.
  • Not new here: a process-mode desktop kept beside another server's unit doesn't come back by itself after a reboot; status then names the other server.

Not in this PR

  • codevisor desktop remove --remove-packages: the design put it in this step, the step's scope didn't include it. remove still leaves the packages installed and says so.
  • The Mac-app check from step 2 (the Desktop card appearing right after setup) stays for step 4.
  • Not checked on real machines: a Fedora or openSUSE machine with systemd and a real login. The systemd path is the same code step 2 ran on an Ubuntu VM.

🤖 Generated with Claude Code

@pondorasti
pondorasti force-pushed the alexandru/851-4493-linux-desktop-step-3-codevisor-desktop branch from fe1f3cf to 5bb0312 Compare November 27, 2026 00:16
codevisor desktop setup installs what is missing with dnf, pacman and
zypper next to apt, waits on each package manager's lock, says once what
to install where it knows no package manager, and the server closes its
own folders above the desktop's socket to other accounts.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@pondorasti
pondorasti force-pushed the alexandru/851-4493-linux-desktop-step-3-codevisor-desktop branch from 5bb0312 to e59200b Compare November 27, 2026 00:36
@pondorasti
pondorasti merged commit d2a01af into main Nov 27, 2026
@pondorasti
pondorasti deleted the alexandru/851-4493-linux-desktop-step-3-codevisor-desktop branch November 27, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant