feat(vm): add --gui/--nogui to vm new --start, default headless
Mirror the `job` flag on the manual lifecycle: `vm new --start` was hardcoded headless; add --gui/--nogui (default --nogui) so a clone can be booted into the Workstation GUI window for interactive debugging. The start banner reflects the mode. Also update the runbook: §4.1 shows the --gui variant, and §3 notes that the burnin-dummy build.sh is a ~30s fake build writing dist/build-info.txt so the examples exercise the full pipeline.
This commit is contained in:
@@ -406,7 +406,15 @@ def vm_cleanup(
|
||||
"start_vm",
|
||||
is_flag=True,
|
||||
default=False,
|
||||
help="Start the clone headless immediately after creation.",
|
||||
help="Start the clone immediately after creation.",
|
||||
)
|
||||
@click.option(
|
||||
"--gui/--nogui",
|
||||
"gui",
|
||||
default=False,
|
||||
show_default=True,
|
||||
help="With --start, open the Workstation GUI window (--gui, needs an X "
|
||||
"display) or start headless (--nogui, the default).",
|
||||
)
|
||||
def vm_new(
|
||||
template: str,
|
||||
@@ -416,6 +424,7 @@ def vm_new(
|
||||
vmrun_path: str | None,
|
||||
guest_os: str,
|
||||
start_vm: bool,
|
||||
gui: bool,
|
||||
) -> None:
|
||||
"""Create a linked clone of the template VM for an ephemeral CI build.
|
||||
|
||||
@@ -475,9 +484,10 @@ def vm_new(
|
||||
click.echo(f"[vm new] clone created in {elapsed:.1f}s", err=True)
|
||||
|
||||
if start_vm:
|
||||
click.echo("[vm new] starting VM headless...", err=True)
|
||||
mode = "GUI" if gui else "headless"
|
||||
click.echo(f"[vm new] starting VM ({mode})...", err=True)
|
||||
try:
|
||||
backend.start(handle, headless=True)
|
||||
backend.start(handle, headless=not gui)
|
||||
except BackendError as exc:
|
||||
raise click.ClickException(f"vmrun start failed: {exc}") from exc
|
||||
click.echo("[vm new] VM started.", err=True)
|
||||
|
||||
Reference in New Issue
Block a user