> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/stratosphere-ve/ozone/llms.txt
> Use this file to discover all available pages before exploring further.

# Stop a Running QEMU Virtual Machine with Ozone's qemu.Stop()

> The qemu.Stop() function runs system_powerdown as a local executable to initiate a VM shutdown sequence and captures its output for error reporting.

`qemu.Stop()` provides a shutdown path for a running QEMU virtual machine. When called, it prints a status message to stdout and then runs `system_powerdown` as a local executable using `exec.Command`. Any output or error returned by the process is printed to stdout.

## Usage

```go theme={null}
import "github.com/stratosphere-ve/ozone/qemu"

func main() {
    qemu.Stop()
}
```

## How It Works

`Stop()` calls `exec.Command("system_powerdown")` and executes it via `cmd.Output()`. This invokes `system_powerdown` as a local process on the host — it does **not** send a QMP command over the TCP socket that `qemu.Start()` opens on `127.0.0.1:4444`. The two functions operate independently.

<Warning>
  Because `Stop()` runs `system_powerdown` as a standalone local executable, the binary must exist and be available on the system `PATH`. This is not a QMP protocol message. If `system_powerdown` is not installed or not found, `exec.Command` will return an error which is printed to stdout, and no shutdown will occur.
</Warning>

<Tip>
  To understand the full VM lifecycle — from configuration loading through launch — see the [Start VM](/qemu/start) page.
</Tip>
