Run the power lifecycle of a tracked VM — resume it and wait for SSH, deallocate it while keeping the disk, or permanently delete it and its cloud resources.
pks vm start|stop [VM_NAME] · pks vm destroy$ pks vm start my-vmStart a VM and wait until SSH answers
$ pks vm stop my-vmDeallocate a VM, keeping its disk
$ pks vm startPick the VM to start interactively
$ pks vm destroyPermanently delete a VM after confirmation
Three commands cover the money-relevant part of a VM's life: pks vm start resumes a machine and blocks until it is reachable, pks vm stop deallocates it while preserving the disk, and pks vm destroy deletes it and everything it owns in the cloud. Each one resolves the VM to its provider and passes through the second-factor guard before touching billing.
pks azure init or pks scaleway init if it is not signed in.vm.start and vm.destroy require one by default; vm.stop does not. Adjust with pks actions.pks vm start my-vm
Starting a stopped machine resumes compute and GPU billing, which is why vm.start requires a second factor by default. The command then waits for a public IP and for port 22 to answer, refreshes the SSH target registration, and prints a connection panel containing the ssh command and the matching pks claude --ssh-target <name> invocation.
| Argument | Required | Description |
|---|---|---|
VM_NAME | no | The VM to start. An interactive picker appears when omitted, and is skipped when only one VM is tracked. |
The wait for a public IP times out after 5 minutes. On timeout the command exits with a non-zero status and suggests checking pks vm list — the machine may still be coming up.
Note. The same reachability routine backs
pks vm tailscale, so it can trigger thevm.startsecond-factor prompt too.pks devcontainer spawn --ssh-target's auto-start is a separate, Azure-only code path — it does not go through this routine or the provider registry, so it will not auto-start a Scaleway-provisioned VM. It waits up to 3 minutes for SSH (instead of this routine's 5-minute IP wait) and shows its ownStart the VM?confirmation before thevm.startgate.
pks vm stop my-vm
The machine is deallocated. Its disk and attached storage are preserved, so pks vm start brings it back with its state intact. The success message names both ways to resume it: pks vm start <name> and pks vm tailscale <name>.
| Argument | Required | Description |
|---|---|---|
VM_NAME | no | The VM to stop. An interactive picker appears when omitted. |
vm.stop does not require a second factor by default, unlike start, create, and destroy.
pks vm destroy
This permanently deletes the VM and the cloud resources it owns — the Azure resources created for it, or the Scaleway server. On success it also removes the local SSH target and the tracked metadata record. There is no undo.
pks vm destroy takes no VM name argument. It auto-picks when only one VM is tracked, otherwise it shows a selection prompt. Two gates stand in front of the deletion: a plain-text confirmation defaulting to no, and the vm.destroy second-factor action, which is required by default.
Removal of the SSH target is best-effort — a failure there is swallowed and the command still reports the destroy as successful. Removal of the metadata record is not: an exception there is not caught and would surface as a command failure even though the cloud resources are already gone.
Power operations execute outside any progress spinner on purpose. The second-factor guard may need to read a one-time password from the terminal, and an interactive prompt cannot render inside a live display.
| Symptom | Cause and fix |
|---|---|
Red error naming a provider init command | The VM's cloud is not authenticated. Run the named command, then retry. |
| Start exits after five minutes | The public IP has not appeared yet. Check pks vm list; if the machine is running, retry the start. |
| A second-factor prompt appears on a command you expected to be silent | vm.start is gated by default and is reused by vm tailscale. Devcontainer auto-start (Azure only) gates the same action through its own code path. Review the policy with pks actions. |
A VM disappears from pks vm list | Its cloud resource no longer exists, so pks pruned the record and its SSH target. Connection info for that name stops working. |