-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use timesync option? #190
Comments
The timesync option should add a virtio-vsock device if needed.
An alternative to |
Timesync uses a vsock port for guest/host time synchronization. When timesync is in use, if the VM has no vsock device, a new one is automatically added. However this got broken in commit a5db53d as we were generating the hypervisor configuration before adding this device. This means timesync only worked if you had another vsock device configured. This fixes crc-org#190 Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
This automatic addition is currently broken in git, #191 should fix it. In the mean time, you can add another |
Thanks for putting the pieces together for me. |
Timesync uses a vsock port for guest/host time synchronization. When timesync is in use, if the VM has no vsock device, a new one is automatically added. However this got broken in commit a5db53d as we are generating the hypervisor configuration before adding this device. The vsock device must be part of `virtualMachineConfig` before calling `cfg.SetSocketDevicesVirtualMachineConfiguration(cfg.socketDevicesConfiguration)`, and after this commit, the vsock device is only added to `virtualMachineConfig` afterwards. This means the timesync only worked if you had another vsock device configured. This fixes crc-org#190 Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> # Veuillez saisir le message de validation pour vos modifications. Les lignes # commençant par '#' seront ignorées, et un message vide abandonne la validation. # # Date : Fri Sep 6 11:50:58 2024 +0200 # # Sur la branche timesync # Votre branche est à jour avec 'teuf/timesync'. # # Modifications qui seront validées : # modifié : pkg/vf/vm.go # # Fichiers non suivis: # .goreleaser.yaml # 0001-Add-script-to-start-EFI-image.patch # 0002-misc-improvements-to-scripts.patch # 0003-setRawMode-work.patch # 0004-test-with-qemu.patch # 0005-debug-hacks.patch # cmd/vfkit/main.go.orig # cmdline.test # diff # go.mod.orig # go.mod.rej # gosec.patch # hacks.diff # lint.patch # patch # pkg/config/json.go~ # pkg/ignition/ # pkg/vf/virtionet.go.orig # pkg/vf/virtionet.go.rej # rest.md # run-sample-vm.sh # start-vm.sh # stdout/ # unixsocket.patch # vfkit # vfkit-amd64 # vfkit-arm64 # vfkit-macos12 #
I've read the usage and understand the intention of the
--timesync
flag and maybe have qemu guest agent setup properly in my (Alpine Linux) VM but I don't get time sync (getting errors, see below), and am just trying to understand what specific values to specify forvfkit
invocation andqemu-ga
to see time sync actually workIf I simply specify
--timesync
without a corresponding--device virtio-vsock
during vfkit, I get the following error:error connecting to vsock port 7890: VM has too many/not enough virtio-vsock devices (0)
Which, I think, makes sense given I think I do need to specify a
--device virtio-vsock
from what it seems. Though I think this should likely be a configuration error as the user is asking for something that will potentially never work (and--timesync
erroring here is at debug level by default so time sync will just silently fail).So, to get time sync to work, I'd be interested to see a working
vfkit
host invocation with--timesync
and--device virtio-vsock
(and associated options for each) and the guest'sqemu-ga
invocation, can someone provide this?The text was updated successfully, but these errors were encountered: