diff --git a/src/mcqemu/launcher.py b/src/mcqemu/launcher.py index 7c0356b..66b1fad 100644 --- a/src/mcqemu/launcher.py +++ b/src/mcqemu/launcher.py @@ -173,7 +173,13 @@ async def spawn_vm(cfg: VMConfig, config: Config) -> VMRecord: ) _, stderr = await proc.communicate() if proc.returncode != 0: - detail = stderr.decode(errors="replace").strip() or f"exit code {proc.returncode}" + detail = stderr.decode(errors="replace").strip() + if not detail: + # Daemonized QEMU routes errors to the -D logfile, not stderr. + try: + detail = paths.qemu_log.read_text().strip().splitlines()[-1] + except (OSError, IndexError): + detail = f"exit code {proc.returncode}" raise ToolError(f"QEMU failed to launch VM {cfg.name!r}: {detail}") try: