<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 10, 2019 at 12:13 AM Alexander Larsson <<a href="mailto:alexl@redhat.com">alexl@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Dec 10, 2019 at 12:54 AM Dan Hitt <<a href="mailto:dan.hitt@gmail.com" target="_blank">dan.hitt@gmail.com</a>> wrote:<br>
><br>
> I installed flatpak on a guest vm (ubuntu 19.10) running on my regular system (debian 10).<br>
><br>
> I installed gimp on the guest by<br>
>    flatpak install flathub org.gimp.GIMP<br>
><br>
> On the guest, i can run gimp by<br>
>    flatpak run org.gimp.GIMP<br>
><br>
> 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:'<br>
><br>
> 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).<br>
><br>
> So i suspect that 'flatpak run' is somehow concealing something from gimp.<br>
><br>
> Would appreciate any advice on how to get this path (running gimp through flatpak on a vm making its display on the host) working.<br>
<br>
Flatpak normally redirects to a different X display (DISPLAY=:99) and<br>
only forwards the unix domain socket for it (/tmp/.X11-unix/X99),<br>
because this way it can work when the app doesn't have network access.<br>
This will not work for network X access, because we're not also<br>
forwarding the required tcp port.<br>
<br>
There is no great way to override this behavior, but something like<br>
this should work:<br>
<br>
  flatpak run --command=bash org.gnome.eog -c "DISPLAY=$DISPLAY gimp"<br></blockquote><div><br></div><div>Thanks Alexander!</div><div><br></div><div>This works, with a little alteration.</div><div><br></div><div>The command i have to use actually is</div><div>      flatpak run --command=bash org.gimp.GIMP -c "DISPLAY=$DISPLAY gimp"</div><div><br></div><div>I'm assuming that that is just a simple slip of the pen in your reply (my flatpak does not</div><div>know about org.gnome.eog, which is, i suppose the flatpakized version of eog that you</div><div>must have tested with).</div><div><br></div><div>Second, if i run this command directly from an 'ssh -X' session started in an emacs <br></div><div>inferior shell, although it puts up a gimp window, the window locks.  However, if a first start an xterm from</div><div>the 'ssh -X' session in the emacs shell, then it does work and the gimp window does not lock.</div><div>This may be a transient problem and i don't care, as the main thing i wanted to do was run</div><div>the latest gimp in the window system of my host without doing major surgery.</div><div><br></div><div>Thanks a lot.  I appreciate your help, and i see a lot of value in flatpak.</div><div><br></div><div>dan<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Assuming gimp has network access. If not you need to also add --share=network.<br>
<br>
-- <br>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br>
 Alexander Larsson                                Red Hat, Inc<br>
       <a href="mailto:alexl@redhat.com" target="_blank">alexl@redhat.com</a>         <a href="mailto:alexander.larsson@gmail.com" target="_blank">alexander.larsson@gmail.com</a><br>
<br>
</blockquote></div></div>