[SOLVED] LXC not getting host time

Discussion in 'Proxmox VE: Installation and configuration' started by CharlesErickT, Nov 22, 2017.

  1. CharlesErickT

    CharlesErickT Member

    Joined:
    Mar 15, 2017
    Messages:
    52
    Likes Received:
    5
    Hello,

    From my understanding, a container should get his date and time settings from the host ?

    I'm asking because all my containers on a said host are in UTC timezone while the host is on the EST timezone. Rebooting the host and the containers changed nothing.

    Do I need to set /etc/localtime manually in the container ? What if NTP is installed on the host ? Shouldn't the containers pull the NTP time from the host ?

    The containers are Ubuntu 16.04 LTS

    and here's my pveversion -v on the host
    Code:
    proxmox-ve: 5.1-25 (running kernel: 4.13.4-1-pve)
    pve-manager: 5.1-35 (running version: 5.1-35/722cc488)
    pve-kernel-4.13.4-1-pve: 4.13.4-25
    libpve-http-server-perl: 2.0-6
    lvm2: 2.02.168-pve6
    corosync: 2.4.2-pve3
    libqb0: 1.0.1-1
    pve-cluster: 5.0-15
    qemu-server: 5.0-17
    pve-firmware: 2.0-3
    libpve-common-perl: 5.0-20
    libpve-guest-common-perl: 2.0-13
    libpve-access-control: 5.0-7
    libpve-storage-perl: 5.0-16
    pve-libspice-server1: 0.12.8-3
    vncterm: 1.5-2
    pve-docs: 5.1-12
    pve-qemu-kvm: 2.9.1-2
    pve-container: 2.0-17
    pve-firewall: 3.0-3
    pve-ha-manager: 2.0-3
    ksm-control-daemon: 1.2-2
    glusterfs-client: 3.8.8-1
    lxc-pve: 2.1.0-2
    lxcfs: 2.0.7-pve4
    criu: 2.11.1-1~bpo90
    novnc-pve: 0.6-4
    smartmontools: 6.5+svn4324-1
    zfsutils-linux: 0.7.2-pve1~bpo90
    Thanks
     
  2. tom

    tom Proxmox Staff Member
    Staff Member

    Joined:
    Aug 29, 2006
    Messages:
    13,642
    Likes Received:
    420
    set your timezone in your lxc container with:

    > dpkg-reconfigure tzdata
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. CharlesErickT

    CharlesErickT Member

    Joined:
    Mar 15, 2017
    Messages:
    52
    Likes Received:
    5
    Then the time will be synchronise with the host if they are on the same timezone and the host is an NTP server or they are separate and not related ?
     
  4. wbumiller

    wbumiller Proxmox Staff Member
    Staff Member

    Joined:
    Jun 23, 2015
    Messages:
    645
    Likes Received:
    84
    The timezone is normally used purely for the purpose of dispalying the time or parsing user input. Internally your container will use the host's clock.
    So if they're using the same timezone, they should display the same time, but one's timezone setting will not influence the other's.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    CharlesErickT likes this.
  5. CharlesErickT

    CharlesErickT Member

    Joined:
    Mar 15, 2017
    Messages:
    52
    Likes Received:
    5
    Thanks for your time. This answers all my questions
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice