Closed neowu closed 9 months ago
Hello,
Are you using Tart from an automation tool, or manually through GUI?
In the latter case, you can request a graceful shutdown from Control
→ Request Stop
menu.
Thanks for the reply, i am using tart as lightweight vm tool for local development, mainly for linux vm and no GUI most of time. I can keep using "ssh -tt host sudo poweroff" instead of "tart stop host"
currently "tart stop vm" or ctrl-C sends SIGINT to PID of "tart run"
from source code, it cancels Run.swift->task, and eventually trigger VM.stop() function
which calls
but with this way, it shutdown linux guest forcefully and caused "crash"
with some local experiment, i found requestStop() triggers a normal shutdown it works if i changes stop() function like following, it will print "guest has stopped the virtual machine" with ctrl+C
PS: the sleep part for debug purpose, i just need to wait few seconds to let linux finish shutdown
i am not sure what's the best way to solve this, like introduce some timeout after requestStop(), if failed then call stop() to force shutdown?
right now I am using "ssh -tt host sudo poweroff" to gracefully shutdown linux guest