When running Linux in a VM, if I close the lid of my macbook, when I reopen it, for exemple, two hours later, the Linux VM time has "drifted" and is two hours in the past.
https://developer.apple.com/documentation/virtualization/running_linux_in_a_virtual_machine
Microsoft solves this issue on their Hypervisor with a RTC device /dev/ptp_hyperv, and configuring chrony to use it, see https://learn.microsoft.com/en-us/azure/virtual-machines/linux/time-sync#chrony
Linux KVM do the same : https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/chap-kvm_guest_timing_management#sect-KVM_guest_timing_management-Host-guest-time-sync
It seems there is also a virtio_rtc module coming
Virtualizing macOS on macOS has AppleVirtualPlatformRTCPlugin setting time on the guest.
But how to get a Linux time in sync with
There is no support for time synchronization for Linux in Virtualization. There is a custom mechanism for macOS guests as you mentioned.
A fairly popular workaround is to re-sync the time every minute in Linux.
Can you please file a feature request for integrating VirtioRTC describing the use cases you have? This sounds like it could be a useful feature to consider.