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.
qemu.Start() is Ozone’s entry point for launching a virtual machine. It interactively prompts for a VM name, reads the corresponding JSON configuration through vmparser.VMParser, and then spawns a qemu-system-x86_64 process with a fixed set of hardware flags — including Q35 machine type, a QCow2 disk image, a Debian ISO as the optical drive, and a QMP control socket bound to 127.0.0.1:4444.
Usage
QEMU Flags
WhenStart() builds the qemu-system-x86_64 command it passes the following flags in order:
| Flag | Value | Purpose |
|---|---|---|
-machine | q35 | Use the Q35 chipset (PCIe, AHCI, modern BIOS) |
-m | "" (empty string) | Amount of RAM to allocate to the guest |
-smp | 4 | Expose 4 virtual CPUs to the guest |
-drive | file=myvm.qcow2,format=qcow2 | Attach the primary disk in QCow2 format |
-cdrom | debian.iso | Mount debian.iso as the optical drive |
-boot | d | Set the boot order to CD-ROM first |
-qmp | tcp:127.0.0.1:4444,server,nowait | Expose the QEMU Machine Protocol over TCP |
The
-m flag is sourced from the package-level variable memsize, which is initialized to an empty string (""). This means memory size is not yet wired to the VM configuration loaded by vmparser. The VM config is read and printed, but its fields are not currently used to populate the QEMU command. Until memsize is set, QEMU will receive an empty value for -m and may fail to start.The QMP socket listens on
127.0.0.1:4444 for the lifetime of the VM process. You can connect any QMP-compatible client (e.g. socat or a custom Go client) to this address for machine introspection, query commands, and live control without stopping the guest. Note that qemu.Stop() does not use this socket — it operates independently.Startup Sequence
Prompt for VM name
Start() prints "What VM would you like to start?" to stdout and then calls fmt.Scanln to read a single token from stdin into the vmname variable. The function blocks here until the user presses Enter.Load VM configuration
The name is passed to
vmparser.VMParser(vmname), which reads the JSON file for that VM and returns a populated config struct. If the file cannot be read or parsed, an error is printed and Start() returns immediately without launching QEMU. On success, the parsed config is printed via fmt.Printf("VM info: %+v\n", vmInfo) — however, the config fields are not yet used to build the QEMU command.Build the QEMU command
exec.Command assembles the qemu-system-x86_64 invocation with all flags listed in the table above. The -m value comes from the package-level memsize variable, which is currently an empty string and is not populated from the loaded VM config.