Minikube: how to change vm time zone

Created on 13 Oct 2017  路  9Comments  路  Source: kubernetes/minikube

how to change vm time zone,when the vm start,it set the same time to my local,but not my local timezone

kinsupport lifecyclrotten

Most helpful comment

The VM time zone is UTC. If you really really want to change it to your local time zone, run this on your host:

mkdir -p ~/.minikube/files/etc
cp /etc/localtime  ~/.minikube/files/etc

Every subsequent run of minikube start will override the timezone with what you have specified in ~/.config/minikube/files/etc/localtime.

All 9 comments

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

I'm having the same problem, it's happening with the vmware driver. The timezone it's set to UTC but the time is my localtime, @du2016 did you manage to fix it? When using virtualbox it works fine.

I changed the date manually but that's more like a workaround than a solution.

I also reported the issue here https://github.com/machine-drivers/docker-machine-driver-vmware/issues/17

@alejandrodnm i have change source code: copy timezone file to localtime before vm start, then build myself

I also encountered the same problem, if using minikube in different countries how to ensure that the hyperkit uses the specified time zone

I ended up with this, that I found in some other issue

$ alias minikube-date
minikube-date='DSTR=$(date -u); minikube ssh "sudo date --set=\"$DSTR\""'

I just ran into this as well on MacOS + hyperkit - this can cause issues with docker builds against minikube's docker daemon, e.g. from skaffold:
"E: Release file for http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 1h 54min 32s). Updates for this repository will not be applied."

I can confirm that @alejandrodnm's fix works!

@balopat I believe your issue is actually #4264 - not timezone related, but system clock related (fixed at . head)

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

The VM time zone is UTC. If you really really want to change it to your local time zone, run this on your host:

mkdir -p ~/.minikube/files/etc
cp /etc/localtime  ~/.minikube/files/etc

Every subsequent run of minikube start will override the timezone with what you have specified in ~/.config/minikube/files/etc/localtime.

Was this page helpful?
0 / 5 - 0 ratings