io.github.luca.distrobox icon indicating copy to clipboard operation
io.github.luca.distrobox copied to clipboard

Access to X11

Open negatethis opened this issue 3 years ago • 3 comments

Distro: Fedora Kinoite 37 Beta Flatpak Version: Sept. 7, 2022 Windowing system: Wayland

I was using distrobox to run neovim from a container with R installed, and was using the Nvim-R plugin. One of its features is opening a window with X11 so you can see visualizations, such as plots or graphs. I switched to using the Flatpak version of distrobox, and noticed that these plots no longer open a window. I'm fairly certain it's because the Flatpak does not have permissions to use the X11 windowing socket. I enabled socket=x11, socket=wayland, and socket=fallback-x11 for the distrobox Flatpak using Flatseal, but even then no windows would open. I tried again, but passed the DISPLAY variable to the container, but still, nothing. What would be the proper way of giving containers access to the X11 socket?

negatethis avatar Oct 19 '22 17:10 negatethis

@negatethis Not sure if this is related to flatpak or distrobox What errors do you get?

89luca89 avatar Oct 19 '22 18:10 89luca89

When I use distrobox installed through a package manager, I can plot something in R and Nvim-R will take care of displaying the plot using X11 and it works fine. The window appears with my visualization.

When using the distrobox Flatpak, if I pass DISPLAY=:1 to my container and try to plot something in R, I get the error:

Error in .External2(C_X11, d$display, d$width, d$height, d$pointsize,  :
  unable to start device X11cairo
In addition: Warning message:                                      
In (function (display = "", width, height, pointsize, gamma, bg,  :
  unable to open connection to X11 display ''

I think the distrobox Flatpak does not have sufficient permissions to open an X11 connection. I tried opening a different GUI app in a separate container to see if it also throws an error, and sure enough I get:

Godot Engine v3.4.4.stable.official.419e713a2 - https://godotengine.org
Authorization required, but no authorization protocol specified
ERROR: X11 Display is not available
   at: initialize (platform/x11/os_x11.cpp:127)

An error occurred

But the same app can open just fine when using distrobox from my package manager.

negatethis avatar Oct 19 '22 20:10 negatethis

Thanks @negatethis Will try to reproduce this, right now the flatpak package is really experimental so this type of stuff can happen

89luca89 avatar Oct 26 '22 08:10 89luca89