DEV Community

Bart Robertson
Bart Robertson

Posted on

1 1

WSL2 Time Sync

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 ntp.ubuntu.com &>/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

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay