[lxc-users] lxc 2.0: howto inherit ulimits from the host?

Dirk Geschke dirk at lug-erding.de
Sun Jan 21 18:59:49 UTC 2018


Hi Harald,

> I am running lxc 2.0.9 on Stretch. The (privileged) container
> runs Oracle Linux 7.4. Problem: I get some very restricted
> ulimits in the container (e.g. nofile hard 8192), even though
> the limits for root and "*" on the host are set to much higher
> values. On the host the limits are fine.
> 
> If I set the expected limits in lxc1:/etc/security/limits.d/\
> local.conf, then ssh to this container fails. ssh just says
> "Connection closed", exit value is 254. So apparently setting
> the limits in the container is not an option.
> 
> Is there some way to get around this mess? I saw that lxc 2.1
> provides new lxc.prlimit config options, but AFAIU *privileged*
> containers should inherit the limits and shoud be fine with a
> local limits.conf.

did you try to increase the limits via ulimit before starting the 
container? At least, this works with unpriviledged containers...

Best regards

Dirk
-- 
+----------------------------------------------------------------------+
| Dr. Dirk Geschke       / Plankensteinweg 61    / 85435 Erding        |
| Telefon: 08122-559448  / Mobil: 0176-96906350 / Fax: 08122-9818106   |
| dirk at geschke-online.de / dirk at lug-erding.de  / kontakt at lug-erding.de |
+----------------------------------------------------------------------+


More information about the lxc-users mailing list