Wayland instructions confusion

Hello

I'm trying to replace my MATE desktop with something more interesting, thought I'd give Hyprland a go. For background, I've just run a freebsd-update so I should be fresh as a daisy.

I'm following the instructions for installing Wayland as per the FreeBSD handbook: https://docs.freebsd.org/en/books/handbook/wayland/

I'm finding it not so straight-forward.

I have installed the packages specified in the guide and created the environment variables and these all check out. seatd is enabled in the rc.conf and is running upon boot, and I have created the configuration file as per the guide assuming that the ~/.config directory is created in the directory for my user, and not root(?)

When I run in a tty (with X server running on ttyv8) as my user:-

Code:
wayfire -c ~/.config/wayfire/wayfire.ini

(the guide isn't clear whether this is run as root or not, or whether it should be executed in a tty, or an X terminal, or whether the X server login manager should be disabled and then run)

I get
Code:
 [src/main.cpp:76] unable to drop root (we shouldn't be able to restore it after setuid) refusing to start

Under what context should the above command be executed? Should the X server be disabled? Should it run in a Terminal on GNOME? As root or user?

Additionally, I've tried installing Xwayland using pkg, but this forces wayfire and hyprland to be uninstalled, which contradicts to what the handbook implies, so I'm left a little bit confused here.

Any assistance or direction, greatly appreciated. Thank you
 

Attachments

  • wayfire_error.txt
    6 KB · Views: 57
That wayfire test ini can be run from a terminal emulator within an x session.

Also the wcm can run in an x session or Wayland.

Another helpful bit, sddm and lightdm will list your Wayland sessions but for some reason gdm doesn't want to. Just sysrc sddm_enable="YES" or lightdm_enable="YES" to start one of those on system boot. But you'll need to install them first obviously.

Edit: I'm actually new to FreeBSD so please consult the handbook for setting up session managers. I don't want to give inaccurate advise.
 
That wayfire test ini can be run from a terminal emulator within an x session.

Also the wcm can run in an x session or Wayland.

Another helpful bit, sddm and lightdm will list your Wayland sessions but for some reason gdm doesn't want to. Just sysrc sddm_enable="YES" or lightdm_enable="YES" to start one of those on system boot. But you'll need to install them first obviously.

Edit: I'm actually new to FreeBSD so please consult the handbook for setting up session managers. I don't want to give inaccurate advise.

In that case, the error about dropping root still applies.

I use lightdm, it does indeed have an option for wayfire, but that just kills the X session. seatd then reports a message about no clients, or something.

Code:
New client connected (pid: whatever)
Added client 9 to seat0
Could not set VT mode to enable process switching: Operation not permitted
Opened client 9 on seat0
Could not make device fd drm master: Device busy
Could not revoke drm master on device fd : Invalid argument
No clients on seat0 to activate
Could not set VT mode to enable process switching: Operation not permitted
Closed client 9 on seat0
Removed client 9 from seat0
Client disconnected

Says the above twice, dumped into the "login" bit of ttyv0


I've been using FreeBSD for years, on and off. The addition of pkg is transformative for impatient folks like me. Usually I use a FreeBSD/Linux installation until browsers force me to do an upgrade, and then inevitably the process doing the upgrade uninstalls itself and you're left with a dead system. Never gets old =D
 
I actually tried Wayfire a while back, after following the Handbook instructions... that was about 9 months ago. It worked OK, but actually starting it was unreliable, the /var/run/user/1001/ directory (which is apparently required by Wayland) was sometimes there, sometimes not, and sometimes, it had wrong permissions (and correct ones wouldn't stick), and XDG_RUNTIME_DIR env var was a pain to set on boot - you'd think that this last bit was not problematic on FreeBSD, but it has been for this rodeo...

I'm hoping that since then, Wayland has improved...
 
Always run wayland WM from tty as user, especially at first, to check if everything is running fine/set up properly on the OS side, before the wayland WM itself. Sometimes those WM can be a bit flakey and you want to ensure everything is fine on FreeBSD's side, before running into issues with the WM itself. Sway is the most stable and reliable on freebsd, so it is a good idea to try that one first and then try any other one. You just uninstall sway later if you don't want that one.

So just ensure you have these all setup properly (checck list and so on) -
1. load drm for your graphics (in rc.conf using kld_list)
2. have seatd running at boot ( in rc.conf using seatd_enable="YES" (also disable any login manager like sddm from rc.conf for now, and I don't think you need it when you do use a login manager)
3. have your user in the video group (as root - pw groupmod video -m username).

Then -
4. don't install xwayland yourself if it uninstalled other packages. The wayland WM packages are usually built with it enabled in the default packages, and should pull it in themselves, and that way is usually fine. check with pkg info | grep xwayland after installing a wayland WM.
5. setup /proc porcfs and dbus. they are usually not needed for the WM itself, but can cause problems in apps if they are not set up and running.
6. setup XDG_RUNTIME_DIR in your shell. this can cause issue in some WM more than others and the safest way that always works is to make a folder under your user's home somewhere with chmod 0700. it is usually set to /var/user/<userID> or sometimes people use /tmp, but this is more reliable. You can change it later. I use mkdir ~/.cache/run; chmod 0700 ~/.cache/run. You can check if it's set up correctly in either case by using mpv. Run mpv <video file>from a terminal emulator, even in X11 like MATE. It will say that XDG_RUNTIME_DIR is not set but still play the video in case it isn't set up properly. If mpv doesn't mention it, it means it is fine. Some wayland WM (even X11 ones like leftwm) that need XDG_RUNTIME_DIR will fall into a loop and hang your system if it is not set properly and mpv is safe.

Then reboot the system and from the tty, login as user and just type 'sway'or 'wayfire' etc ( you don't need to specify the config file if it is in the default location). If that runs fine, then it is better to start using 'dbus-launch sway' etc, to run the DM with dbus for things that need it, like trash in a filemanager. Make it to a script for conveniece. (dbus-launch sway is the short version that still works. dbus-launch --sh-syntax --exit-with-session sway is the proper way)

Other than that, you usually need to install some other packages along with the main one. For instance for sway, type pkg search sway and some packages besides sway itself will show up that you need or want like swaybg, swaylock. Sometimes they are mentioned by the package manager when you install them, but sometimes it is better to go to their website and they will have a list of needed and recommended packages. Wayfire for instance has a list, and there is one that helps set it up properly out of the box. Otherwise you have to configure it yourself like an advanced user. It's called something like wayfire shell iirc. Hyprland didn't work at first for my too, because it was missing something, but can't recall right now.

Another point, is to remove configs from your home dir and just run the WM with the default system one. If that runs fine, then use one from your home dir.

Basically the jist of it is - set up freebsd - install the WM and all the pkgs needed - run from tty as your user. Pretty much for all of them. That way you will eliminate issues with FreeBSD setup, and more likely know that issue is with the WM packages.That should be all.
 
1. load drm for your graphics (in rc.conf using kld_list)
Thanks for the info and taking the time to help.

My rc.conf loads in radeonkms, as I have a relatively vintage AMD FirePro M4000. I've got a feeling that drm is supported by the amdgpu driver, and my card is too old for that.

Is this what you mean by "load in drm" or is there another kernel module I should be loading in?
 
Thanks for the info and taking the time to help.

My rc.conf loads in radeonkms, as I have a relatively vintage AMD FirePro M4000. I've got a feeling that drm is supported by the amdgpu driver, and my card is too old for that.

Is this what you mean by "load in drm" or is there another kernel module I should be loading in?
Yeah, it looks like loading radeonkms is the right call in your case. It's important to match the GPU driver to the actual hardware you have.
 
Yeah, it looks like loading radeonkms is the right call in your case. It's important to match the GPU driver to the actual hardware you have.
There is also a "drm.ko" which I think is provided by the drm-510-kmod package, is that necessary to be loaded?
 
Yeah, the drm modules are definitely loaded.

Wayfire doesn't seem to work at all following the steps above. Running
Code:
Hyprland
results in an "Abort trap (core dumped)" message, but the below command seems to fire up something which resembles a GUI but only says "Hyprland" on it

Code:
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session Hyprland

I think I pressed some random keys, for when I managed to close Hyprland, there was a log (which i now can't find and can't make it output) in red writing stating that my system is too slow.

Going to use this thread as a reference for the configuration modifications to see if I can get Hyprland functional, but Wayfire seems to be eluding me (or my slow system)

 
There's a good possibility that the hardware you got is just too old...

Xorg will play nice with radeonkms, I know that much. But Wayland might not. That's just an educated guess on my part. I use amdgpu (because the oldest card I have is Polaris 10 (Asus Radeon RX 550 4 GB). And even there, my Wayland results are a mixed bag.
 
There's a good possibility that the hardware you got is just too old...
It is possible. I'm running an HP Elitebook 8560w, I think it's a 2012 model. 3rd gen Intel Core i7 dual core, DDR3 1600MHz RAM, would have thought it'd be ok though. It does run hotter on FreeBSD than other systems, not enough to be an issue for me, though full-screen HD YouTube videos it feels on the edge of overheat.
 
I think I have it working as best I can. Nasty anti-aliasing or something going on, and the scaling is weird.

If my hardware actually isn't too old, then it's me that's too old. KDE Plasma 5 under X11 or Wayland also doesn't want to run either so I'll stick with what I have working as it's a bit of a house of cards configuration!
 
Wayfire doesn't seem to work at all following the steps above. Running
Code:
Hyprland
results in an "Abort trap (core dumped)" message, but the below command seems to fire up something which resembles a GUI but only says "Hyprland" on it

Code:
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session Hyprland

I think I pressed some random keys, for when I managed to close Hyprland, there was a log (which i now can't find and can't make it output) in red writing stating that my system is too slow.

I think Hyprland ran if you saw that, that is the default wallpaper, however these WM's usually have a terminal and app launcher they use by default (set in the default config, along with the key bindings). You usually have to look in the default config file to figure what they are/which they use. I think Hyprland uses wofi for launcher, not sure if alacritty or kitty for terminal.
 
the below command seems to fire up something which resembles a GUI but only says "Hyprland" on it
I think Hyprland ran if you saw that, that is the default wallpaper
Indeed, Hyprland was running.

I think I pressed some random keys, for when I managed to close Hyprland
The Hyprland package installs a configuration file under /usr/local/share/hyprland/hyprland.conf.

Copy that file under ~/.config/hypr/ and edit to your needs. In there are also example keybindings set, there you can see which key combination triggers which action. More binds (and other documentation) can be found on the projects wiki (link inside the file).
 
Back
Top