Load the Windows 11 VM hardware from QEMU config files and add port options

Move the QEMU hardware definition of the Windows 11 VM into
qemu/windows11.ini and qemu/windows11-amd64.ini, loaded with -readconfig
like the Linux launchers. The network stays in the launcher because a
config file section cannot hold two hostfwd entries. Add --rdp-port and
--ssh-port, which override the WIN11_VM_*_PORT environment variables.
WIN11_VM_MEMORY and WIN11_VM_CPUS are replaced by the config file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
GuofangandClaude Sonnet 5.5 committed 2026-10-15 12:36:15 +08:00
1 parent 26baf25172
commit e1e5a2149c
4 files changed
+179 -29

No files matched your search

+7 -1
View File
@@ -175,6 +175,12 @@ passwordless administrator login. The installer includes the VirtIO drivers, SPI
and QEMU Guest Agent. Connect with `ssh guofang@localhost -p 2222`. The launcher
exposes the vdagent channel for host/guest clipboard integration and the QEMU Guest Agent at
`.vm/windows11/qemu-guest-agent.sock`. Change the password after first login.
The Windows VM hardware (accelerator, 8G memory, 8 CPUs, system disk, devices)
is defined in `qemu/windows11.ini`, with the machine type in
`qemu/windows11-amd64.ini`; the launcher renders the former to
`.vm/windows11/qemu.ini` and loads both with `-readconfig`. Only the network
and the installation media are still set by the launcher. QEMU arguments after
`--` override the config files, for example `./run-windows11.py -- -m 4G -smp 4`.
The generated answer-file ISO is stored beside the disk as
`.vm/windows11/seed.iso`.
@@ -183,7 +189,7 @@ To install from the Windows ISO instead, use `./run-windows11.py
disk; subsequent starts always boot the existing system disk normally. During
ISO installation, the launcher resolves its tools ISO through the shared image
helper and downloads it when missing. Override the base QCOW2, source ISO,
tools ISO, resources, RDP port, or SSH port with the `WIN11_VM_` environment
tools ISO, RDP port, or SSH port with the `WIN11_VM_` environment
variables shown by `./run-windows11.py --help`. For example, when the VirtIO ISO
is elsewhere: