remote use of app from flatpak, cannot open display

Alexander Larsson alexl at redhat.com
Tue Dec 10 08:13:12 UTC 2019


On Tue, Dec 10, 2019 at 12:54 AM Dan Hitt <dan.hitt at gmail.com> wrote:
>
> I installed flatpak on a guest vm (ubuntu 19.10) running on my regular system (debian 10).
>
> I installed gimp on the guest by
>    flatpak install flathub org.gimp.GIMP
>
> On the guest, i can run gimp by
>    flatpak run org.gimp.GIMP
>
> But, if i am on the host, and 'ssh -X' to the guest, when i try to run gimp, i get the error 'Cannot open display:'
>
> Note that i can run another program, xterm, from the guest with the display on the host.  Also, i can run gimp remotely from another (real) box (but not using flatpak).
>
> So i suspect that 'flatpak run' is somehow concealing something from gimp.
>
> Would appreciate any advice on how to get this path (running gimp through flatpak on a vm making its display on the host) working.

Flatpak normally redirects to a different X display (DISPLAY=:99) and
only forwards the unix domain socket for it (/tmp/.X11-unix/X99),
because this way it can work when the app doesn't have network access.
This will not work for network X access, because we're not also
forwarding the required tcp port.

There is no great way to override this behavior, but something like
this should work:

  flatpak run --command=bash org.gnome.eog -c "DISPLAY=$DISPLAY gimp"

Assuming gimp has network access. If not you need to also add --share=network.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                Red Hat, Inc
       alexl at redhat.com         alexander.larsson at gmail.com



More information about the Flatpak mailing list