x11docker: Running as non-root user shows error due to missing process id (NixOS)
Version: 5.3.1 OS: NixOS
When running as non-root user, the command that tries to get the process id (ps ax | grep ...) returns nothing, because ps does not list the process, as it as run as root which it cannot see.
Symptopm: container.pid is empty
As a result, an error window pops up, but the container starts fine otherwise.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (9 by maintainers)
Commits related to this issue
- watch pid 1 of container instead of container pid, fix for NixOS (#83) — committed to mviereck/x11docker by mviereck 6 years ago
- Change shebang to `/usr/bin/env bash` for portability. #83 — committed to mviereck/x11docker by mviereck 6 years ago
- Change shebang to `/usr/bin/env bash` for portability. #83 — committed to mviereck/x11docker by mviereck 6 years ago
The important thing seems to be
/procmounted with optionhidepid=2, which hides all processes in/procwhich are not owned by the current user. Judging from your code, the pid watcher will thus also probably fail.For NixOS, a viable solution should be to add the user to the
procgroup, which exempts him from pid hiding. I suppose,ps auxwill also work like expected then.Will test that next week.