Fedora

How To Install Xfce Desktop on Fedora 45 / 44

Adding Xfce to a Fedora Workstation is one dnf transaction and a reboot, and the reboot is not optional. On our test machine GDM ignored the new session until the system restarted. Once we were in, the desktop portal refused to start. It needs a systemd target that the Xfce session never creates on its own. Both take a minute to fix when you know about them.

Original content from computingforgeeks.com - post 74939

This guide shows how to install Xfce on Fedora with dnf using the Xfce desktop environment group, log in to it from GDM next to GNOME, and fix the portal so Flatpak apps behave. It also covers switching the login screen to LightDM the way the Xfce Spin does, the experimental Xfce Wayland session on labwc, changing Xfce settings from the terminal with xfconf-query, and removing Xfce cleanly afterwards. If you are starting from a blank disk, install Fedora 45 Workstation first. Every step below was run on Fedora 45 (GNOME 51, Xfce 4.20) with the Workstation package set in October 2026, and the install and portal fix were repeated on Fedora 44.

Pick the Xfce group to install

Fedora ships Xfce as an environment group, xfce-desktop-environment, which wraps a core group called xfce-desktop plus the Xfce application and media groups. These are the --assumeno dry-run numbers on our machines with the Workstation package set, so packages GNOME already pulled in are not counted:

GroupFedora 45Fedora 44
@xfce-desktop-environment369 packages, 393 MiB download, 1 GiB installed347 packages, 360 MiB download, 1 GiB installed
@xfce-desktop230 packages, 290 MiB download, 765 MiB installed200 packages, 288 MiB download, 804 MiB installed

The environment group adds the Xfce apps people expect: Mousepad, Ristretto, Parole, Xfburn, Catfish, Claws Mail, Pidgin, Geany, Transmission and GParted. The core group skips all of them but still brings the panel, Thunar, the settings manager, LightDM and the Xorg server. Use the environment group unless disk space is tight. If you would rather start from a blank disk, the Fedora Xfce Spin installs Xfce as the only desktop.

Install Xfce on Fedora with dnf

Update first so the group lands on current packages, then install it:

sudo dnf5 upgrade --refresh -y
sudo dnf5 install @xfce-desktop-environment

dnf lists the groups it pulls in, then asks for confirmation. On Fedora 45 the summary reads:

Installing environmental groups:
 Xfce Desktop

Transaction Summary:
 Installing:       369 packages
 Changing reason:    4 packages

Total size of inbound packages is 393 MiB. Need to download 393 MiB.
After this operation, 1 GiB extra will be used (install 1 GiB, remove 0 B).

GNOME is Wayland only on Fedora 45, so Workstation has no Xorg server until this group adds one. LightDM also arrives, but the install leaves it disabled and GDM keeps the login screen. Check both display managers:

systemctl is-enabled gdm lightdm

GDM stays enabled:

enabled
disabled

Leave it like that for now. GDM starts X11 sessions for other desktops just fine, and the LightDM section further down explains what you give up by switching.

Reboot and log in to the Xfce session

Reboot rather than restarting GDM. We restarted GDM right after the install on Fedora 45, twice. Both times the session menu still showed only GNOME and GNOME Classic. After a full reboot the new entry was there:

sudo systemctl reboot

On the login screen, click your name, then the gear icon in the bottom right corner before typing the password. Pick Xfce Session:

GDM session menu listing GNOME, GNOME Classic and Xfce Session on Fedora 45

GDM remembers the choice, so the next login goes straight to Xfce. The session runs on X11. GDM launches it through gdm-x-session, which starts Xorg on its own virtual terminal. xfwm4 is the window manager. You can see that from a terminal inside the session:

ps -C gdm-x-session,Xorg,xfwm4 -o pid=,args=

Xorg sits on vt2 under gdm-x-session, with xfwm4 managing the windows:

2213 /usr/libexec/gdm-x-session startxfce4
2221 /usr/libexec/Xorg vt2 -displayfd 3 -auth /run/user/1001/gdm/Xauthority -background none -noreset -keeptty -novtswitch -verbose 3
2502 xfwm4

The Xfce desktop on Fedora 45

The first login needs no setup wizard. Xfce comes up with the default Fedora wallpaper, the Home, File System and Trash icons, a panel across the top and a launcher dock at the bottom:

Xfce desktop with Fedora 45 wallpaper, top panel and bottom dock

The Applications button opens the classic Xfce menu. Everything Xfce exposes in its GUI lives under Settings, alongside Fedora tools such as dnfdragora (the package manager front end the group installs) and the Firewall settings:

Xfce Applications menu with the Settings submenu open on Fedora 45

Settings Manager collects the same tools in one window. Appearance, Window Manager and Panel are the three you will open first:

Xfce Settings Manager on Fedora 45

The reason most people install Xfce is memory. We cold-booted the same 8 GB VM six times, logged in, waited two minutes, then read free -m. Each desktop got three runs:

Session on Fedora 45Used memory, median of 3 runsRange
Xfce (X11, xfwm4)1,213 MiB1,211 to 1,218 MiB
GNOME (Wayland)1,658 MiB1,493 to 1,817 MiB

That is about 450 MiB less for Xfce. Its readings barely moved between boots. GNOME swung by more than 300 MiB, depending on what its background services were doing after login. Both numbers include GNOME services that autostart in any session on a Workstation install, such as the Evolution data server, its alarm notifier and the GNOME Online Accounts daemons.

Change Xfce settings from the terminal with xfconf-query

Xfce keeps every setting in xfconf, and xfconf-query reads and writes it, which makes the desktop scriptable. That matters here. The default on Fedora is not the Xfce look you see in screenshots elsewhere. The group installs the Greybird themes, but the system-wide xsettings file that Fedora ships sets Adwaita:

xfconf-query -c xsettings -p /Net/ThemeName

A fresh Fedora login returns:

Adwaita

Switch the GTK theme and the window decorations to Greybird Dark, and drop the workspace count from four to two. The changes apply to the running session immediately:

xfconf-query -c xsettings -p /Net/ThemeName -s Greybird-dark
xfconf-query -c xfwm4 -p /general/theme -s Greybird-dark
xfconf-query -c xfwm4 -p /general/workspace_count -s 2

Thunar and the terminal pick up the dark theme straight away. Fastfetch in the terminal confirms the window manager, theme and session:

Thunar and xfce4-terminal with the Greybird-dark theme and fastfetch on Fedora 45

To find a property name, change the setting once in the GUI and list the channel with xfconf-query -c xfwm4 -l. Your values are written to ~/.config/xfce4/xfconf/xfce-perchannel-xml/, one XML file per channel. Panel launchers live next to them under ~/.config/xfce4/panel/, so copy the whole ~/.config/xfce4 tree while logged out to move your desktop to another machine.

Get the desktop portal running in Xfce

This one is worth fixing on every Fedora Xfce install, whether you log in through GDM or LightDM. Flatpak apps open files, links and screenshots through xdg-desktop-portal, and in a fresh Xfce session it never starts.

Error: “Dependency failed for xdg-desktop-portal.service”

The user journal shows the failure right after login:

journalctl --user -b -u xdg-desktop-portal --no-pager | tail -2

The job fails on a dependency, so nothing crashed:

Oct 06 21:57:54 f45-01 systemd[2185]: Dependency failed for xdg-desktop-portal.service - Portal service.
Oct 06 21:57:54 f45-01 systemd[2185]: xdg-desktop-portal.service: Job xdg-desktop-portal.service/start failed with result 'dependency'.

Any client that asks the portal for something gets the same refusal. A settings read is the simplest test:

gdbus call --session --dest org.freedesktop.portal.Desktop --object-path /org/freedesktop/portal/desktop --method org.freedesktop.portal.Settings.ReadOne org.freedesktop.appearance color-scheme

D-Bus reports that the portal could not be activated:

Error: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer 'org.freedesktop.portal.Desktop': startup job failed

The cause sits in the unit file. xdg-desktop-portal.service declares Requisite=graphical-session.target, and xfce4-session never starts that target. You cannot start it by hand either, because systemd refuses manual starts of that unit:

systemctl --user start graphical-session.target

The request is rejected:

Failed to start graphical-session.target: Operation refused, unit graphical-session.target may be requested by dependency only (it is configured to refuse manual start/stop).
See user logs and 'systemctl --user status graphical-session.target' for details.

The fix has three small files: a user target that binds to graphical-session.target, a watcher that stops the graphical session when Xfce exits, and an autostart entry that starts the target at login. The LXQt session on Fedora has the same portal problem, and the LXQt guide solves it with a target as well. The Xfce group installs vim-enhanced, so vim is available. Create the two directories and open the target file:

mkdir -p ~/.config/systemd/user ~/.config/autostart
vim ~/.config/systemd/user/xfce-session.target

Add these lines:

[Unit]
Description=Xfce session
BindsTo=graphical-session.target
Wants=graphical-session-pre.target xfce-session-watch.service
After=graphical-session-pre.target

The watcher matters if you also use GNOME. Xfce never stops graphical-session.target on logout, and gnome-session refuses to start while it is active. Without the watcher, logging out of Xfce and straight back in to GNOME failed on our machine, under GDM and under LightDM, with this in the user journal:

Oct 06 22:16:52 f45-01 gnome-session-i[4751]: A graphical session is already running!

Create the watcher service:

vim ~/.config/systemd/user/xfce-session-watch.service

It polls for xfce4-session every two seconds and stops the graphical session once it is gone (%u expands to your user name):

[Unit]
Description=Stop graphical-session.target when xfce4-session exits

[Service]
ExecStart=/bin/sh -c 'while pgrep -u %u -x xfce4-session >/dev/null; do sleep 2; done; systemctl --user --no-block stop graphical-session.target'

Next comes the autostart entry. It passes the X11 display variables to the systemd user manager, then starts the target. OnlyShowIn=XFCE keeps it from running in GNOME:

vim ~/.config/autostart/xfce-graphical-session.desktop

Paste the entry:

[Desktop Entry]
Type=Application
Name=Start graphical-session.target
Exec=sh -c "dbus-update-activation-environment --systemd DISPLAY XAUTHORITY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE && systemctl --user start xfce-session.target"
OnlyShowIn=XFCE;

Reload the user manager, then log out and back in:

systemctl --user daemon-reload

After the next login the target, the watcher, graphical-session.target and the portal are all active, and the same gdbus call now returns a value. Four seconds after logging out, all of them were inactive, and GNOME started normally straight after. The xfce-portals.conf file in Fedora prefers the XApp backend for settings and screenshots, but that package is not part of the group, so the portal falls back to the GTK backend, which handles file dialogs. The target and autostart entry also brought the portal up on Fedora 44:

xdg-desktop-portal active in an Xfce session on Fedora 45 after the graphical-session.target fix

Use LightDM instead of GDM

The Xfce Spin uses LightDM with the GTK greeter, and the group already installed both. Swapping display managers takes two commands, because only one unit can own display-manager.service:

sudo systemctl disable gdm
sudo systemctl enable lightdm

systemd moves the alias from one unit to the other:

Removed '/etc/systemd/system/display-manager.service'.
Created symlink '/etc/systemd/system/display-manager.service' → '/usr/lib/systemd/system/lightdm.service'.

Reboot. The LightDM greeter shows the Fedora wallpaper with the session picker in the top bar. It preselected GNOME on our first boot even though we had used Xfce last under GDM, so pick Xfce Session from that menu once. LightDM remembers it from then on:

LightDM GTK greeter with Xfce Session selected on Fedora 45

Keep GDM if you still log in to GNOME on this machine. GNOME starts from LightDM, but the first thing it shows is a notification that the screen lock is off, because GNOME 51 only locks the screen when GDM is the display manager:

GNOME notification Screen Lock disabled, Screen Locking requires the GNOME display manager, under LightDM on Fedora 45

Xfce has its own locker (xfce4-screensaver), so an Xfce-only machine loses nothing. Switching between Xfce and GNOME without a reboot worked under LightDM too, once the portal watcher from the previous section was in place. To go back to GDM, reverse the two commands and reboot:

sudo systemctl disable lightdm
sudo systemctl enable gdm

The alias points back at GDM:

Removed '/etc/systemd/system/display-manager.service'.
Created symlink '/etc/systemd/system/display-manager.service' → '/usr/lib/systemd/system/gdm.service'.

Try the experimental Xfce Wayland session

Xfce 4.20 can run inside a Wayland compositor. The Xfce 4.20 tour introduced startxfce4 --wayland, and the startxfce4 script on Fedora uses labwc as the default compositor and runs xfce4-session inside it. Fedora packages the support in xfce4-session but ships no login-screen entry for it, so you add one yourself. Install labwc first:

sudo dnf5 install -y labwc

Put the session file under /usr/local/share so no package update overwrites it:

sudo mkdir -p /usr/local/share/wayland-sessions
sudo vim /usr/local/share/wayland-sessions/xfce-wayland.desktop

Add the entry. TryExec hides it from the menu if labwc is ever removed:

[Desktop Entry]
Name=Xfce Session (Wayland)
Comment=Experimental Xfce session on the labwc compositor
Exec=startxfce4 --wayland
TryExec=labwc
Type=Application
DesktopNames=XFCE

After a reboot GDM lists the new entry under the X11 one:

GDM session menu with Xfce Session (Wayland) on Fedora 45

The panel, Thunar, notifications and the power manager all come up, and the portal works with the fix from the previous section. The desktop itself doesn’t. It stays black with no icons, because Fedora builds xfdesktop without Wayland support. Starting it by hand in the Wayland session says so:

xfdesktop

It exits straight away:

** (xfdesktop:3323): CRITICAL **: 22:01:09.955: xfdesktop was not built with Wayland support

labwc can paint a wallpaper itself. Install swaybg and start it from the labwc autostart file that Xfce uses, ~/.config/xfce4/labwc/autostart (startxfce4 creates the directory on the first Wayland login):

sudo dnf5 install -y swaybg
vim ~/.config/xfce4/labwc/autostart

One line is enough:

swaybg -i /usr/share/backgrounds/default.jxl -m fill >/dev/null 2>&1 &

On the next Wayland login the wallpaper is back and the session reports itself as Wayland, with labwc running and no xfdesktop:

Xfce Wayland session on labwc with swaybg wallpaper and xfce4-terminal on Fedora 45

Treat it as a preview. Window decorations come from labwc, not xfwm4, so your xfwm4 theme and keyboard shortcuts do not apply. The Fedora package also lacks the Xfce defaults for labwc (startxfce4 tries to copy them from /usr/share/xfce4/labwc/, which does not exist), so labwc runs with its stock settings. Desktop icons are gone too. The X11 session remains the one to use day to day. If you want a Wayland desktop that is finished, KDE Plasma on Fedora or a Sway setup with Waybar are better places to look.

Remove Xfce from Fedora completely

Removing the group isn’t enough on its own. If you switched to LightDM, switch back to GDM first, because the cleanup below removes LightDM while display-manager.service would still point at it:

sudo systemctl disable lightdm
sudo systemctl enable gdm

Reboot so GDM takes over the login screen, log in to GNOME, then remove the environment group:

sudo dnf5 remove @xfce-desktop-environment

That removes 237 of the 369 packages and keeps the rest. For 36 packages dnf5 only changes the install reason instead of removing them, and Thunar, xfce4-session, xfwm4, the panel, LightDM and Xorg are among them. The Xfce entry stays on the login screen. Check:

rpm -q xfce4-session xfce4-panel lightdm xorg-x11-server-Xorg

All four are still installed:

xfce4-session-4.20.4-2.fc45.x86_64
xfce4-panel-4.20.8-4.fc45.x86_64
lightdm-1.33.1-7.fc45.x86_64
xorg-x11-server-Xorg-21.1.24-2.fc45.x86_64

Those packages are now marked as dependencies nothing needs, so autoremove takes them. Read the list before you confirm, because autoremove also catches anything else on the system that was orphaned earlier:

sudo dnf5 autoremove

On our Fedora 45 machine it removed another 118 packages and freed 158 MiB:

Transaction Summary:
 Removing:         118 packages

After this operation, 158 MiB will be freed (install 0 B, remove 158 MiB).

Running the same rpm -q check again now reports that none of the four packages is installed. If you added the Wayland session, remove labwc, swaybg and the session file too:

sudo dnf5 remove labwc swaybg
sudo rm /usr/local/share/wayland-sessions/xfce-wayland.desktop

Clear the per-user Xfce configuration and the portal fix files, which are harmless in GNOME but pointless once Xfce is gone:

rm -rf ~/.config/xfce4 ~/.config/Thunar ~/.cache/sessions
rm -f ~/.config/autostart/xfce-graphical-session.desktop ~/.config/systemd/user/xfce-session.target ~/.config/systemd/user/xfce-session-watch.service
systemctl --user daemon-reload

After a reboot the GDM session menu is back to GNOME and GNOME Classic, and GNOME logs in normally. For the rest of a fresh Fedora setup, the post-install checklist for Fedora 45 covers codecs, Flatpak and updates, and the dnf5 cheat sheet has more on groups, history and autoremove.

Keep reading

How to Upgrade Fedora 44 to Fedora 45 (GUI, CLI and Rollback) Fedora How to Upgrade Fedora 44 to Fedora 45 (GUI, CLI and Rollback) Enable RPM Fusion and Install Multimedia Codecs on Fedora 45 / 44 / 43 Fedora Enable RPM Fusion and Install Multimedia Codecs on Fedora 45 / 44 / 43 Harden Fedora 45 / 44 for Desktop and Server: Complete Guide Fedora Harden Fedora 45 / 44 for Desktop and Server: Complete Guide Switch Fedora From GRUB to systemd-boot With bootctl Fedora Switch Fedora From GRUB to systemd-boot With bootctl DNF5 Cheatsheet for Fedora 45 / 44: Tested Commands and Fixes Fedora DNF5 Cheatsheet for Fedora 45 / 44: Tested Commands and Fixes Set Default Vagrant Provider to VirtualBox or Libvirt Debian Set Default Vagrant Provider to VirtualBox or Libvirt

Leave a Comment

Press ESC to close