Setup Time Zone and Sync with a NTP Server in TurnKey Linux

If you launch TurnKey Linux virtual machine , the default time zone might be different from yours. It might cause issues when you want to sync files between host and guest based on date and time. Therefore, it is a good idea to setup the right time zone.

Setup Time Zone

Login to TurnKey Linux and use date to check current date and time information. Here is an example:

root@yiiframework ~# date
Fri Aug  1 03:10:11 CST 2014

If it is different from your host environment, please locate your time zone in /usr/share/zoneinfo. For example, Taipei is /usr/share/zoneinfo/Asia/Taipei.

Use ln -sf to force to create a symbolic link between your time zone and /etc/localtime. Here is an example for Taipei:

root@yiiframework ~# ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime

Sync with a NTP Server

NTP stands for Network Time Protocol. You may sync time with a NTP server using ntpdate on a non-NTP server. Here is an example:

root@yiiframework ~# ntpdate
23 Aug 22:31:05 ntpdate[3141]: adjust time server offset -0.008559 sec


If I choose to Save the machine state instead of shutdown a virtual machine, time will be freeze. I have to manually sync with a NTP server when I launch it again next time.


  1. Computer Hope: Linux and Unix ln command
  2. Changing the timezone, date, and time
  3. SuperUser: How to set current time on Linux?
  4. SuperUser: Linux ntpd and ntpdate service
  5. TurnKey Linux
  6. Wiki: Network Time Protocol
  7. Wiki: Symbolic link
  8. Wiki: Virtual machine
  9. 鳥哥的 Linux 私房菜:15.3 用戶端的時間更新方式
  10. 鳥哥的 Linux 私房菜:實體連結與符號連結: ln

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s