Enable core dump in lxd container

For anyone having the same problem, the solution is in this answer, but doesn’t jump to the eyes.

To stop sudo from disabling core dumps do the following (same as instruction above but nicely formatted):

  • create a file /etc/sudo.conf in the container
  • write set disable_coredump false in this file
  • if you previously logged in via something similar to lxc exec mycontainer -- sudo --user ubuntu --login, you need to first log out from the container and login again (no need to restart container).
  • now ulimit -a should show:
Limit                     Soft Limit           Hard Limit           Units
[...]
Max core file size        0                    unlimited            bytes
[...]
1 Like