Installing wayland on fedora 39

Okay, I tried this:

cd /home/user/qubes-wayland && meson setup build && cd build && meson compile

And this is the result:

INFO: autodetecting backend as ninja                                            
INFO: calculating backend command to run: /usr/bin/ninja
[5/14] Compiling C object qubes-compositor.p/cbits_qubes_output.c.o
FAILED: qubes-compositor.p/cbits_qubes_output.c.o 
cc -Iqubes-compositor.p -I. -I.. -I../cbits -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/vchan-xen -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O2 -g -DWLR_USE_UNSTABLE -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE=1 -Wno-unused-parameter -Wno-error=cpp -Wvla -pthread -MD -MQ qubes-compositor.p/cbits_qubes_output.c.o -MF qubes-compositor.p/cbits_qubes_output.c.o.d -o qubes-compositor.p/cbits_qubes_output.c.o -c ../cbits/qubes_output.c
In file included from ../cbits/qubes_output.c:20:
../cbits/main.h:9:10: fatal error: qubesdb-client.h: No such file or directory
    9 | #include <qubesdb-client.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
[7/14] Generating Build Rust code with a custom command
   Compiling qubes-castable v0.1.0 (/home/user/qubes-wayland/gui-rust/qubes-castable)
   Compiling vchan-sys v0.1.0 (/home/user/qubes-wayland/gui-rust/vchan-sys)
   Compiling qubes-gui v0.1.0 (/home/user/qubes-wayland/gui-rust/qubes-gui)
   Compiling vchan v0.1.0 (/home/user/qubes-wayland/gui-rust/vchan)
   Compiling qubes-gui-agent-proto v0.1.0 (/home/user/qubes-wayland/gui-rust/qubes-gui-agent-proto)
   Compiling qubes-gui-connection v0.1.0 (/home/user/qubes-wayland/gui-rust/qubes-gui-connection)
   Compiling qubes-gui-rust-parts v0.0.1 (/home/user/qubes-wayland)
    Finished `release` profile [optimized] target(s) in 1.57s
ninja: build stopped: subcommand failed.

Install qubes-db-devel package.
You can find the package that provides missing include file using dnf command e.g.:

dnf provides */qubesdb-client.h
1 Like

Now seems that all build steps are successful completed:

Directory already configured.

Just run your build command (e.g. ninja) and Meson will regenerate as necessary.
If ninja fails, run "ninja reconfigure" or "meson setup --reconfigure"
to force Meson to regenerate.

If build failures persist, run "meson setup --wipe" to rebuild from scratch
using the same options as passed when configuring the build.
To change option values, run "meson configure" instead.
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja
[8/8] Linking target qubes-compositor

DemiMarie writes:

Running `qubes-compositor --help` will provide detailed usage information; please report a bug if it is not sufficient.

But the command “qubes-compositor” or “sudo qubes-compositor” is unknown (fedora 38 template). Which package provides this command? No match with “dnf provides */qubes-compositor”.

qubes-compositor should be built by the commands that you’ve run. You can search for it in the directory where you’ve built it:

find /home/user/qubes-wayland -name "qubes-compositor"

Maybe you need to install the compiled binaries in your OS by running this command from the qubes-wayland directory:

sudo meson install
1 Like

sudo meson install in /home/user/qubes-wayland/build did it. Now command “qubes-compositor --help” works:

Usage: qubes-compositor [options]

Options:

 -v, --log-level [silent|error|info|debug]:
   Set log level. Default is "debug" if the qube has debugging
   enabled, otherwise "error".
 -p, --primary-selection boolean-option:
   Enable or disable the primary selection. The default is
   disabled, as it is easy to accidentally paste data from the
   primary selection (which might not be trusted) into a
   terminal.
 -n, --sigint-handler boolean-option:
   Enable or disable the SIGINT handler. The handler allows the
   compositor to shut down cleanly when SIGINT is received. This
   is usually what one wants, but it conflicts with the use of
   SIGINT by GDB.
 -x, --xwayland boolean-option:
   Enable or disable Xwayland support. Xwayland allows legacy X11
   programs to run under Wayland compositors such as this one.
   The default is enabled.
 -g, --gui-domain-id [Xen domid]:
   Specifiy the Xen domain ID of the GUI daemon. The default is
   to read the domain ID from QubesDB, which is nearly always
   what you want. This option is only useful for GUI domain
   testing.
 -s, --startup-cmd shell-command [shell command]:
   Run the argument to this option as a shell command after
   startup.
 --keymap-errors [exit|continue]:
   Specify what to do if the keyboard layout changes and the new
   layout cannot be switched to. "exit" means to exit with status
   78. "continue" means to continue using the old layout.
   "continue" is the default.

For boolean option arguments, "yes", "1", "enabled", and "true"
are considered true, "no", "0", "disabled", and "false" are
considered false, and anything else is an error.

Which is the command that enables wayland for the AppVM from the dispvm console?

You need to disable standard GUI agent by running this command in the console of the template where you’ve installed qubes-wayland:
sudo systemctl disable qubes-gui-agent.service
I think the qubes-compositor systemd unit should be installed in the template after running sudo meson install so it should work by default after qube start.

For a test I guess you can stop the standard GUI agent service in the console of the AppVM where you’ve installed qubes-wayland:
sudo systemctl stop qubes-gui-agent.service
And then start the qubes-compositor by running the installed systemd service e.g.:
sudo systemctl start qubes-gui-agent-wayland.service
But I don’t know how the installed systemd service is named so you need to figure that out.
Try looking at the list of the available services:

sudo systemctl daemon-reload
sudo systemctl list-unit-files | grep wayland
sudo systemctl list-unit-files | grep compositor
sudo systemctl list-unit-files | grep qubes
1 Like

Thank you very much. It is qubes-gui-agent-wayland.service. If I try to enable the wayland service from the dispVM console, I get the answer: “User not known to the underlying authentication module.” What is wrong?

What’s the output of these commands?

 sudo systemctl status qubes-gui-agent-wayland.service | cat
 sudo systemctl cat qubes-gui-agent-wayland.service

I tried via dom0 “qvm-run (APPVM name) ‘sudo systemctl start qubes-gui-agent-wayland.service’”, but it failed with error code 1. I restarted the AppVM. The output of your commands:

sudo systemctl status qubes-gui-agent-wayland.service | cat
○ qubes-gui-agent-wayland.service - Qubes OS Wayland Compositor
     Loaded: loaded (/usr/local/lib/systemd/system/qubes-gui-agent-wayland.service; disabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead)
[user@user ~]$  sudo systemctl cat qubes-gui-agent-wayland.service
# /usr/local/lib/systemd/system/qubes-gui-agent-wayland.service
[Unit]
Description=Qubes OS Wayland Compositor
Conflicts=qubes-gui-agent.service

[Service]
UMask=0077
Type=exec
ExecStartPre=/bin/sh -c 'echo 1000 > /sys/module/grant_table/parameters/free_pe>
ExecStart=/usr/local/bin/qubes-gui-runuser '' /bin/sh sh -c 'exec "$@"' sh /usr>

[Install]
WantedBy=default.targetgui-agent

# /usr/lib/systemd/system/service.d/10-timeout-abort.conf
# This file is part of the systemd package.
# See https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer.
#
# To facilitate debugging when a service fails to stop cleanly,
# TimeoutStopFailureMode=abort is set to "crash" services that fail to stop in
# the time allotted. This will cause the service to be terminated with SIGABRT
# and a coredump to be generated.
#

Try to start the commands in ExecStartPre and ExecStart from the systemd file manually in the console.

I dont understand these instructions. Could you give me a more detailed description? Where is the systemd file? And what means

?

These commands from:

 sudo systemctl cat qubes-gui-agent-wayland.service

There are several problems with the commands:

  1. A closing quotation mark is missing somewhere.
  2. bash: -c: command not found…
  3. bash: echo 1000 > /sys/module/grant_table/parameters/free_pe>: No such file or directory

The commands were truncated when you copied them.
Run this command in console:

 sudo systemctl cat qubes-gui-agent-wayland.service

Or:

cat /usr/local/lib/systemd/system/qubes-gui-agent-wayland.service

And copy the commands from there.

Okay, no error anymore for the second command, but the first command gives:

bash: -c: command not found...

Did you copy the full command starting with /bin/sh -c 'echo 1000 ...?

This works (you have to be sudo):

sudo /bin/sh -c 'echo 1000 > /sys/module/grant_table/parameters/free_per_iteration'

This had not worked:

ExecStartPre=/bin/sh -c 'echo 1000 > /sys/module/grant_table/parameters/free_per_iteration'

But the second command failes:

sudo /usr/local/bin/qubes-gui-runuser '' /bin/sh sh -c 'exec "$@"' sh /usr/local/bin/qubes-compositor -s /usr/local/bin/qubes-wayland-session

sudo: /usr/local/bin/qubes-gui-runuser: command not found

Would be “/usr/bin/qubes-gui-runuser” the correct path?