Skip to content

Add QEMU on Windows to CI #3475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ jobs:
run: sudo make uninstall

windows:
name: "Windows tests"
runs-on: windows-2022-8-cores
name: "Windows tests (WSL2)"
runs-on: windows-2025-8-cores
timeout-minutes: 30
steps:
- name: Enable WSL2
Expand Down Expand Up @@ -175,6 +175,40 @@ jobs:
$env:_LIMA_WINDOWS_EXTRA_PATH = 'C:\Program Files\Git\usr\bin'
bash.exe -c "./hack/test-templates.sh templates/experimental/wsl2.yaml"

windows-qemu:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we now drop these lines?

if runtime.GOOS == "windows" && runtime.GOARCH == "amd64" {
// https://github.com/lima-vm/lima/pull/3487#issuecomment-2846253560
// > #931 intentionally prevented the code from setting it to max when running on Windows,
// > and kept it at qemu64.
//
// TODO: remove this if "max" works with the latest qemu
defaultX8664 = "qemu64"
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my experience "max" just didn't work well with WHPX acceleration. I tested it on 3 different machines in the past. I only was able to make it work by disabling specific CPU features, which were different on every machine. It was not user friendly default. I can do some canary testing to compare how it works now with newer QEMU/Windows versions and if the failures are as common as they were before.

name: "Windows tests (QEMU)"
runs-on: windows-2025-8-cores
timeout-minutes: 30
steps:
- name: Set gitconfig
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# To avoid "can't parse builtin Lima version" errors
fetch-depth: 0
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
go-version: 1.24.x
- name: Unit tests
run: go test -v ./...
- name: Make
run: make
- name: Install QEMU
run: |
winget install --silent --accept-source-agreements --accept-package-agreements --disable-interactivity SoftwareFreedomConservancy.QEMU
- name: Integration tests (QEMU, Windows host)
run: |
$env:PATH = "$pwd\_output\bin;" + 'C:\msys64\usr\bin;' + 'C:\Program Files\QEMU;' + $env:PATH
pacman -Sy --noconfirm openbsd-netcat diffutils
$env:MSYS2_ENV_CONV_EXCL = 'HOME_HOST;HOME_GUEST;_LIMA_WINDOWS_EXTRA_PATH'
$env:HOME_HOST = $(cygpath.exe "$env:USERPROFILE")
$env:HOME_GUEST = "$env:HOME_HOST"
$env:LIMACTL_CREATE_ARGS = '--vm-type=qemu'
$env:_LIMA_WINDOWS_EXTRA_PATH = 'C:\Program Files\Git\usr\bin'
bash.exe -c "./hack/test-templates.sh templates/default.yaml"

qemu:
name: "Integration tests (QEMU, macOS host)"
runs-on: macos-15-large # Intel
Expand Down
Loading