* Support remote VM names in --disk command-line argument
* tart set: introduce "--disk" to support replacing VM's disk contents
* Complete the code comment
For macOS this brings up a dialog, asking the user if they are sure
they want to shut down, which makes this less useful for automated
graceful shutdowns, but it may behave better on Linux, and there
might be ways to instruct macOS to not ask the user, so it's still
a nice feature, and aligns with the SIGUSR1 for suspend, and SIGINT
for non-graceful shutdown.
* Drop Monterey Support
People will still be able to run and SSH into Monterey VMs or use VNC but pointing devices/keyboard won't work.
Fixes#841
* Fixed x86 build
The latest release has this error:
> error: Project not found. Please check that you entered the project and organization slugs correctly.
Which seems indicating that Auth is broken and we are getting 404? In the Sentry Settings I didn't find any token which I find strange. So I created one and re-encrypted.
* Give Virtualization.framework a chance to stop the VM on tart stop
We were letting the CancellationError bubble up all the way until
it terminated app, which meant we didn't hit the shutdown code
in run(), stopping the VM and the network.
We now catch CancellationError and proceed to gracefully shut down.
We only stop the VM if it's still running, as a VM that has been
stopped via the menu can't be stopped again.
* Gracefully shut down VM when Tart is quit via menu
Normally the quit action will result in AppKit calling exit(),
but we want to gracefully shut down the VM, so we use the same
path as for closing of the VM window, namely signal our own
process with SIGINT or SIGUSR1.
If that doesn't work we let AppKit terminate as before.
This fixes the "Warning: NSActivity <_NSActivityAssertion:
0x600001f785a0> was ended multiple times" warning seen on
the console when quitting Tart via the menu.
* Activate Tart after application finishes launching
This ensures that the VM window has been shown by the time we
activate, so that we consistently activate and bring the VM
window to the front.
* Document how to mount the shared directory on Linux at boot time
* Use admonition
Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
---------
Co-authored-by: Fedor Korotkov <fedor.korotkov@gmail.com>
* add VM completion for run command
* add VM completion for stop command
* create ShellCompletions utilities
* add shell completions to some commands
* add shell completion for fqn command
* run command: fix tiny typo
* add shell completion for get command
* more shell completions
* remove unnecessary `try`
* refactor ShellCompletions file
The URLSession async/await functions do not report progress through
the normal URLSessionTaskDelegate callbacks, as reported in:
https://developer.apple.com/forums/thread/723015
We don't want to use URLSession.bytes, as that results in a much
slower download speed compared to URLSession.download, but we can
work around the lack of progress callbacks by observing the
progress on the URLSessionTask itself.
Fixes#767
We wrap the installation with a withTaskCancellationHandler, which
ensures that the SIGINT signal handling code in main() will trigger
a cancellation of the installer.
As the VZMacOSInstaller must be both created and interacted with
on the VM's queue, which in our case is the main queue, we need
to move the logic to a separate function tagged with @MainActor.
This makes sense either way, as it cleans up the code a bit.