1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Rancher Desktopの時刻ズレを修正する

1
Last updated at Posted at 2023-02-28

devcontainer上で az login しようと思ったら。

The command failed with an unexpected error. Here is the traceback:
0. The ID token is not yet valid. Make sure your computer's time and time zone are both correct. Current epoch = 1677149361.

の表示が出て進めない。
時刻とタイムゾーンを確認しろとな?

どこの時刻を確認する?

devcontainerは Rancher Desktop で動くコンテナとして起動しています。
Windowsなので、 Rancher Desktop 自体も仮想マシンとして起動しています。
ターミナルから、Rancher DesktopのWSLを開いて確認。

$ date
Thu 23 Feb 2023 11:00:55 AM UTC

今は2/28、15:15。
だいぶ違いますな。

ハードウェアの現在時刻を取得

$ hwclock
Tue Feb 28 06:29:23 2023  0.000000 seconds

ふむ、タイムゾーンはUTCっぽいですが、時刻は問題なし。

hwclock で修正する

ハードウェア時刻はあっているので、そのままシステム時刻に反映すればOKです。

hwclock --hctosys

再確認

$ date
Tue Feb 28 06:34:17 UTC 2023

解決!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?