Jump to content

KDE Linux

From KDE Community Wiki

Warning

This page serves as a design document, thus information presented here should be considered a snapshot of the ongoing discussion, not final decisions.


"KDE Linux" (codenamed "Project Banana") is a KDE-owned general-purpose Linux®-based operating system revealed at Akademy 2024, being developed at https://invent.kde.org/kde-linux. Not to be confused with KDE neon, an older project with a similar scope.

This page has lots to talk about; please consult the table of contents on the left :)


Getting it

Download the latest .raw file and then write it to a USB flash drive using ISO Image Writer, or else run the following terminal commands:

  • Use lsblk to find the right /dev/node. e.g. /dev/sda
  • sudo dd if=kde-linux*.raw of=/dev/sda bs=4M status=progress
  • sudo sync

Then reboot into the USB flash drive.

If you see a login screen, enter nothing in the password field and click the login button (looks like an arrow)

You can start the operating system installer by double-clicking the "Install System" icon on the desktop, or single-clicking the big icon in the "Welcome Center" window that appears.


Goals

TL;DR: Create a bulletproof OS showcasing the best of KDE that we can proudly recommend to users and OEMs, with a coherent "here's how you get it" story.

Goals in detail:

  • Be "The KDE operating system"
  • User-friendly; high-quality UX
  • Doesn't break, or at least easy to recover
  • "Batteries included"; no need to manually install device drivers, optional KDE features, etc
  • Keeping security in mind
  • No packaging knowledge needed to develop for it
  • Focus on modern technologies
  • Attractive for our hardware partners
  • Any edition can be used as the main system by our developers for internal dogfooding purposes
  • Support switching between editions/release schedules at any time
  • Exercise codepaths for containerized apps and immutable base systems, to improve KDE software deployed using these technologies in other environments

Non-goals

Does not have to support the runtime installation of kernel modules. This will prevent the out-of-the-box installation of, for example:

  • Proprietary NVIDIA kernel driver (for graphics cards older than NVIDIA GTX 16xx). NVIDIA GPUs must either be new enough to use the open-source kernel modules that can be distributed in-tree, or else use Nouveau
  • VirtualBox (requires out-of-tree modules; QEMU/KVM probably do a better job anyway)
  • Vendor-specific VPNs that require custom out-of-tree kernel modules that cannot be redistributed with the kernel due to license incompatibility

Does not have to support the use case of developing low-level system components like the kernel, drivers, systemd, etc., as this can be troublesome with an immutable base OS.


Target audience and use cases

It should have multiple editions using different release schedules, suitable for different kinds of users. Ideas:

  • Testing edition: built from git master and released daily. Like KDE neon Unstable. For QA people, Plasma developers, and Patrick Silva.
  • Enthusiast edition: ships released software, and releases to users on upstream KDE's schedule, like KDE neon User. Additionally, when there are any beta releases, ships the beta. For KDE enthusiasts, power users, and influencers.
  • Stable edition: ships only released software on a delayed schedule, based on TBD quality metrics. For everyone else.


Related projects

Differences from other immutable distros

(e.g. Kinoite, Kalpa, SteamOS)

1. Distributed by KDE. This has several advantages:

  • The chain of responsibility is never gated on a third party
  • KDE and KDE e.V. can have a direct relationship with third parties using it, e.g. hardware OEMs
  • KDE can explicitly recommend it without "picking favorites" from among other distro partners

2. Relies on systemd tooling. This means it benefits from the bulk of development done on Systemd outside of KDE. So for example, updates use systemd-sysupdate rather than something like RPM-OStree.

3. No packaging knowledge required to develop it. Packages are used to build the base OS, but not produced or altered.

4. Offers multiple release schedules. This lets every user choose their personal preference with respect to newness vs stability. Should that preference change, switching to a different schedule is safe and painless.

Differences from KDE neon/Prior art

KDE neon was KDE's first version of a self-made OS. It fulfills the "distributed by KDE" requirement, but fails on the reliability angle due to the Ubuntu LTS base that ironically becomes unstable because it needs to be tinkered with to get Plasma to build on it, breaking the LTS promise. It is built on fairly old technology and requires a lot of packaging busywork — both of which are non-goals of KDE Linux.


Roadmap


Long-term maintenance and EOL plan

OS images are served from https://files.kde.org/kde-linux.

The EOL contingency plan is to push a final update shipping an OS image that transforms the system into a completely different distro, to be chosen at the appropriate point in time (i.e. which distro team we have a good relationship with that could take on all the new users when the time comes).


Governance & policies

KDE Linux follows a "Council of elders" model with major contributors being the elders, and Harald Sitter having final decision-making authority in cases of disagreement.

Specific policies adopted: - For each package added to the base image, write a comment explaining what it's for and/or why (if "what it's for" is obvious) - Try to work upstream first, rather than overriding things to be better only for KDE Linux. - In mkosi.conf.d/*.conf files, only specify the packages in the base image that you actually want. Don't bother to specify their mandatory dependencies, only optional ones (because this is an example of "you actually want them") — See https://invent.kde.org/kde-linux/kde-linux/-/issues/105


Communication


Architecture

Original architecture ideas for the project included the following:

  • Reproducible builds, must-pass CI, automated UI testing
  • Base OS is Arch-based. OS updates are some degree of rolling; snapshot based releases with relatively recent libraries
  • Systemd-boot as the bootloader with nice boot theming
  • Btrfs as the filesystem
  • Encryption of all mutable data (e.g. user homedir, and cache locations on /)
  • Included recovery partition
  • Read-only base system, like SteamOS 3, Fedora Kinoite, and openSUSE Kalpa
  • Atomic image-based A/B updates with rollback functionality
  • As many hardware drivers and support packages as possible included on base image for "batteries included"
  • Instead of legacy packages we target modern deployment systems such as flatpak and systemd-sysext
  • Apps are from Flatpak (and maybe also Snap if it's not too hard and the UX is okay), providing containerization/separation
  • Wayland by default
  • Automatic user data backup system using Btrfs snapshots, with a nice GUI around it like Apple's Time Machine
  • DConf-like configuration management UI suitable for enterprise and managed environments leveraging KConfigXT for everything
  • Simple input method configuration for CJK and more
  • "Troubleshooting hub" app

TODO: security model

systemd-sysext

systemd-sysext allows us to overlay developer content on top of /usr without impacting the base system.

Setup

# create directories
mkdir -p ~/kde/usr/lib/extension-release.d/
# create an extension-release file
cp /usr/lib/os-release ~/kde/usr/lib/extension-release.d/extension-release.kde
# make the ID ignored so updates don't break the extension
sed -i s%^ID=.*%ID=_any%g ~/kde/usr/lib/extension-release.d/extension-release.kde
# owned by root so it can't be removed
sudo chown root:root ~/kde/usr/lib/extension-release.d/extension-release.kde
# enable the extension
sudo mkdir -p /var/lib/extensions/
sudo ln -s $HOME/kde /var/lib/extensions/kde
sudo systemd-sysext merge
sudo systemd-sysext

Use

Use DESTDIR=~/kde to install stuff and then restart systemd-sysext. Beware that when changing polkit/dbus stuff you also want to restart those services as they don't necessarily pick up changes.

DESTDIR=~/kde ninja install && sudo systemctl restart systemd-sysext.service

kde-builder

It is a good idea to also modify kde-builder's cmake options a bit to get the most out of your dev setup by modifying the cmake-options in ~/.config/kde-builder.yaml

  cmake-options: >
    -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_HTML_DOCS=OFF -DBUILD_MAN_DOCS=OFF
    -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
    -DCMAKE_C_LINKER_LAUNCHER=ccache -DCMAKE_CXX_LINKER_LAUNCHER=ccache
    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON

This notably does two things:

  • Enables ccache for everything
  • Forces the use of Qt paths instead of defaults. This improves interoperability with the system Qt in case you are not kde-buildering your own. Plugin/Qml paths may diverge and as such plugins may fail to be located unless this is set. (TODO: figure out a way for kde-builder to be smarter here)

Updates

The Discover software center app can update the system. You can also update via a terminal command:

sudo updatectl update

To update from an old image from December 2024 or earlier, you need to do this:

git clone https://invent.kde.org/kde-linux/kde-linux
cd kde-linux
sudo ./update.sh update

VM

virt-manager

  • Download the latest file with extension ".raw" from https://files.kde.org/kde-linux/?C=M;O=D
  • File > New Virtual Machine > Import existing disk image
  • [Forward]
  • In "Provide the existing storage path:" > Browse, select from disk the raw file that you have downloaded. Press the "Choose Volume" button.
  • In "Choose the operating system you are installing:" write "Arch Linux".
  • [Forward]
  • In "Choose Memory and CPU settings:" set resources.
  • [Forward]
  • Enable the check box "Customize configuration before install".
  • [Finish]
  • The configuration window for the new VM is opened. In "Overview" > "Details" tab > "Firmware:" select "UEFI".
  • On the bottom left, click the button "Add Hardware".
  • Add a storage of some reasonable size. E.g. Storage > Details tab > select the radio button "Create a disk image for the virtual machine" 200 GB. Press the "Finish" button.
  • In the top left of the window, press the "Begin Installation" button. The VM will start.

If virt-manager shows "Unable to connect to libvirt qemu:///system" error, run:

sudo systemctl enable --now libvirt.service

Note: in the Debian family of Linux operating systems, the name of the service is libvirtd.

If the VM fails to boot and shows the error "No bootable option or device found.". Press Enter, this will start the UEFI user interface. Disable Secure Boot from the UEFI user interface. Device Manager > Secure Boot Configuration > Attempt Secure Boot disable the check box by pressing the Space keyboard key. F10 to save, 'y' keyboard key. Press the "Escape" keyboard key twice, select "Reset".

Install the operating system to the second virtual disk. After installing the OS is done, shut down the VM.

"VirtIO Disk 1" contains the raw file that you have downloaded.

Edit the VM configuration, right click on "VirtIO Disk 1" > Remove Hardware (decide if you want to also delete the raw file that you have downloaded), Delete.

Now, "VirtIO Disk 1" is the only virtual storage of the VM and contains the BTRFS storage where you have installed the KDE Linux operating system. Start the VM.

Local Development

In order to speed up local builds, you can create a `mkosi.local.conf` file in the root of the repository with the following content:

[Content]
Environment=LOCALE_GEN="en_US.UTF-8 UTF-8" # replace with your locale`
Environment=MIRRORS_COUNTRY=us # replace with your country code`
Environment=PARALLEL_DOWNLOADS=50 # if your internet connection is fast

You need to be using the BTRFS storage driver for docker, otherwise this won't really work.

If your host filesystem uses BTRFS (like KDE Linux), you can just add the following to /etc/docker/daemon.json

{
  "storage-driver": "btrfs"
}

official docker documentation explaining this

If you don't use BTRFS in your host machine, you can still create a BTRFS volume backed by a file like so:

systemctl stop docker.socket docker.service || true
fallocate -l 64G /store/docker.btrfs
mkfs.btrfs /store/docker.btrfs
[ -d /var/lib/docker ] || mkdir /var/lib/docker
mount /store/docker.btrfs /var/lib/docker
systemctl restart docker.socket docker.service

Then you can run:

./build_docker.sh --incremental


Resources


External resources


Linux®

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.