Change container's date and time

Hello ,

I am new to lxd/lxd, and we need to port an in-house application. One library will be re-implemented, we would like to compare the input and output of the old and new implementation. We have this library only in .so form. To make it work we need to set the time and date in the past, i.e. -4 months .

Is is possible to change the date of a container ? I tried date --set= , but I get “operation not permitted”

No, time is system wide.

There is technically a time namespace which may help here as a way to set a fixed offset between real time and time as seen in the container but it’s not directly made available by LXD.

You can change the time inside a LXD VM though.