mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.68k stars 379 forks source link

'Unknown X server option --tty' #464

Closed adworacz closed 2 years ago

adworacz commented 2 years ago

Hello! I'm having an issue when trying to just run a single command with no X server.

I saw this example command in another ticket, which is currently failing for me:

 x11docker --debug --tty --interactive debian:10 bash

Output is:

DEBUGNOTE[20:00:15,895]: Detected cgroup v2
DEBUGNOTE[20:00:16,085]: check_host(): ps can watch root processes: yes
DEBUGNOTE[20:00:16,128]: host user: user 1000:1000 /home/user
DEBUGNOTE[20:00:16,162]: check_host(): Guess if running on console: no
DEBUGNOTE[20:00:16,368]: storeinfo(): cache=/home/user/.cache/x11docker/732151410438-debian-10
DEBUGNOTE[20:00:16,379]: storeinfo(): stdout=/home/user/.cache/x11docker/732151410438-debian-10/share/stdout
DEBUGNOTE[20:00:16,389]: storeinfo(): stderr=/home/user/.cache/x11docker/732151410438-debian-10/share/stderr
DEBUGNOTE[20:00:16,434]: waitforlogentry(): tailstdout: Waiting for logentry "x11docker=ready" in store.info
DEBUGNOTE[20:00:16,435]: waitforlogentry(): tailstderr: Waiting for logentry "x11docker=ready" in store.info
DEBUGNOTE[20:00:16,448]: storeinfo(): containeruser=user
DEBUGNOTE[20:00:16,459]: container user: user 1000:1000 /home/user
DEBUGNOTE[20:00:16,802]: Default runtime:
DEBUGNOTE[20:00:16,823]: Backend: docker, Backendbin: /usr/bin/docker, Rootless:
DEBUGNOTE[20:00:16,861]: storepid(): Stored pid '78883' of 'watchpidlist':   78883 pts/21   00:00:00 bash
DEBUGNOTE[20:00:16,888]: storepid(): Stored pid '78893' of 'watchmessagefifo':   78893 pts/21   00:00:00 bash
x11docker note: Option --xc for X in container enabled automatically.

Traceback (most recent call last):
  File "<stdin>", line 42, in <module>
  File "<stdin>", line 19, in parse_inspect
IndexError: string index out of range
x11docker WARNING: parse_inspect(): Error while parsing json for
  Config Labels options   (Line 2934)

Traceback (most recent call last):
  File "<stdin>", line 42, in <module>
  File "<stdin>", line 19, in parse_inspect
IndexError: string index out of range
x11docker WARNING: parse_inspect(): Error while parsing json for
  Config Labels options_console   (Line 2936)

Traceback (most recent call last):
  File "<stdin>", line 42, in <module>
  File "<stdin>", line 19, in parse_inspect
IndexError: string index out of range
x11docker WARNING: parse_inspect(): Error while parsing json for
  Config Labels tools   (Line 2937)

DEBUGNOTE[20:00:17,020]: storeinfo(): xserver=--tty

x11docker ERROR: create_xcontainercommand(): Unknown X server option --tty

  Type 'x11docker --help' for usage information
  Debug options: '--verbose' (full log) or '--debug' (log excerpt).
  Logfile will be: /home/user/.cache/x11docker/x11docker.log
  Please report issues at https://github.com/mviereck/x11docker

DEBUGNOTE[20:00:17,107]: time to say goodbye (error)
DEBUGNOTE[20:00:17,115]: storeinfo(): error=64
DEBUGNOTE[20:00:17,127]: Terminating x11docker.
DEBUGNOTE[20:00:17,132]: time to say goodbye (finish)
DEBUGNOTE[20:00:17,169]: finish(): Checking pid 78893 (watchmessagefifo):   78893 pts/21   00:00:00 bash
DEBUGNOTE[20:00:17,204]: finish(): Checking pid 78883 (watchpidlist):   78883 pts/21   00:00:00 bash
DEBUGNOTE[20:00:17,228]: termpid(): Terminating 78883 (watchpidlist):   78883 pts/21   00:00:00 bash
DEBUGNOTE[20:00:17,377]: termpid(): Terminating 78893 (watchmessagefifo):   78893 pts/21   00:00:00 bash
DEBUGNOTE[20:00:17,456]: waitforlogentry(): tailstdout: Stopped waiting for x11docker=ready in store.info due to terminating signal.
DEBUGNOTE[20:00:17,456]: waitforlogentry(): tailstderr: Stopped waiting for x11docker=ready in store.info due to terminating signal.
DEBUGNOTE[20:00:17,500]: x11docker exit code: 64
mviereck commented 2 years ago

Thank you for the bug report! I could reproduce the issue and have fixed it in current master/beta. You can get it with x11docker --update-master.

x11docker started a container of x11docker/xserver, but it did not know --tty because it obviously is not an X server. :-) Now x11docker does not use x11docker/xserver in case of --tty .

adworacz commented 2 years ago

Awesome, thanks for the quick fix! I'll test it out in the next few days. :)

adworacz commented 2 years ago

Works like a charm, thank you!

Closing this as resolved.