On Ubuntu 18.04 I can install LXD
apt install lxc1 lxd lxd-client, create a container
lxc launch images:centos/7 mycontainer and enter it using
lxc exec mycontainer bash.
In the container I noticed that service dev-hugepages.mount has failed.
[root@mycontainer ~]# systemctl status dev-hugepages.mount ● dev-hugepages.mount - Huge Pages File System Loaded: loaded (/usr/lib/systemd/system/dev-hugepages.mount; static; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2020-11-20 04:35:41 UTC; 33s ago Where: /dev/hugepages What: hugetlbfs Docs: https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems Process: 35 ExecMount=/bin/mount hugetlbfs /dev/hugepages -t hugetlbfs (code=exited, status=32) Nov 20 04:35:41 mycontainer mount: mount: permission denied Nov 20 04:35:41 mycontainer systemd: dev-hugepages.mount mount process exited, code=exited status=32 Nov 20 04:35:41 mycontainer systemd: Failed to mount Huge Pages File System. Nov 20 04:35:41 mycontainer systemd: Unit dev-hugepages.mount entered failed state. Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable. [root@mycontainer ~]#
The command that is making this service fails is
/bin/mount hugetlbfs /dev/hugepages -t hugetlbfs -v
[root@mycontainer ~]# /bin/mount hugetlbfs /dev/hugepages -t hugetlbfs -v mount: permission denied [root@mycontainer ~]#
This service causes other services to fail. For example nfs-server. How can I fix this issue?
When I configure the container to be unconfined, this does not fix the problem
lxc config set mycontainer raw.lxc "lxc.apparmor.profile=unconfined"
I have a similar container created with Vagrant and the Vagrant LXC plugin - which uses LXC only where this service does run properly.