Network Time Synchronization
It is recommended to read the TimeSync Technical Design page together with this chapter, although it is a difficult topic. Interested users, developers and auditors should also review the footnotes for additional information or to explore design elements and the reasoning for this entry.
Block Networking until sdwdate Finishes
sdwdate is a Tor-friendly replacement for rdate and ntpdate that sets the system's clock by communicating via end-to-end encrypted TCP with Tor onion webservers. Since timekeeping is crucial for security and anonymity, blocking network access until sdwdate succeeds is sensible. 
sdwdate is functional on both Whonix-Gateway ™ and Whonix-Workstation ™, but in some cases it is possible for the time to leak before it is changed. Potential leak channels include time or other servers, daemons, and client programs such as Tor Browser which are used before sdwdate successfully finishes.  In this case, the user is only left with the protections afforded by Boot Clock Randomization. 
It is easiest to apply changes in the Whonix-Gateway ™ and Whonix-Workstation ™ TemplateVMs. In Qubes-Whonix ™, these settings will be inherited by all TemplateBasedVMs.
Qubes-Whonix ™ TemplateBasedVMs
The procedure can optionally be completed in select TemplateBasedVMs (AppVMs) like
By default, sdwdate-gui automatically starts when Whonix-Gateway ™ is booted. This keeps users informed about the status of the Tor network connection and sdwdate's progress, and also helps to test this feature.
If users are willing to persist with one sdwdate-gui systray instance per VM, then it is recommended to enable sdwdate-gui autostart. This setting keeps users informed about the status of the Tor network connection and sdwdate's progress, and will help to test this feature.
Developers are designing the next sdwdate-gui version so it can be conveniently enabled. Check back later for further information concerning sdwdate-gui modifications to prevent auto-start.
Network Time Synchronization
If ISP tampering with NTP is ever confirmed, users are advised to disable NTP and manually update the host clock out-of-band. For example, a watch or atomic clock [archive] can be used for this purpose. If the tampering is targeted and not a widescale attack, then the user already has much bigger problems to worry about than NTP; see Confirmation Attacks.
If following the advice above -- disabling NTP on the host and adjusting the clock out-of-band -- be aware that clearnet traffic might be easier to fingerprint.  The reason is that it introduces a device issuing clearnet traffic (such as OS updates), but without the use of NTP. It is unknown how many people have NTP which is deactivated, broken, uninstalled, or never in fact installed in the first place. Also unknown is how many people are using alternative time synchronization methods such as authenticated NTP, tails_htp, tlsdate or similar. However, search engine research suggests that very few people fall into both these categories.
The host system clock synchronization mechanism still uses unauthenticated NTP from a single source. This is not optimal, but there is no real solution to this problem.  A potential attack vector is created by this NTP behavior; the ISP and/or time server could either inadvertently or maliciously introduce a significant clock skew, or the host clock could simply malfunction.
If the host clock value is grossly inaccurate -- more than one hour in the past or more than 3 hours in future -- Tor cannot connect to the Tor network.  This is easily solved by manually fixing the clock on the host, then powering the Whonix-Gateway ™ (
sys-whonix) off and on again.
Another side effect of a significantly inaccurate host clock concerns operating system (OS) updates and cryptographic verification on the host. Until the host clock is manually fixed, it may no longer be possible to download updates or verify SSL certificates correctly with the host browser.
Users should always check whether a host clock defect relates to an empty battery before assuming the ISP is tampering with NTP.
Saving or Suspending the VM State
When a user suspends or saves the VM state, the clock will stop and continue after resuming, leading to a time that lags behind the correct value. This can cause later Tor connectivity problems or introduce possible adverse anonymity impacts.
The Whonix-Gateway ™ (
sys-whonix) state should not be suspended or saved. It is far better to power it off when it is no longer needed. 
Similarly, if users suspend or save the Whonix-Workstation ™ (
anon-whonix) state, the clock will again lag behind the correct value. This can be manually fixed by running:
Start Menu →
Time Synchronization Monitor (sdwdate-gui) →
For further detailed information on network time syncing on all Whonix ™ platforms, see here.
Spoof the Initial Virtual Hardware Clock Offset
For KVM, click on Expand on the right.
<clock offset='variable' adjustment='123456' basis='utc'>
adjustment attribute takes any arbitrary value for seconds. The user must pick a random value that is unknown to others, ranging between 0 and 900 (a 15 minute range).
Unfortunately, it is not yet possible to set a random clock offset for Qubes-Whonix ™ VMs to prevent clock correlation attacks since it is unsupported by Xen [archive]. A related issue is denying Qubes-Whonix ™ access to "clocksource=xen" [archive], which may not be possible without Linux kernel and/or Xen patches. For a detailed discussion of these issues, see here [archive].
For VirtualBox, click on Expand on the right.
VirtualBox has a feature to spoof the initial virtual hardware clock offset by setting the clock X milliseconds in the future or past. The syntax is outlined below.
VBoxManage modifyvm <name> --biossystemtimeoffset -<milliseconds> VBoxManage modifyvm <name> --biossystemtimeoffset +<milliseconds>
It is recommended to add a random delay within the following range.
VBoxManage modifyvm <name> --biossystemtimeoffset -60000 VBoxManage modifyvm <name> --biossystemtimeoffset +60000
A spoofing example is below. Users should select their own unique and random values for both the past (-) and future (+) within the specified range. Different values should be used for each distinct VM (on the host).
VBoxManage modifyvm "Whonix-Gateway" --biossystemtimeoffset -35017 VBoxManage modifyvm "Whonix-Gateway" --biossystemtimeoffset +27931 VBoxManage modifyvm "Whonix-Workstation ™" --biossystemtimeoffset -35017 VBoxManage modifyvm "Whonix-Workstation ™" --biossystemtimeoffset +27931
Table: Network Time Synchonization Summary
|Non-Qubes-Whonix||Only spoof the initial virtual hardware clock offset after importing the VM.|
|Qubes-Whonix||Consider enabling sdwdate-gui autostart to remain informed about the status of the Tor network connection and sdwdate's progress.|
Deactivate Automatic TimeSync
To deactivate sdwdate, run.
sudo service sdwdate stop
sudo systemctl mask sdwdate
- https://forums.whonix.org/t/testers-wanted-blocking-networking-until-sdwdate-finished-status-of-sdwdate-gui/5372 [archive]
- https://phabricator.whonix.org/T534 [archive]
- It is installed by default and is functional when manually started. Users should check back at a later date for further news on sdwdate-GUI development.
- https://phabricator.whonix.org/T533 [archive]
- See the Fingerprint page to discover what fingerprinting means in this case.
- See Design: Dev/TimeSync.
- In this case, Tor cannot verify the Tor consensus.
- If this advice is ignored, Tor can become confused if the time is more than 1 hour in the past or more than 3 hours in the future. When this happens, Tor will only reconnect to the Tor network if the clock is manually fixed or powered off and on again.
biossystemtimeoffsetis used to unlink the virtualizer's initial clock synchronization of the VM from the host clock.
- After powering on a VM, it initially synchronizes the VM clock with the host clock until Whonix ™ Timesync adjusts it.
- Clock skews can lead to linkability, meaning the user would be pseudonymous rather than anonymous.
This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! Read, understand and agree to Conditions for Contributions to Whonix ™, then Edit! Edits are held for moderation. Policy of Whonix Website and Whonix Chat and Policy On Nonfreedom Software applies.
Copyright (C) 2012 - 2020 ENCRYPTED SUPPORT LP. Whonix ™ is a trademark. Whonix ™ is a licensee [archive] of the Open Invention Network [archive]. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Freedom Software license as Whonix ™ itself. (Why?)