Manually set date in Ubuntu LXC container

mervin

Member
Feb 23, 2021
9
3
8
48
Hi there,

Is it possible to manually set the time inside an Ubuntu LXC container? I have a use case where it's necessary to temporarily override the date.
I know dpkg-reconfigure tzdata works however in this specific case I would like to set the date ahead of today.
I've tried timedatectl and the date command to no avail. The message I get for example is 'date: cannot set date: Operation not permitted'
I've also tried this on a privileged test container to see if that would make a difference, but it didn't.

I know the time is synced with the host but is this possible at all?

Thank you in advance!
 
Last edited:
  • Like
Reactions: leesteken

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!