-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems running on Ubuntu with apparmor / restricted unprivileged userns #1508
Comments
I wanted to dump the above from my head, and would have put a PR up with the content, but didn't know where it should go. Thanks @murraybd for pushing on this a bit. |
I never restarted apparmor rather I used |
updated. thank you. |
AppArmor can't be reloaded so the service helper scripts run restart. Or at least they do on Debian. If you're using systemd it should be restart. If you're using the helper scripts reload will restart. |
…pace. Users of melange on ubuntu will have issues on their first attempt to use melange as a result of 24.04 changes to availability of user namespaces. Before this change is applied, an attempt to 'make package/foo' in wolfi-dev/os would result in error messages like this: bwrap: setting up uid map: Permission denied ERROR: failed to build package. the build environment has been preserved: workspace dir: /tmp/melange-workspace-4104388352 guest dir: /tmp/melange-guest-1722197694 failed to build package: unable to start pod: exit status 1 It doesn't give the user much info on how to fix. This change turns that failure to look like: ERRO failed to build package: unable to start pod: Unable to execute 'bwrap --unshare-user true'. Command failed with: bwrap: setting up uid map: Permission denied See chainguard-dev#1508 for fix See chainguard-dev#1508 Signed-off-by: Scott Moser <[email protected]>
…pace. Users of melange on ubuntu will have issues on their first attempt to use melange as a result of 24.04 changes to availability of user namespaces. Before this change is applied, an attempt to 'make package/foo' in wolfi-dev/os would result in error messages like this: bwrap: setting up uid map: Permission denied ERROR: failed to build package. the build environment has been preserved: workspace dir: /tmp/melange-workspace-4104388352 guest dir: /tmp/melange-guest-1722197694 failed to build package: unable to start pod: exit status 1 It doesn't give the user much info on how to fix. This change turns that failure to look like: ERRO failed to build package: unable to start pod: Unable to execute 'bwrap --unshare-user true'. Command failed with: bwrap: setting up uid map: Permission denied See chainguard-dev#1508 for fix See chainguard-dev#1508 Signed-off-by: Scott Moser <[email protected]>
…pace. Users of melange on ubuntu will have issues on their first attempt to use melange as a result of 24.04 changes to availability of user namespaces. See chainguard-dev#1508 for more information. Before this change is applied, an attempt to 'make package/foo' in wolfi-dev/os would result in error messages like this: bwrap: setting up uid map: Permission denied ERROR: failed to build package. the build environment has been preserved: workspace dir: /tmp/melange-workspace-4104388352 guest dir: /tmp/melange-guest-1722197694 failed to build package: unable to start pod: exit status 1 It doesn't give the user much info on how to fix. This change turns that failure to look like: ERRO failed to build package: unable to start pod: Unable to execute 'bwrap --unshare-user true'. Command failed with: bwrap: setting up uid map: Permission denied See chainguard-dev#1508 for fix Signed-off-by: Scott Moser <[email protected]>
Problem
Running melange for the first time on a Ubuntu system will often fail.
There are a couple hangups.
need to install bubblewrap (
apt-get install bubblewrap
). This actually gives a pretty good error:Current ubuntu systems require application specific configs in order to use unprivileged user namespaces
The failure path in wolfi-dev/os looks like this:
The unprivileged user namespace path is a bit of a rathole. Here is some reading if you're interested:
How to fix
There are at least the following options to fix
disable the apparmor userns restrictions
Add
kernel.apparmor_restrict_unprivileged_userns = 0
to a file in/etc/sysctl.d/60-apparmor-namespace.conf
(per apparmor doc)Allow bubblewrap to use unprivileged user namespaces independent of who calls it.
Create the file
/etc/apparmor.d/local-bwrap
with content like below:Then run
sudo systemctl reload apparmor
Allow melange to use unprivileged user namespaces.
Create the file
/etc/apparmor.d/local-melange
with content like below (update '/path/to/your/home/...')Then run
sudo systemctl reload apparmor
The text was updated successfully, but these errors were encountered: