Skip to content

Commit

Permalink
create_container: workaround privileged container + newer systemd
Browse files Browse the repository at this point in the history
Images with newer Systemd (e.g. Ubuntu Noble) doesn't work as a
privileged container unless nesting is also enabled, so we have to
enable it. This weakens the security, but since this is a development
setup anyway, I reckon it's fine.

See canonical/lxd#12967
  • Loading branch information
peat-psuwit committed Oct 31, 2024
1 parent f6fff59 commit e31ca2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crossbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,11 @@ create_container () {
lxc init $LXD_IMAGE $LXD_CONTAINER $EPHEMERAL_FLAG
if [ -n "$ENCRYPTED_HOME" ] || [ -n "$FORCE_PRIVILEGED" ] ; then
lxc config set $LXD_CONTAINER security.privileged true
# Workaround an issue with security.privileged + newer Systemd.
# This weakens the security, but since this is a development setup, it's
# probably fine.
# https://github.com/canonical/lxd/issues/12967
lxc config set $LXD_CONTAINER security.nesting true
else
if [ "$(lxc --version | cut -f1 -d. )" -ge "3" ]; then
IDMAP="lxc.idmap"
Expand Down

0 comments on commit e31ca2f

Please sign in to comment.