seems to be working!Inside of the priv LXC will get you where you need to be.Code:apt remove apparmor -y
seems to be working!Inside of the priv LXC will get you where you need to be.Code:apt remove apparmor -y
Thanks for the explanation.Must be that this was simply not considered an error?
Do you really need to load apparmor profiles inside your container?
Administrating apparmor profiles requiresCAP_MAC_ADMIN
which is dropped by the default common lxc configuration.
You can add a config snippet to enable this:
Code:# /usr/share/lxc/config/common.conf.d/02-stacked-apparmor.conf # Clear this (as the main common.conf fills it with the capabilities below plus mac_admin and mac_override lxc.cap.drop = # Drop some harmful capabilities lxc.cap.drop = sys_time sys_module sys_rawio
Since we do have apparmor stacking/nesting available now, this should be mostly safe (but then since you're using privileged containers, safety isn't really a thing anyway).
We could probably automate this based on the availability of stacking though. (/sys/kernel/security/apparmor/features/domain/stack
must containyes
)
level=error msg="AppArmor enabled on system bu
t the docker-default profile could not be loaded: running `/sbin/apparmor_parser apparmor_parser -Kr /var/lib/docker/tmp/docker
-default1046792531` failed with output: apparmor_parser: Unable to replace \"docker-default\". Permission denied; attempted to
load a profile while confined?\n\nerror: exit status 243"
I dont know. possibly.Seems so, but this thread is actually only related to privileged containers where the apparmor service even fails to start.
However, can't you simply uninstall apparmor?
You need to run docker basically?I dont know. possibly.
I thought it was best not to, even though im using a priv. container (i think i need to to make docker + NFS mounting work so i can mount the NFS share into the docker container) that i need to use a priv. container.
I thought it was best to keep apparmor installed and there. but i may be wrong??
I cant remember exactly, but there was some reason i needed to go priv. LXC so that i could get it to work.You need to run docker basically?
Why not inside an unprivileged container?
You don't need anything special, only nested, but nested is activated by default anyway.
If your backend storage is zfs, 90% of docker containers will work, 10% not.
Those 10% won't work, basically because those docker images have too much subdirectories or too long filenames inside.
For example:
- it could be that an onlyoffice docker image won't work 50% chance. Since it's almost a full fledged ubuntu/debian based container
- Speedtest-tracker won't work 100%, same reason as above.
- plex / jellyfin / paperless-ngx / heimdall / portainer / traefik / nginx proxy manager / and many more, will work without any issues.
But you can make everything working with either lvm as backend storage, or simply creating an ext4 dataset.
I made once a small howto about ext4 datasers.
I cant remember exactly, but there was some reason i needed to go priv. LXC so that i could get it to work.
My setup is
PVE 7.1.7
- ZFS main PVE array (i found a command that fixed the docker / zfs issues though looking around)
- Bunch of LXCs (some running dockerised apps, some not)
- Truenas Core
- - - Bunch of drives over multiple datasets and pools exposing a variety of SMB and NFS shares
- - - Truenas doing its truenas thing
To get the LXCs to mount the NFS share directly, OR to get the ones running docker that i also needed to mount the NFS shares in, i needed to go priv. else it wouldnt work. I cant remember exactly. But im happy to take guidence and change things if im going about it all wrong.
I remember thinking that it shouldnt be as hard as it is to do what i want to do.
I do remember i had no end of troubles with docker filling up its allotted storage until i found that command to put into the LXC.conf and its been great ever since.
you have saved me hours of troubleshooting if I could I'd buy you a coffee thanks.I spent about 10 hours on this frustratingly over 2 days. I have found a solution:
Go into shell on your host
In the individual lxc conf-file eg. /etc/pve/lxc/100.conf
add the following lines:
lxc.apparmor.profile: unconfined
lxc.cgroup2.devices.allow: a
lxc.cap.drop:
And reboot your lxc, or just stop your lxc and then start it after editing.
You dont even need to remove or mess with apparmor, it just basically disables it.
Yeah there is security implications, but you are using a privileged lxc anyways.
docker and all containers working 100% now and adding new ones not affect by any issues.
I actually just changed the line in the common.conf file using this command on the proxmox host:Hello there,
I am sorry I need to be enlightened.
Actually what I have is that :
#PBS:/usr/share/lxc/config/common.conf.d# ls
00-lxcfs.conf 01-pve.conf README
Should I create02-stacked-apparmor.conf
? If so then, I have to paste :lxc.cap.drop = sys_time sys_module sys_rawio
Right?
Thanks
sudo sed -i 's|mac_admin\ mac_override\ sys_time\ sys_module\ sys_rawio|sys_time\ sys_module\ sys_rawio|g' /usr/share/lxc/config/common.conf
We use essential cookies to make this site work, and optional cookies to enhance your experience.