Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
1
answers
545
views
Singularity on RHEL-8: failed to connect to dbus
I am using Singularity on RHEL-8. I just upgraded to cgroupsv2 so that I could throttle resource usage. I also delegate CPU controller permissions in my `/etc/systemd/system/user@.service.d/override.conf` as described [here](https://github.com/systemd/systemd/issues/18293). So far, so good. So I try...
I am using Singularity on RHEL-8. I just upgraded to cgroupsv2 so that I could throttle resource usage. I also delegate CPU controller permissions in my
/etc/systemd/system/user@.service.d/override.conf
as described [here](https://github.com/systemd/systemd/issues/18293) .
So far, so good. So I try to run: singularity run --cpus 0.8 container.sif
.
I get the following error (some of the random strings randomized and shortened):
> FATAL: container creation failed: while applying cgroups config: while creating cgroup manager: failed to connect to dbus (hint: for rootless containers, maybe you need to install dbus-user-session package, see https://github.com/opencontainers/runc/blob/master/docs/cgroup-v2.md) : could not execute busctl --user --no-pager status
(output: "Failed to get credentials: No such process\nBusAddress=unix:abstract=/tmp/dbus-4843,guid=35345\nBusScope=user\nBusID=343345\n"): exit status 1
Indeed, if I try busctl --user status
, I get a connection refused error.
There are some related questions like [this one](https://superuser.com/questions/1561076/systemctl-user-failed-to-connect-to-bus-no-such-file-or-directory-debian-9) and [this one](https://unix.stackexchange.com/questions/615917/failed-to-get-d-bus-connection-connection-refused) , but my dbus session seems to be running fine, and I am not trying to run this as root. What gives?
cag51
(101 rep)
Jun 14, 2024, 08:51 PM
• Last activity: May 25, 2025, 08:26 AM
3
votes
1
answers
702
views
how to pass environment variables to singularity exec
I have a `BASH` pipeline which at a point runs a `Singularity` container with *singularity exec* as follows: ``` singularity exec --bind `pwd`:/folder --bind $d:/results .sif -i /folder/ .fastq -v /results/ / .vcf -r /folder/ .fna -s -j 24 -t 24 -o /results/ ``` Since I'm running multiple experiment...
I have a
BASH
pipeline which at a point runs a Singularity
container with *singularity exec* as follows:
singularity exec --bind pwd
:/folder --bind $d:/results .sif -i /folder/.fastq -v /results//.vcf -r /folder/.fna -s -j 24 -t 24 -o /results/
Since I'm running multiple experiments at once with an array, I'm redefining the experiments with an environment variable that I wish to add to the `; it works for all the steps of the pipeline but
Singularity` seems it's unable to *see* the variable(s) I'm defining in my script...
Does anyone have any advice on how to do so? I looked up a bit but the --env
does not seem to be working. Thanks in advance!
Matteo
(209 rep)
Apr 13, 2025, 12:51 PM
• Last activity: Apr 13, 2025, 06:48 PM
0
votes
0
answers
74
views
How to make /.singularity.d/libs/libfakeroot.so visible to fakeroot also visible to normal user?
I am building a Singularity container using Apptainer. I installed package `libfakeroot` using command `apt install -y libfakeroot` in the definition file in hope that `/.singularity.d/libs/libfakeroot.so` could be seen by normal user. But because the user is (fake) root when the package `libfakeroo...
I am building a Singularity container using Apptainer. I installed package
libfakeroot
using command apt install -y libfakeroot
in the definition file in hope that /.singularity.d/libs/libfakeroot.so
could be seen by normal user. But because the user is (fake) root when the package libfakeroot
is installed, this file is only visible when I shell into the container as a fake root user (shell --fakeroot
). If I shell into the container as a normal user (without --fakeroot
), the directory /.singularity.d/libs/
is empty. Is there any way to make /.singularity.d/libs/libfakeroot.so
visible to fakeroot also visible to a normal user? Thank you.
Environment:
- Host OS: RedHat 8.8
- Guest OS: Ubuntu 22.04
- Apptainer version: 1.2.5
zzzhhh
(95 rep)
Nov 10, 2024, 07:24 AM
0
votes
0
answers
44
views
Singularity sandbox on NAS
We have several machines that we want to run the same Singularity container on. As we already have a NAS mounted by every machine, we thought this would be a good place to store it without the need to think about distribution. Initially, we put a read-only container to test it, which was successful....
We have several machines that we want to run the same Singularity container on. As we already have a NAS mounted by every machine, we thought this would be a good place to store it without the need to think about distribution.
Initially, we put a read-only container to test it, which was successful. We then needed to install additional system packages inside the container. Thus, we build a new sandbox container directly on the NAS (we have root permission on the NAS). However, we were not able to install packages in the sandbox (the singularity shell was started with the write flag
-w
and root permissions) and got the following error. E.g., from starting update
inside the sandbox:
error: cannot get shared lock on /var/lib/rpm/Packages
error: cannot open Packages index using db5 - Operation not permitted (1)
error: cannot open Packages database in /var/lib/rpm
Error: Error: rpmdb open failed
When we build the sandbox container locally on one of the machines and access it, we can install software through the package manager.
To setup we do these commands. The first builds the sandbox from the library of images. In this case AlmaLinux 8 (we also tried it with CentOS 7, but it has the same problem). Then we enter the sandbox in shell mode to install packages.
singularity build --sandbox al8.6-sandbox library://library/default/almalinux:8
singularity shell -w -B /mnt:/mnt al8.6-sandbox
What can be the cause for the error on the NAS?
Simon T.
(31 rep)
Jan 29, 2024, 10:10 AM
• Last activity: Jan 30, 2024, 03:53 PM
0
votes
1
answers
366
views
Singularity build failure due to groupadd for openssh-client installation
In Singularity when building under fake-root anything Ubuntu based with in `%post` either `apt update -y` or `apt install -y openssh-client` or their `apt-get` versions or with `-f` in the definition file fails fatally with groupadd: failure while writing changes to /etc/group addgroup: `/sbin/group...
In Singularity when building under fake-root anything Ubuntu based with in
%post
either apt update -y
or apt install -y openssh-client
or their apt-get
versions or with -f
in the definition file fails fatally with
groupadd: failure while writing changes to /etc/group
addgroup: `/sbin/groupadd -g 101 ssh' returned error code 10. Exiting.
Errors were encountered while processing: openssh-client E: Sub-process /usr/bin/dpkg returned an error code (1)
FATAL: While performing build: while running engine: exit status 100
I see why adding a user is an issue, but yum update
works fine in Rocky 9 (I cannot switch to it due to some requirements). This is on a cluster where I do NOT have root priviledges and have to use Singularity and docker isn't available —the base OS is CentOS 7 and glibc issues are insurmountable.
I have tried a bunch of different Ubuntu images, ranging from Nvidia's Docker Ubuntu image and officially signed to unsigned Singularity images.
Conda can install ssh, but the issue is apt update
fails and I cannot work around it.
I feel like I missing something obvious based on the lack of much on this online...
Matteo Ferla
(101 rep)
Aug 23, 2023, 07:55 AM
• Last activity: Dec 7, 2023, 10:09 PM
3
votes
0
answers
111
views
How to grant group access to a singularity instance
I constructed a singularity/apptainer sif container and I can now start an instance of this container. Is there a way to grant other users (in a group) the right to run the instance ? In short, How can I makes things such that any user in the group users is able to do `singularity run instance:\\myi...
I constructed a singularity/apptainer sif container and I can now start an instance of this container. Is there a way to grant other users (in a group) the right to run the instance ?
In short, How can I makes things such that any user in the group users is able to do
singularity run instance:\\myinstance
TMat
(131 rep)
Sep 17, 2022, 03:38 PM
Showing page 1 of 6 total questions