feat(hyperv): implement Hyper-V image build via QEMU/KVM #297
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces an alternative implementation for building Hyper-V Vagrant boxes using QEMU/KVM. This allows Hyper-V images to be built on Linux hosts, removing the dependency on a Windows host running the Hyper-V hypervisor.
To achieve this, the build process produces a RAW disk image via QEMU, which is subsequently converted to VHDX and packaged.
Changes:
qemu.almalinux-*-hyperv-x86_64) for AlmaLinux 8, 9, 10, and Kitten. These sources utilize QEMU/KVM guest definitions combined with Vagrant-specific configurations (boot commands, credentials, and Ansible playbooks).shell-localpost-processor in Packer to convert the resulting QEMU RAW artifact into a VHDX-based Vagrant box.tools/raw-to-vagrant-hyperv.shhelper script to handle the RAW-to-VHDX conversion and tar+gzip packaging.tpl/vagrant/hyperv/box.xmlas the common Vagrant box configuration template for Hyper-V.ansible/hyperv.ymlplaybook to configure the QEMU guest for Hyper-V compatibility.ansible/roles/hyperv_guest/tasks/main.ymlto:qemu-guest-agentpackage to prevent conflicts.initramfsto includehv_netvscandhv_storvscdrivers (specifically for AL8).variables.pkr.hclwithhyperv_boot_command_*_x86_64variables.CI: