containers / toolbox

Tool for interactive command line environments on Linux
https://containertoolbx.org/
Apache License 2.0
2.47k stars 210 forks source link

SSH X11 forwarding not working in toolbox. #1343

Open PaulJohnson opened 1 year ago

PaulJohnson commented 1 year ago

Describe the bug I have a Silverblue machine I want to access via SSH and start X11 applications on for local display.

X11 forwarding works fine in the main shell, but when I toolbox enter it doesn't work.

Steps how to reproduce the behaviour

  1. Log in via SSH to a Sliverblue machine with X11 forwarding enabled.
  2. Run firefox. Observe that the Firefox window appears on the local machine.
  3. Do toolbox enter
  4. sudo dnf install firefox (to get it installed in the toolbox)
  5. Run firefox.
  6. Get PuTTY X11 proxy: Unsupported authorisation protocol Error: cannot open display: localhost:10.0

Expected behaviour firefox and other X11 applications should work inside the toolbox in the same way that the work outside.

Actual behaviour PuTTY X11 proxy: Unsupported authorisation protocol Error: cannot open display: localhost:10.0

Output of toolbox --version (v0.0.90+) toolbox version 0.0.99.4

Toolbox package info (rpm -q toolbox) toolbox-0.0.99.4-1.fc38.x86_64

Output of podman version e.g.,

Client:       Podman Engine
Version:      4.5.1
API Version:  4.5.1
Go Version:   go1.20.4
Built:        Fri May 26 18:58:48 2023
OS/Arch:      linux/amd64

Podman package info (rpm -q podman) podman-4.5.1-1.fc38.x86_64

Info about your OS Fedora Silverblue 38

Additional context Might be related to https://github.com/containers/toolbox/issues/1290

PaulJohnson commented 1 year ago

Finally figured it out. The problem is that the hostname changes in the toolbox, so it can't find the right xauth magic cookie.

Two workarounds:

  1. Use xauth list to get the current cookies, and then create a clone entry for a machine called toolbox.
  2. sudo hostname <actual host> inside the toolbox.
mpetuska commented 9 months ago

I'm experiencing the same issue, would be nice to have it resolved or at least have some permanent workaround/script to patch it.