Rebooting host causes GPU / XAuthority, X passthrough to fail and container to fail to start

I just posted this issue to github

Basically X fails to reconnect to the VM in some way, I’m new to .X and .XAuthority but have attempted to learn as much as possible. I’ve posted the log files to github and they should help

I’m using a custom UID for another user - jenkins (100gid, 109uid) and have the correct UID and GID set as per the guide:

it worked before the reboot extremely well, does anyone know how to fix this as it’s a great feature.

I attempted to re-do the setup as per the guide, to see if some configuration was lost but the issue appears to be finding the /tmp/.X11-unix/X0 on the host.

lxc config device add build-server X0 disk path=/tmp/.X11-unix/X0 source=/tmp/.X11-unix/X0
error: Failed to setup device: Unable to mount /proc/1/root/tmp/.X11-unix/X0 at /var/snap/lxd/common/lxd/devices/build-server/disk.tmp-.X11-unix-X0: invalid argument

Now, this worked before, I’ve checked on the host, the symbolic link is in place, so I don’t understand why it’s telling me there is an invalid argument. Tried removing the X0 and Xauthortity, this makes the container bootable again but can’t then re-add the X0 and Xauthority.

I can provide more info, if needed.

@simos you may want to look into this one

I had a look at the github report and I see that it probably has been resolved.

@nodrog_unity: regarding the question about the LXD snap, the snaps auto-update once a day. It is also possible to force an update to happen at once, if an update is available.

Currently, the fix that @stgraber has mentioned, is at his git tree with title Fix failure due to bind-mount through /proc.
This commit needs to be added to LXD and appear at (not there yet).
Once the update lands into LXD, you can check with

$ snap info lxd
snap-id:         J60k4JY0HppjwOjW8dZdYc8obXKxujRu
  stable:        2.19        (4715) 42MB -
  candidate:     2.19        (4715) 42MB -
  beta:          ↑                       
  edge:          git-2a45884 (4753) 43MB -

The edge channel is the one that will get the most fresh snap of LXD, and you can cross-reference the version (the git-2a45884) with a commit hash from That is, you need a snap package from the edge channel that has a git commit ID/hash that is new enough to have the fix by @stgraber.

Edge should have updated by now, if your system didn’t auto-update, running “snap refresh lxd” should take care of it.

Thanks for your help, I’ve just installed the updated version, will post back if I have success!

You guys fixed it in the latest patch, the guide now works flawlessly.

I even copied my container to my laptop and it worked!

Thank you.

If there is a way to avoid manually mapping the UID and GID I would like to know how to at least automate it finding that user? In the manual it says their optional arguments, but wouldn’t it stop the system from functioning if the GPU wasn’t assigned to a user?

Obviously they’re using a user system. Maybe username would be a better way instead of UID matching, but I don’t understand enough about how your system works to really make a statement like that.

1 Like