Force vfs sync on linux

I have nextcloud desktop installed on my Ubuntu 23.10. I have VFS enabled to the extent that it creates .nextcloud files, and when I open them (via xdg-open or the Files app), it opens the default applications. This works as expected.

There are several files that I need to open in a Windows-guest VM on this machine. This is most often because of compatibility (e.g., .xlsm files that are not quite right in LibreOffice or the like). For these files, my only option at the moment is to open them in linux (which triggers the sync), then wait (often 30 seconds or more … they’re large) for the app to open so that I can close the app and then access the file via my vbox/VM interface.

I’d like to be able to force a sync on the file without attempting to open them in the default application. Since xdg-open just calls /usr/bin/nextcloud, which syncs and then immediately execs the default app, I don’t see an option or a way to do this easily.

Options I’ve considered and chosen against:

  • Install nextcloud client inside the VM so that I can just double-click it there. This is the closest to this use-case that might get to what I explained here, but it feels duplicative to have two nextcloud clients performing basic sync operations, even if the in-VM model is configured to “not sync anything” except when explicitly opened.
  • Write some shell-script trickery that calls /usr/bin/nextcloud and then tries to see what process it starts so that I can immediately try to kill that new (not-wanted) process. I feel this is fragile and could have undesired side-effects (from killing the app).
  • Use nextcloudcmd to manually download the file to a new location. I don’t want a new not-synced instance of the file, since once open I want its changes to be reflected in NC’s normal desktop sync operations.

I can’t find any utility programs within the Nextcloud desktop installation, so I believe the “force sync and open” is completely within the monolithic executable. Is there a way to trigger just a “force sync” or “free up space”? It’s not available in Gnome’s “Files” app (afaict) nor in the cli arguments of nextcloud or nextcloudcmd.