-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection to X server lost [--user=RETAIN] [--init=systemd] #417
Comments
Thank you for the report! The bug occured with |
Can confirm that it works now as expected. I now have an issue with systemd user units using the flag
However this might be a separate issue and unrelated to the original problem of this issue. |
Yes, this looks unrelated. |
Yet found an issue in the cgroup setup for systemd and fixed it. Could you please update and test again? |
With While testing this i found another issue with
Actually querying for |
Thank you for the report! |
Therefore I tried to tackle When comparing the container with my system I can see that there is no |
As an addition I now had a look at the systemd output and found that a lot of services could not be started because the cgroup ID could not be retrieved or the services could not connect to the journal which also could not be started. Please see the full systemd startup in the following paste: |
Those errors are unusual. Maybe you need package loginctl looks good here:
However, I also have no
Edit: just tried
|
After some further testing I found the issue. The journal can be fixed by sharing
The environment variable Invoking |
Thank you for your investigation! I'll check it out.
x11docker sets
x11docker disabled this service. I am not sure yet why I disabled this one; x11docker disables several I've adjusted x11docker:
|
In my (edited) post above I've implemented some of your suggestions in x11docker and uploaded a commit. What host system and what image system do you use? What is your docker version? Could you compare e.g. with image
Edit: x11docker now creates loginctl looks good here, should work for you, too:
|
--init=systemd: do not run dbus user session, done bei loginctl #417
I am using Arch Linux with Docker version 20.10.12, build e91ed5707e for my host system and Arch Linux in my image as well. For this reason I cannot install
I don't know if they are good practice since I do not have any deeper understanding of systemd. Those suggestions are just the ones that made it work for me. Your fixes work well in my container, however they do not change anything in regard to Notice the difference in State and the absence of a session compared to your output:
I also have many errors that you do not have in your output. |
On another note 40eba6c#diff-0cf1bc31311c54f65de516fc6729fcf2d6c9f2d3beee93a5c249e16657909e7bR7326 breaks my PulseAudio setup while it works with 40eba6c#diff-0cf1bc31311c54f65de516fc6729fcf2d6c9f2d3beee93a5c249e16657909e7bR7327. Do I have to change anything regarding options? Usually I run my container with |
Oops, sorry. There was some experimental code for |
I've build an arch image to reproduce your issues. |
If I change this line: https://github.com/mviereck/x11docker/blob/master/x11docker#L6293
to
and run x11docker with
Edit: meanwhile I can run a user session, looks good so far. arch shows a valid loginctl output. |
I've uploaded a commit that works well for me with The final container command is not started by a service as before (neither system nor user service) but by running the command in
I could not reproduce your Now I'll check the other supported init systems if x11docker could run them with a |
I have a valid login session now as well. However oddly enough I now have an issue with tmux crashing my image. Every time I launch Alacritty with tmux it instantly kills my container and prints Maybe the watch service end gets triggered for some reason in this scenario?
The only log that i have for this issue is |
Could you show me your x11docker command? And maybe also provide your Dockerfile so I could directly reproduce your issues?
Maybe x11docker started a WM. Use option
x11docker used
Hmm. It would be triggered if the final desired command would exit. If your targeted command Alacritty crashes, that would also terminate the container. Or if the container login console itself crashes, e.g. because |
This has been my command throughout all my tests.
This indeed makes it work in the first place otherwise the container won't even start, however I have been doing this since the beginning. I think that something might have changed concerning the D-Bus connection or because of the way signing in now works, the tmux server cannot create If you want to test this yourself you have to be aware that my container image is about 8GB large as it is more or less my whole system. https://raw.githubusercontent.com/DiXN/dotfiles/chezmoi/linux/Dockerfile |
Uh, ok. That is a bit heavy.
But the build fails at the last RUN line:
I am barely familiar with arch, do you have a hint how to fix this? |
Could be a key issue. You might have to run I also setup a minimal Dockerfile where my config is present and all the dependencies that are required for Alacritty. This setup is significantly smaller than my actual docker image. https://raw.githubusercontent.com/DiXN/dotfiles/minimal/linux/Dockerfile |
You are right, I changed the Dbus setup and got issues here, too. Normally the Dbus user session should start on itself as soon as it is needed, but this seems to fail.
Thank you, that is very useful! I had to add In my test runs I now can reproduce your error messages during boot, all concerning failed
Interesting comparision: I have an arch image that is 11 month old. Images build upon this do not have these cgroup errors. (But pacman key issues for some packages.) The cgroup errors seem to do no harm, everything works here as expected. But I'll investigate further if they can be fixed. Edit: I had a look at systemd news in https://github.com/systemd/systemd/blob/main/NEWS searching for keyword 'cgroup', but found nothing that explains the issues. This ticket might be related and indicates that the messages are harmless: systemd/systemd#22483 Interesting: I don't get cgroup errors if I use Running with |
Overall I did not come across any issues while testing.
That was a deliberate decision since I did not think that
That is interesting and could be the reason in my case since I am using an older kernel (5.13).
I actually would rather use |
It always sets the same password for the user as well as for root. You can set and store another password with option
It was set as
If the reason is the kernel version than you should get the same messages on host.
Did you test with x11docker? I have no nvidia card, so I cannot test myself. |
After terminating a container I still have a user session on my host device. Maybe
For me it was not the same, that is why I am curious. It works once i change the password with
Oh that is my bad. I forgot to commit some changes to the Dockerfile.
At the moment I can't but I will once I have access to a nvidia card again. |
I can not reproduce this.
Does this happen with |
I'd like to close the ticket. The remaining issues might be answered with my previous comment. |
Ever since version 7.1.0 I cannot launch my container anymore. More specifically since commit: c99244d.
I launch my container with
x11docker --clipboard --dbus --shell=/bin/zsh -I -p --desktop --user=RETAIN --cap-default --sudouser --gpu --xorg "CONTAINER"
"CONTAINER" launches the awesome window manager internally with
ENTRYPOINT [ "awesome" ]
and yields the following error message:E: awesome: main:694: cannot open display (error 1)
The text was updated successfully, but these errors were encountered: