CLI Command for Restarting Tor

Hey, I’m trying to automate most of my setup and I’m unsure how to start up sys-whonix when it is not connected yet. I am looking for the equivalent of clicking the Tor connection icon in the top right → tor-control-panel → “Restart Tor”.

Does anybody know how to do this or how I can figure out how to do so? I’ve already tried the .sls files.

What’s your end goal exactly? Can’t you simply use something like sudo systemctl restart tor?

I’m trying to run the TemplateVM update Salt but Whonix fails because the update service is not running yet. Would I run that in the Whonix TemplateVM?

If you try to do a script in dom0, you could use something like this (that’s what I use):

#!/bin/bash
qvm-start sys-whonix --skip-if-running
sleep 4 # Wait a bit for Tor to bootstrap fully

EXCLUDE="NAME|dom0|AppVM|DispVM"

VMs=$(qvm-ls | grep -E -v $EXCLUDE | awk '{print $1}' | tr '\n' ',')

echo "Updating Following VMs:" $VMs

qubesctl --show-output --skip-dom0 --targets $VMs --max-concurrency 4 state.apply update.qubes-vm

Change the “max-concurrency” to something your system can handle.