DEV Community


WSL2 Time Sync

Bart Robertson
I'm a software engineer at #Microsoft focused on all things #Azure
・1 min read

The simplest way I've found to keep your WSL2 clock in sync with your host clock.

Start WSL and add the following line to your ~/.bashrc file

# fix wsl time sync
sudo ntpdate &>/dev/null &

This will sync your clock to the ubuntu ntp server (any ntp server will work)

the & on the end causes the command to run in the background so that your startup isn't delayed

Discussion (0)

Forem Open with the Forem app