89luca89 / distrobox

Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
https://distrobox.it/
GNU General Public License v3.0
10.07k stars 416 forks source link

[Help] Howto resolve dbus error when running RStudio in containerized Debian ... #668

Closed btreut closed 1 year ago

btreut commented 1 year ago

I am trying to get RStudio running in the OStree/flatpak based distribution EndlessOS, finnaly arrived at a solution based on podman (see post). With a newer version of EndlessOS, podman was upgraded and I restarted experimenting this time with distrobox. I successfully set up a Debian bullseye (11.6) container and installed RStudio within the container ignoring the following messages I got during startup of Rstudio:

[1953:0322/124855.414678:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1953:0322/124855.415027:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1987:0322/124856.211165:ERROR:gpu_init.cc(481)] Passthrough is not supported, GL is desktop, ANGLE is

since RStudion did run without apparent problems. But after installation of several RStudio extensions (and some deb packages, which were required for installation of these extensions) for learning R (shiny,curl,libcurl,learnr) I encountered during installation of tidyverse the following error within RStudio:

System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Warning in system("timedatectl", intern = TRUE) :
  running command 'timedatectl' had status 1
** testing if installed package can be loaded from final location
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Warning in system("timedatectl", intern = TRUE) :
  running command 'timedatectl' had status 1

Reading a bit in Podman in Action about systemd integration, I fear that setting this up correctly is beyond my knowledge, so I am asking here for help.

Additional Information: podman version 3.0.1 (it is afaik tightly integrated in Endless OS 5.0.1) distrobox version 1.4.2.1

btreut commented 1 year ago

Does it make sense to re-create the box with --init?

btreut commented 1 year ago

Does it make sense to re-create the Debian box with the --init option?

89luca89 commented 1 year ago

Hi @bsvh You can try doing an init distrobox But be aware, only opensuse and the other distros with "-init" in their image name will work, no Debian with init support is there

btreut commented 1 year ago

@89luca89 thanks for

"-init" in their image name will work, no Debian with init support is there

before switching to a completely other distro, I started investigating the situation a bit and found that entering the Debian box and issuing a pstree -p reveals a systemd process with pid 1 exactly the same as the one found on the host (pstree-distrobox-debian.txt, pstree-eos.txt). So I am puzzled: why does RStudio complain and why is it unable to communicate with pid 1? More info about my system (including process list under heading .= Processes = can be found in the eos-diagnostic-230326_163444_UTC 0200.txt file linked in my post on the EndlessOS community platform.

btreut commented 1 year ago

ok, maybe the systemd init in the box is a dead end. I started digging a bit more and found the following:

in the box: there is no /run/dbus/system_bus_socket, but this socket is available in the host environment.

What is the best way to allow access in the box to the socket /run/dbus/system_bus_socket?

secretmango commented 1 year ago

So you have systemd running on your host?

What command did you use for creating the box?

I personally never got these problems, but I am on Fedora Kinoite with systemd and use various distroboxes created just as is.

btreut commented 1 year ago

So you have systemd running on your host?

absolutely correct

What command did you use for creating the box?

distrobox create --image debian:latest --name debian

and @89luca89 does not recommend to add a -I if the image is not prepared for that.

btreut commented 1 year ago

What is the best way to allow access in the box to the socket /run/dbus/system_bus_socket?

Found this post on stackoverflow, does this provide a solution? And: how can I specify the -v/--volume option for the podman command in the distrobox-enter command?

btreut commented 1 year ago

Very strange: I followed the instructions of @firefoxlover given in this post and there are no problems with communication with systemd under Fedora.

So this might be an issue with the Debian image, therefore I close this issue here.

secretmango commented 1 year ago

.

yes the images sometimes have weird problems, I once had Ubuntu without apt

I also would use the newest image possible e.g. not Debian. Fedora with the COPR for the modules should work, but I dont know how other distributions handle that