remote use of app from flatpak, cannot open display

Dan Hitt dan.hitt at gmail.com
Tue Dec 10 17:33:05 UTC 2019


On Tue, Dec 10, 2019 at 12:13 AM Alexander Larsson <alexl at redhat.com> wrote:

> 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"
>

Thanks Alexander!

This works, with a little alteration.

The command i have to use actually is
      flatpak run --command=bash org.gimp.GIMP -c "DISPLAY=$DISPLAY gimp"

I'm assuming that that is just a simple slip of the pen in your reply (my
flatpak does not
know about org.gnome.eog, which is, i suppose the flatpakized version of
eog that you
must have tested with).

Second, if i run this command directly from an 'ssh -X' session started in
an emacs
inferior shell, although it puts up a gimp window, the window locks.
However, if a first start an xterm from
the 'ssh -X' session in the emacs shell, then it does work and the gimp
window does not lock.
This may be a transient problem and i don't care, as the main thing i
wanted to do was run
the latest gimp in the window system of my host without doing major surgery.

Thanks a lot.  I appreciate your help, and i see a lot of value in flatpak.

dan


>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/flatpak/attachments/20191210/1296d03e/attachment.htm>


More information about the Flatpak mailing list