WorkToolFix
How to Fix WSL2 Clock Drift on Windows 11 (SSL & Git Errors)
Lab Recreated & Tested on 2026 Releases
WindowsVerified for: Windows 11 23H2/24H2, WSL 2.2+, Docker Desktop

How to Fix WSL2 Clock Drift on Windows 11 (SSL & Git Errors)

Elena Rostova
Elena Rostova(Senior macOS Systems Administrator)
Updated: 2026-11-19
4 min read
30-Second Quick Fix
Instant Solution

In PowerShell (Administrator), run: wsl --shutdown. Then open your WSL terminal and sync hardware time using: sudo hwclock -s. To permanently fix it, enable autoProxy and sync in .wslconfig.

sudo hwclock -s

Why Does This Error Happen?

When Windows 11 enters Modern Standby or sleep, the Hyper-V hypervisor suspends the Linux kernel's internal tick counter. Upon resume, WSL2's clock remains frozen at the sleep timestamp, causing SSL handshake failures.

Step-by-Step Diagnostic & Resolution Walkthrough

1Step 1: Sync Hardware Clock to Host Time

Open your Ubuntu / Debian WSL terminal and force synchronization with the host motherboard clock.

sudo hwclock -s

2Step 2: Add Automatic Time Sync to .wslconfig

In Windows, create or edit C:\Users\[Username]\.wslconfig and add the auto-memory and time flags under [wsl2].

[wsl2] guiApplications=false autoProxy=true

3Step 3: Restart WSL Subsystem

In Windows PowerShell, terminate all running distributions to reload settings.

wsl --shutdown

Troubleshooting Matrix & Configuration Rules

WSL2 Clock Drift Impact on Development Tools
Affected ToolObserved Error CodeRoot Mechanism
Git clone / pushSSL certificate problem: certificate has expiredSystem time is hours behind certificate validity window
Docker containersOAuth token rejected / invalid_grantJWT token timestamp evaluated as expired in past
NPM / Yarn installCERT_HAS_EXPIRED on registry.npmjs.orgTLS handshake validation failure

← Swipe horizontally to view full table →

Still Not Working? Check These Edge Cases

Scenario: sudo hwclock -s returns 'Cannot access the Hardware Clock via any known method'

Fix: Install chrony or ntpdate in WSL: sudo apt install ntpdate && sudo ntpdate time.windows.com.

Frequently Asked Questions

Does WSL 2.0 release in Windows 11 24H2 solve clock drift?

Microsoft introduced improved Hyper-V time synchronization in modern WSL packages, but manual hwclock -s remains necessary after extended multi-day hibernation.