Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Overlay arguments on DM-Verity / with overlayfs results in userxattr: Invalid argument

Open
#702 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, linux

Research direction

Reproduce the supplied bwrap command with the two --overlay-src paths and compare it with the working manual overlay mount. Start by investigating bubblewrap’s overlay handling and the reported userxattr: Invalid argument on the DM-Verity/overlayfs setup. Done means determining whether the requested merge can work in bwrap and documenting or implementing a supported path.

Written by the indexing model from the issue text.

Description

/bin/bwrap \
  --unshare-pid \
  --unshare-uts \
  --unshare-cgroup \
  --unshare-user \
  --new-session \
  --ro-bind-try /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-bundle.crt \
  --ro-bind-try /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt \
  --ro-bind-try /etc/resolv.conf /etc/resolv.conf \
  --ro-bind-try /etc/hosts /etc/hosts \
  --ro-bind-try /etc/ld.so.preload /etc/ld.so.preload \
  --ro-bind-try /etc/ld.so.conf /etc/ld.so.conf \
  --ro-bind-try /etc/ld.so.cache /etc/ld.so.cache \
  --ro-bind-try /etc/ld.so.conf.d /etc/ld.so.conf.d \
  --ro-bind-try /etc/fonts /etc/fonts \
  --ro-bind-try /etc/passwd /etc/passwd \
  --ro-bind-try /etc/locale.conf /etc/locale.conf \
  --ro-bind-try /lib64 /lib64 \
  --ro-bind-try /lib /lib \
  --ro-bind-try /proc /proc \
  --ro-bind-try /dev /dev \
  --dev /dev \
  --proc /proc \
  --bind-try /home/user/.var/app/signal-desktop/tmp /tmp \
  --tmpfs /run \
  --dir /run/user/1000 \
  --setenv WAYLAND_DISPLAY wayland-1 \
  --setenv XDG_SESSION_TYPE wayland \
  --ro-bind-try /run/user/1000/wayland-1 /run/user/1000/wayland-1 \
  --ro-bind-try /run/user/1000/pulse /run/user/1000/pulse \
  --ro-bind-try /run/user/1000/pipewire-0 /run/user/1000/pipewire-0 \
  --ro-bind-try /sys /sys \
  --ro-bind-try /run/user/1000/keyring /run/user/1000/keyring \
  --bind-try /home/user/.var/app/signal-desktop/home /home/user \
  --setenv GTK_THEME Adwaita:dark \
  --bind-try /home/user/.config/mimeapps.list /home/user/.config/mimeapps.list \
  --setenv XDG_DATA_DIRS /var/lib/pharaoh/export/:/usr/local/share/:/usr/share/ \
  --ro-bind-try /run/user/1000/xdg-dbus-proxy/org.Pharaoh.signal-desktop-4cqlVvmT.sock /run/user/1000/bus \
  --ro-bind-try /var/lib/dbus/machine-id /var/lib/dbus/machine-id \
  --ro-bind-try /etc/machine-id /etc/machine-id \
  --setenv DBUS_SESSION_BUS_ADDRESS unix:path=/run/user/1000/bus \
  --ro-bind-try /persist/pharaoh/app/signal-desktop /persist/pharaoh/app/signal-desktop \
  --overlay-src /usr/lib \
  --overlay-src /persist/pharaoh/app//signal-desktop//usr/lib \
  --ro-overlay /usr/lib \
  --overlay-src /usr/bin \
  --overlay-src /persist/pharaoh/app//signal-desktop//usr/bin \
  --ro-overlay /usr/bin \
  --overlay-src /usr/share \
  --overlay-src /persist/pharaoh/app//signal-desktop//usr/share \
  --ro-overlay /usr/share \
  --symlink /usr/bin /bin \
  /persist/pharaoh/app/signal-desktop/usr/bin/signal-desktop

Hello! So this bwrap command is part of my package manager and works on most systems, however I am integrating it into my OS which has a DM verity / and overlayfs on for example /usr/lib/systemd. Now I suspect the issue lies with the overlayfs since I have no errors with just /usr/share (theres no overlayfs there) But when I run this command I get:

bwrap: Can't make overlay mount on /newroot/usr/lib with options lowerdir=/oldroot/persist/pharaoh/app/signal-desktop/usr/lib:/oldroot/usr/lib,userxattr: Invalid argument

To not rule out an alternative, I will also provide the end goal: I want to merge /persist/pharaoh/app//signal-desktop//usr/lib and /usr/lib into a single /usr/lib on the bubblewrap sandbox. The specific issue is with these arguments:

  --overlay-src /usr/lib \
  --overlay-src /persist/pharaoh/app//signal-desktop//usr/lib \
  --ro-overlay /usr/lib \

Now when I manually create an overlay it does seem to work correctly.

mount -t overlay overlay   -o lowerdir=/usr/lib:/persist/pharaoh/app/signal-desktop/usr/lib,upperdir=/tmp/upper,workdir=/tmp/work   /tmp/merged

I don't think It's helpful but this is my partition setup:

NAME     MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
sr0       11:0    1  1.4G  0 rom   
vda      254:0    0   30G  0 disk  
├─vda1   254:1    0  500M  0 part  /boot
├─vda2   254:2    0   10G  0 part  
│ └─root 253:0    0   10G  1 crypt /  <------------ DM VERITY
├─vda3   254:3    0  500M  0 part  
│ └─root 253:0    0   10G  1 crypt /   <--------- DM VERITY HASH DEVICE
├─vda4   254:4    0 10.3G  0 part  /persist <-------- READ WRITE FOR OVERLAYFS
└─vda5   254:5    0  8.8G  0 part  /home <--------- READ WRITE FOR USER

Is there any way to make bwrap work with this setup? I know I can do some really hacky stuff with LD_LIBRARY_PATH but then I have to iterate over all of the files in /usr/lib and add them to the bwrap command, put them in /usr/lib/host and make another directory in /usr/lib/signal for example, and then use LD_LIBRARY_PATH to specify both these directories, plus their sub directories (its not recursive :P)

Any help is strongly appreciated!

Dominant language
C
Stars
8.8k
Forks
387
Avg merge
2d 22h
Merged PRs (30d)
15

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from containers/bubblewrap

All issues in containers/bubblewrap

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.