Skip to content

Instantly share code, notes, and snippets.

@chr5tphr
Last active August 6, 2023 08:48
Show Gist options
  • Save chr5tphr/bb48d742081cab207c3320be782b20cd to your computer and use it in GitHub Desktop.
Save chr5tphr/bb48d742081cab207c3320be782b20cd to your computer and use it in GitHub Desktop.
Bubblewrap full isolation
#!/bin/sh
BWROOT="${1:?"Root not specified!"}"
shift
env -i bwrap \
--bind "$BWROOT" / \
--unshare-user \
--unshare-cgroup \
--unshare-ipc \
--unshare-pid \
--unshare-uts \
--uid 1000 \
--gid 1000 \
--setenv PATH "/usr/bin:/usr/local/bin" \
--setenv TERM 'screen' \
--setenv COLORFGBG 'default;default' \
--setenv COLORTERM 'yes' \
--hostname isol \
--ro-bind /etc/resolv.conf /etc/resolv.conf \
--tmpfs /tmp \
--proc /proc \
--dev /dev \
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment