PkgForge
GithubSoar
  • Orgs
    • PkgForge (Core)
      • About
      • Projects
        • Soarpkgs
        • bincache
        • pkgcache
      • People
    • PkgForge-Community
    • PkgForge-Dev
      • Projects
        • Anylinux-AppImages
      • People
    • PkgForge-Security
      • Projects
        • CertStream
  • Soar
    • Soar (Docs)
    • Comparisons
      • 1. Candidates
      • 2. Dependencies
      • 3. Packages
      • 4. Security
  • Formats
    • Binaries
      • Dynamic
      • Static
        • Build Notes
          • Cargo (Rust)
          • GoLang
          • Make
          • Nim
          • Nix
          • Vlang
          • Zig (Musl)
        • Build Tests
    • Packages
      • Archive
      • AppBundle
      • AppImage
      • FlatImage
      • GameImage (TBD)
      • NixAppImage
      • RunImage
      • Errors & Quirks
        • Fonts
        • Fuse
        • Namespaces
        • Zsync
  • SBUILD
    • Introduction
    • Specification
      • 0.Prerequisite
      • 1.Shebang
      • 2.Pkg
      • 3.Version
      • 4.AppID
      • 5.BuildAsset
      • 6.BuildUtil
      • 7.Category
      • 8.Description
      • 9.Desktop
      • 10.DistroPkg
      • 11.HomePage
      • 12.Icon
      • 13.License
      • 14.Maintainer
      • 15.Note
      • 16.Provides
      • 17.Repology
      • 18.SourceURL
      • 19.Tag
      • 20.x_exec
    • Instructions
      • ENV_VARS (x_exec.run)
      • ENV_VARS (SBUILDER)
      • NEEDED_FILES
      • Examples
  • Repositories
    • soarpkgs
      • Contribution
      • Copy of DMCA | Copyright (Cease & Desist)
      • Differences
      • FAQ
      • Infra
      • Metadata
      • Package-Request
      • Security
    • bincache
      • Cache
      • Contribution
      • Differences
      • DMCA | Copyright (Cease & Desist)
      • FAQ
      • Infra
      • Metadata
      • Package-Request
      • Security
    • pkgcache
      • Cache
      • Contribution
      • Differences
      • DMCA | Copyright (Cease & Desist)
      • FAQ
      • Infra
      • Metadata
      • Package-Request
      • Security
    • external
      • AM
      • cargo-bins
      • appimage.github.io
      • AppImageHub
    • Nests
  • Contact
    • Chat
Powered by GitBook
On this page
  • Check
  • Errors & Solutions
  • Examples

Was this helpful?

  1. Formats
  2. Packages
  3. Errors & Quirks

Namespaces

User Namespace & Related

PreviousFuseNextZsync

Last updated 4 months ago

Was this helpful?

To better understand why the warnings & why the solutions, it is recommended to read:


Check

!#Check if it's enabled at Kernel Level
sysctl -n user.max_user_namespaces
#This will print a number
#if it doesn't or it's user.max_user_namespaces = 0, then it's disabled

!#Check if it's enabled/restricted Using unshare : https://man7.org/linux/man-pages/man1/unshare.1.html
unshare --user echo "Username namespaces supported"
#If Suporrted: Username namespaces supported
#If Not: unshare: unshare(0x10000000): Operation not permitted

!#Check if AppArmor|SeLinux is stopping us 
sudo dmesg | grep -E '(selinux|apparmor|security)'
#Look for lines containing words like denied, disallowing etc

Errors & Solutions

[WARN] Your kernel does not support user namespaces

!#Because /proc/self/ns/user on your System, doesn't exist
1. You need to install SUID Bubblewrap into the system
#For RunImage, this solution will work, but for others, refer to others.
# wget "https://bin.pkgforge.dev/$(uname -m)/bwrap" -O "/tmp/bwrap"
# sudo cp -f "/tmp/bwrap" "/usr/bin/bwrap" && sudo chmod u+s "/usr/bin/bwrap"

2. You need to run some Packages (that require usernamespace) as ROOT [NOT RECOMMENDED & DANGEROUS]

3. Install a Kernel with user namespaces support like XanMod kernel -> https://xanmod.org

[WARN] You mustEnableunprivileged_userns_clone

!#Because /proc/sys/kernel/unprivileged_userns_clone == 0
❯ Enable unprivileged_userns_clone
echo "kernel.unprivileged_userns_clone=1" | sudo tee "/etc/sysctl.d/98-unprivileged-userns-clone.conf"
echo "1" | sudo tee "/proc/sys/kernel/unprivileged_userns_clone"
sudo service procps restart
sudo sysctl -p "/etc/sysctl.conf"
#Reboot

[WARN] You mustEnablemax_user_namespaces

!#Because /proc/sys/user/max_user_namespaces == 0
❯ Enable max_user_namespaces
echo "user.max_user_namespaces=10000" | sudo tee "/etc/sysctl.d/98-max-user-namespaces.conf"
echo "100000" | sudo tee "/proc/sys/user/max_user_namespaces"
sudo service procps restart
sudo sysctl -p "/etc/sysctl.conf"
#Reboot

[WARN] You mustDisableuserns_restrict

!#Because /proc/sys/kernel/userns_restrict == 1
❯ Disable userns_restrict
echo "kernel.userns_restrict=0" | sudo tee "/etc/sysctl.d/98-userns.conf"
echo "0" | sudo tee "/proc/sys/kernel/userns_restrict"
sudo service procps restart
sudo sysctl -p "/etc/sysctl.conf"
#Reboot

[WARN] You mustDisableapparmor_restrict_unprivileged_userns

!#Because /proc/sys/kernel/apparmor_restrict_unprivileged_userns == 1
❯ Disable apparmor_restrict_unprivileged_userns
echo "kernel.apparmor_restrict_unprivileged_userns=0" | sudo tee "/etc/sysctl.d/98-apparmor-unuserns.conf"
echo "0" | sudo tee "/proc/sys/kernel/apparmor_restrict_unprivileged_userns"
sudo service procps restart
sudo sysctl -p "/etc/sysctl.conf"
#Reboot

Examples

Chrome/Chromium

#In Address Bar
chrome://sandbox

Other Apps

#APP_NAME == pkg or the actual binary, & remember to keep the APP RUNNING
lsns -t user -t pid -t net | grep -i "${APP_NAME}"
#Example: lsns -t user -t pid -t net | grep -i "firefox"

#If you get no output, it means it's not enabled/working/supported
Otherwise You will get something like:

READ:

READ:

READ:

You will also need to install

For :

Read:

Ubuntu
https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces
https://getsol.us/2024/07/15/dropping-apparmor-kernel-patches/
https://github.com/linuxmint/mint22-beta/issues/82
BubbleWrap
firejail
AISAP
Chains
https://www.baeldung.com/linux/kernel-enable-user-namespaces
https://man7.org/linux/man-pages/man7/namespaces.7.html
https://man7.org/linux/man-pages/man7/user_namespaces.7.html
uidmap
Ubuntu (AppArmor)
https://askubuntu.com/questions/1511854/how-to-permanently-disable-ubuntus-new-apparmor-user-namespace-creation-restric
https://www.baeldung.com/linux/list-namespaces
Chrome Properly Sandboxed in User Namespace
Using to see, Firefox is Properly Sandboxed in User Namespace
lsns