I’m having a frustrating issue with SDDM on my Manjaro system. SDDM is not creating a .Xauthority file in my home directory, which is preventing me from using X11 forwarding with Docker. I’ve spent several days troubleshooting this, and I’m hoping someone in the community can offer some guidance.
Problem:
SDDM is not creating a .Xauthority file in my home directory (/home/<my_username>/.Xauthority) when I log in graphically. This is preventing applications (specifically, a GUI application running in a Docker container) from connecting to the X server.
Symptoms:
The file /home/<my_username>/.Xauthority exists, but it has a size of 0.
Applications that require X11 forwarding fail to connect to the X server, with errors related to .Xauthority not being found or being a directory.
My Setup:
Manjaro Linux (latest version)
KDE Plasma desktop environment
SDDM display manager
Using startx is not an option
Troubleshooting Steps Taken:
I’ve already tried the following troubleshooting steps:
Verified xauth is installed: The xorg-xauth package is installed and up to date.
Checked ~/.xinitrc and ~/.xprofile: These files do not exist in my home directory.
Verified SDDM is the active display manager:systemctl list-units --type=service | grep display-manager shows sddm.service as active.
Checked SDDM logs: The SDDM logs (journalctl -u sddm) show that SDDM is creating a .Xauthority file in /run/sddm/, but it’s not copying it to my home directory.
Modified /usr/share/sddm/scripts/Xsetup: I added the following lines to the end of the /usr/share/sddm/scripts/Xsetup script:
I’m using a Dockerfile to build an image that runs a GUI application. The Dockerfile creates a user with the same UID as my host user and mounts the /tmp/.X11-unix directory and the .Xauthority file into the container.
I have a vague memory of a certain approach people would use when they wanted to be able to point to the dynamically generated xauth file … but its not popping up in my wiki searches.
PS
Oh, if you do have this … it may be considered for deletion.
The auth socket generated by sddm is stored in /tmp - I don’t know if you can use to communicate - but as wayland is intended to replace x11 especially in terms of security I doubt it.
$ ls -l /tmp/sddm*
srwxr-xr-x 1 root root 0 10 mar 16:45 /tmp/sddm-auth-9f3a1f19-cc39-47f7-abb7-a774d9b3b286
srwx------ 1 sddm sddm 0 10 mar 16:45 /tmp/sddm--LrENLG
Plasma uses dbus for communication perhaps you can configure docker to do the same?
If you really need the x11 forward - you could try replacing sddm with e.g. lightdm - you already got it installed - at least it looks like - be sure you got a greeter installed too.
Thank you everyone for your helpful suggestions. Unfortunately, after trying many different approaches, I wasn’t able to find a solution that allows me to use X11 forwarding with Docker on my Manjaro system without making significant changes to the host OS.
I also wanted to mention that I previously tried switching to LightDM (on February 25, 2025), and it resulted in a black screen and considerable difficulty accessing my system. It took me a while to recover, and I’m hesitant to try that again without being prepared to potentially reinstall everything.
Since modifying the host OS is not an option for me, and I’m concerned about the potential risks of switching display managers, I’m going to have to abandon this project for now. I appreciate your time and effort.
Since it was not mentioned here, I want to share another tip: Nested X11 Sessions
Its basically a separate X11 server running independent of your host’s X11 server and is usually interacted like a typical GUI application. There’s a few applications that can do this but Xephyr (ArchWiki) is popular for this. This way, you don’t have touch your host settings and avoid breaking anything.
I don’t use this typically, only on a few occasions when I was playing with firejail (application sandbox). But, it seems to be simple as passing the appropriate DISPLAY variable and the relevant socket file managed by Xephyr into the container: https://stackoverflow.com/a/40795185