Lxd: date: cannot set date

Created on 18 Aug 2017  路  3Comments  路  Source: lxc/lxd

Required information

  • Distribution:Ubuntu
  • Distribution version:16.04.2 LTS
  • The output of "lxc info" or if that fails:
    _lxc info
    config:
    core.https_address: '[::]:8443'
    apiextensions:
  • id_map
    apistatus: stable
    apiversion: "1.0"
    auth: trusted
    public: false
    environment:
    addresses:

    • 192.168.191.60:8443

    • 10.1.0.1:8443

      architectures:

    • x86_64

    • i686

      certificate: |

      -----BEGIN CERTIFICATE-----

      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

      vu98VwFWh+c=

      -----END CERTIFICATE-----

      certificatefingerprint: 561722c0d6d230da815947b119d5b80fbdab60750a6f92dba18b600447be287e

      driver: lxc

      driverversion: 2.0.7

      kernel: Linux

      kernelarchitecture: x86_64

      kernelversion: 4.4.0-77-generic

      server: lxd

      serverpid: 2592

      serverversion: 2.0.9

      storage: dir

      storageversion: ""_

Issue description

date: cannot set date: Operation not permitted Fri Aug 18 09:59:19 UTC 2017

I tried
lxc config set rstudio environment.LC_ALL=en_US.UTF-8
and after
sudo lxc exec rstudio -- /bin/bash
in container
date 081809592017.19
I installed ntpdate, but
ntpdate 0.ubuntu.pool.ntp.org , ...
no server suitable for synchronization found
so, i tried to config _nano /etc/ntp.conf_, but it not exists.

Pleas, help me.

Most helpful comment

System time is shared between containers and host since it's the same kernel. It's therefore not allowed for a container to alter system time as that would affect the entire host.

You can obviously change timezone as that's a userspace concept, but changing time is something you need to do on the host.

All 3 comments

This isn麓t actually a lxd issue.

Install ntp with:

apt install ntp

then

ntpq -p

It didn't solve the problem.

System time is shared between containers and host since it's the same kernel. It's therefore not allowed for a container to alter system time as that would affect the entire host.

You can obviously change timezone as that's a userspace concept, but changing time is something you need to do on the host.

Was this page helpful?
0 / 5 - 0 ratings