Skip to content

windows: add --console flag to support ttyS0 and hvc0 consoles - #118

Draft
lstocchi wants to merge 2 commits into
libkrun:2.0from
lstocchi:serial
Draft

lstocchi wants to merge 2 commits into
libkrun:2.0from
lstocchi:serial

Conversation

@lstocchi

@lstocchi lstocchi commented Oct 8, 2026

Copy link
Copy Markdown

Previously, Windows builds were hardcoded to use hvc0 via the virtio-console builder. Depending on the guest kernel configuration (such as Fedora cloud images), the guest may default to outputting over a serial console (ttyS0) rather than hvc0. Providing the --console flag gives users the flexibility to match krunkit's console mapping to their guest OS kernel parameters.

This requires libkrun/libkrun#914
This is built over #116. I'll rebase this one when that gets merged

This PR adds experimental support for launching virtual machines on Windows hosts using libkrun 2.0 and the Windows Hypervisor Platform (WHP).

1. Added build.rs link instructions using LIBKRUN_LIB_DIR for krun.dll.lib lookup on Windows and a build.ps1 helper script for local development on Windows.

2. Restricted timesync module to macOS only

3. Splitted context/virtio/status to have platform-specific
   implementations. The macOS part remained unchanged.

This patch misses the firmware for x86_64 systems. It depends on slp/edk2#2
It will be added in following PR

Assisted-by: OpenCode: GPT-5.6 Terra
Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
Add a `--console` command-line argument for Windows builds to allow selecting
the guest console device attached to the host terminal (`ttyS0` or `hvc0`).

Assisted-by: OpenCode: GPT-5.6 Terra
Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant