Trying to run KDE 6 Plasma with Wayland....

It was bad enough getting Xorg to work reliably under FreeBSD back in the day - connecting with the GPU API, making sure a constellation of settings is correct and stable - but that effort paid off, and now using Xorg underneath most DE's is as simple as installing it. I kind of expect that Wayland/KDE interaction will reach that level of stability.

I still remember when XDG_USER_DIR environment variable was a major pain to set because it would not stick, and that's from a few years ago. Only recently, thanks to this thread, I see that this pain point got addressed.

And if that's the rate at which things make progress towards KDE/kwin6 on Wayland... our best bet is to keep our eyes peeled for somebody to get fed up with that and do some coding themselves. It is Open Source, after all.

I'm still complaining about the very upgradability of KDE - I want to be able to upgrade it while leaving the rest of the system alone - just to ameliorate the impacts of dependency hell and have less breakage when I want to upgrade KDE.
 
One update that I think people watching this thread will find interesting:

From within a Wayfire Wayland session, using Konsole and command dbus-run-session startplasma-wayland (gleaned from https://community.kde.org/KWin/Wayland ), I was able to start a KDE Wayland session, albeit in its own window under Wayfire (wayfire_with_kde_wayland_window.png). Same command fails under TTY.

By playing with ENV variables, I was able to figure out that setting WAYLAND_DISPLAY is something that kwin6 does need, but Wayfire will crap out and not start.

I think that more playing with ENV variables is still needed, in an organized fashion. I discovered that they do look different depending on whether they are run from a TTY or a graphical DE. To this end, I'm gonna share the ENV variables captured on TTY, Wayfire, and in the KDE Wayland session that I did manage to start as shown in the screenshot.

Maybe someone can hit on just the right combinations of those ENV variables and post it to this thread sometime. BTW, env_tty.txt shows that yeah, you need to set KWIN_DRM_DEVICES=/dev/dri/card0 to stop complaints that /dev/dri/card0 is not able to be opened.
 

Attachments

  • wayfire_with_kde_wayland_window.png
    wayfire_with_kde_wayland_window.png
    188.1 KB · Views: 62
  • env_graphical.txt
    env_graphical.txt
    796 bytes · Views: 43
  • env_kde_wayland.txt
    env_kde_wayland.txt
    1.7 KB · Views: 41
  • env_tty.txt
    env_tty.txt
    326 bytes · Views: 43
hi mate

i have created a Freebsd 14.1 thick jail to install KDE 6 Wayland in

nvidia and cuda are set up
wayland is set up and i can open qt wayland applications

im just about to install the packages for kde

did you install kde6-devel

Code:
sudo pkg install kde6-devel

and what other kde packages did you install

could you export your prime list
and attach it so i can see what packages you have installed

Code:
pkg prime-list > pkg-prime-list.txt

the env variables are helpful to figure out what the issue is

nvidia and cuda in the Freebsd 14.1 thick jail

Code:
classic% nv-sglrun nvidia-smi
shim init
Sat Aug 31 20:05:35 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.54.14              Driver Version: 550.54.14      CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce GTX 1650        Off |   00000000:01:00.0 Off |                  N/A |
| N/A   48C    P8              1W /   50W |       0MiB /   4096MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

opening qt5ct as a wayland application in the Freebsd thick jail
and displaying the window on the freebsd host running wayland

20240831_20h14m06s_grim.png
 
KDE 6 Wayland running in a Freebsd 14.1 thick jail

thats right a full wayland desktop started in a jail with the window displayed on host

i know it says Linux in the screenshot ( dont know why that is )
but if you look at Kernel Version you will see its 14.1-RELEASE-p3

started with

Code:
exec dbus-launch --exit-with-session ck-launch-session startplasma-wayland

and a few other settings and tweaks

like mounting the XDG_RUNTIME_DIR from the host to the jail so the the jail can access the wayland socket
and exporting the dbus address from the host to the jail

nvidia and cuda are set up in the jail

havent looked how to route the audio from the jail to the host using pipewire
which i think kde uses, i know how to do it with pulseaudio

so maybe able to get that working

set up

Dell XPS 15 2019
NVIDIA GeForce GTX 1650

Freebsd 14.1 p3
running the dwl wayland tiling window manager and wlroots

i did notice a few glitches like dolphin not starting
which maybe because im runnning kde 6 in a jail

i do have some devfs rules on the host for the jail to allow access to various bits and bobs

i just need to push my notes to github
then i post the link to all the steps


20240831_21h08m49s_grim.png



20240831_22h33m48s_grim.png
 
audio devices showing up

pulseaudio started on the host

Code:
pulseaudio --start --daemonize 2>/dev/null

using a pulseaudio socket that is mounted in the jail

but getting an error testing the audio
using the settings app


20240831_22h44m22s_grim.png



pactl info


20240831_22h45m07s_grim.png



however i just the audio using beep on the command line in the jail
and the audio came out on the freebsd hosts default audio device
 
Firefox playing Rick Astley on Youtube in a pop up window in HD
on KDE 6 Wayland in a Freebsd 14.1 thick jail with the KDE Desktop window displayed on the Freebsd host running dwl

with firefox using pulseaudio
which is the default

and the audio routed from the jail to the host as well using pulseaudio

all together now

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you


20240831_23h00m40s_grim.png
 
installing dolphin ( the kde file manager ) stops kde from starting

running kde6-devel, which doesnt install dolphin

i had to uninstall dolphin and reinstall the following packages

Code:
sudo pkg install kde6-devel konsole pipewire wireplumber

also shutdown doesnt work
gives an error about kde 5
 
1725167668629.png

Yeah this is on a VM from within a host that's running another Wayland compositor on bare metal.

I'm trying to figure out how to start it from a TTY, bare metal, text-only. And I'm getting the impression that if somebody hits on the right combination of ENV variables that DBUS and kwin6 want, that could be solved.

It seems like KDE Wayland is possible, it can even see the GPU hardware fine, but ENV is still the finicky part that eludes us because we don't have a good handle on exactly how KDE starts up and what ENV variables it's looking for.
 
Yeah this is on a VM from within a host that's running another Wayland compositor on bare metal.

its not a vm its a jail

thats just a new message you get on wayland windows
that looks like the sort of message you get in a vm window
 
heres a recap of the steps

nvidia packages

Code:
pkg install nvidia-driver nvidia-settings nvidia-drm-515-kmod libva-intel-driver libva-utils gpu-firmware-intel-kmod-kabylake

kld_list

Code:
sysrc kld_list+="i915kms nvidia-modeset nvidia-drm linux linux64"

cuda

Code:
sudo pkg install linux-nvidia-libs libvdpau-va-gl libva-nvidia-driver libc6-shim

wayland

Code:
pkg install wayland wayland-protocols seatd qt5ct qt5-wayland

seatd

Code:
sudo sysrc seatd_enable=YES

dbus

Code:
sysrc dbus_enable=YES

consolekit

Code:
pkg install consolekit2 basu

zsh

Code:
sudo pkg install zsh zsh-completions zsh-syntax-highlighting

~/.zshrc

Code:
# ~/.zshrc

# add your zshrc code below

~/.zshenv

Code:
# ~/.zshenv

# Path
typeset -U PATH path
path=("$path[@]")
export PATH

# xdg directories
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_RUNTIME_DIR=/var/run/xdg/"${USER}"

# qt5
export QT_QPA_PLATFORMTHEME=qt5ct

# wayland - uncomment to use wayland
export WAYLAND_DISPLAY=wayland-0
export QT_QPA_PLATFORM=wayland
export GDK_BACKEND=wayland

# consolekit      
export LIBSEAT_BACKEND=consolekit2

chsh

Code:
chsh -s /usr/local/bin/zsh

kde packages

Code:
sudo pkg install kde6-devel konsole pipewire wireplumber

start kde

Code:
exec dbus-launch --exit-with-session ck-launch-session startplasma-wayland
 
Last edited:
im using these devfs.rules on the freebsd host for the jail

which allows access to the audio devices and nvidia card

Code:
[jails=7]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path 'mixer*' unhide
add path 'dsp*' unhide
add path 'dri*' unhide
add path 'drm*' unhide
add path 'nvidia*' unhide
add path 'speaker*' unhide

i dont export any special settings for the nvidia card in my ~/.zshenv
 
with a vm typically you would use a vnc client to display the desktop window
and you dont get great performance over a vnc connection trying to play a 1080p video using a browser in the vm

what im doing is mounting the XDG_RUNTIME_DIR directory from the host to the jail
which contains the wayland socket and exporting the wayland display in the jails shell config

so the KDE desktop window is rendered by the wayland compositor on the host
just as though its running as a native application

so there is no cursor delay or lag that you would likely get over a vnc connection
thats important for applications that require instant feedback like video editors or games

i havent seen anyone using the mounting the XDG_RUNTIME_DIR in a byhve vm
but that might be an interesting experiment instead of using vnc

i use devfs rules to allow access to the audio and nvidia card

and mount the XDG_RUNTIME_DIR to allow access to the wayland socket,
and export the dbus address from the host to the jail

im also running the exact same version of Freebsd in the jail as on the host
and have the nvidia drivers working with cuda

its not running on bare metal
but its a pretty good test

my report on kde

2 problems that i mentioned before

1 - installing Dolphin stops KDE from starting
2 - shutdown doesnt work

there is no shutdown button in the menu
only a log out button

and running shutdown in the terminal
tries to run a kde 5 application to shutdown the system

i didnt have to add any fixes KDE for my nvidia card

so is KDE 6 usable as a daily driver in its current state

No
having no file manager and the shutdown bug are dealbreakers

if installing dolphin stops kde from running
then i wouldnt be surprised if installing other kde packages also breaks kde
 
For all intents and purposes, a jail IS a virtual machine...
Let's just agree to call a jail a jail and everything else running on bhyve or VMware and the likes a VM?*

There's already more than enough dual-purpose ambiguous terminology around for us to get confused.

___
* Even though all are virtualization mechanisms.
 
Dolphin doesn't work, but PCManFM (x11-fm/pcmanfm) from the LXQT project works fine as a replacement - it's built against the same QT version as Dolphin, FWIW.

One paper cut is the clock widget in the taskbar - in KDE proper, it's not displaying, no matter what I try.
 
i think its possible to install KDE 6 on Freebsd 14.1 on bare metal

but its probably not worth it at the moment
due to the bugs i mentioned

if shutdown and the file manager dont work
then i would think other things like desktop widgets would probably have issues as well
 
Dolphin doesn't work, but PCManFM from the LXQT project works fine as a replacemen
i was going to suggest something like PCManFm
but i guess you might lose some of the intergration with KDE that you would get with Dolphin
 
Back
Top