Add macOS support to the vagrant role - #1981
Open
Odilhao wants to merge 1 commit into
Open
Conversation
The vagrant role only ever bootstrapped Fedora/CentOS with libvirt. There's no way to run a Vagrant-managed VM on macOS, and the libvirtd/virtnetworkd/group setup from docs/vagrant.md was still a manual step even on Linux. Split the role into linux.yml and macos.yml, dispatched from main.yml the way roles/umask and roles/foreman_repositories already do it: - linux.yml keeps the existing COPR/vagrant-libvirt install, and now also enables libvirtd and virtnetworkd and adds the invoking user to the libvirt group, so nothing from docs/vagrant.md is left as a manual step. - macos.yml installs Vagrant, qemu, socket_vmnet, and the vagrant-qemu and vagrant-hostmanager plugins through Homebrew, and starts the socket_vmnet daemon. socket_vmnet holds the root vmnet.framework membership itself, so `vagrant up` never needs to run under sudo, unlike vagrant-qemu's other vmnet backends. New vagrant_qemu default variable mirrors vagrant_libvirt to gate the macOS path the same way. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2 tasks
Odilhao
added a commit
to Odilhao/foreman-quadlet
that referenced
this pull request
Aug 17, 2026
foremanctl's containers are x86_64-only, and there was no way to run forge on Apple Silicon at all: no host bootstrap step (theforeman#685), and vagrant-qemu needs a different box format and networking setup than vagrant-libvirt. Adds `forge host-setup`, which installs Vagrant and a hypervisor provider (libvirt on Linux, vagrant-qemu on macOS) through forklift's vagrant role. On Apple Silicon the Vagrantfile now boots a native arm64 CentOS Stream 10 guest through vagrant-qemu instead of emulating the whole VM, with socket_vmnet giving it a real IP the way libvirt does on Linux, and vagrant-hostmanager keeping /etc/hosts in sync so the UI is reachable by hostname like it already is on Linux. A new container_binfmt role registers qemu-user-static on the guest so it can still run the existing x86_64 container images. Only the quadlet VM is supported this way for now; client/database/proxy still need libvirt. Running ./forge test against the qemu VM currently fails several API tests, because the suite assumes the Foreman API is reachable at the same address as SSH, which holds for libvirt but not for vagrant-qemu's separate NAT and vmnet interfaces. Not fixed here. Depends on theforeman/forklift#1981.
Odilhao
added a commit
to Odilhao/foreman-quadlet
that referenced
this pull request
Aug 17, 2026
foremanctl's containers are x86_64-only, and there was no way to run forge on Apple Silicon at all: no host bootstrap step (theforeman#685), and vagrant-qemu needs a different box format and networking setup than vagrant-libvirt. Adds `forge host-setup`, which installs Vagrant and a hypervisor provider (libvirt on Linux, vagrant-qemu on macOS) through forklift's vagrant role. On Apple Silicon the Vagrantfile now boots a native arm64 CentOS Stream 10 guest through vagrant-qemu instead of emulating the whole VM, with socket_vmnet giving it a real IP the way libvirt does on Linux, and vagrant-hostmanager keeping /etc/hosts in sync so the UI is reachable by hostname like it already is on Linux. A new container_binfmt role registers qemu-user-static on the guest so it can still run the existing x86_64 container images. Only the quadlet VM is supported this way for now; client/database/proxy still need libvirt. Running ./forge test against the qemu VM currently fails several API tests, because the suite assumes the Foreman API is reachable at the same address as SSH, which holds for libvirt but not for vagrant-qemu's separate NAT and vmnet interfaces. Not fixed here. Depends on theforeman/forklift#1981.
Odilhao
added a commit
to Odilhao/foreman-quadlet
that referenced
this pull request
Aug 17, 2026
foremanctl's containers are x86_64-only, and there was no way to run forge on Apple Silicon at all: no host bootstrap step (theforeman#685), and vagrant-qemu needs a different box format and networking setup than vagrant-libvirt. Adds `forge host-setup`, which installs Vagrant and a hypervisor provider (libvirt on Linux, vagrant-qemu on macOS) through forklift's vagrant role. On Apple Silicon the Vagrantfile now boots a native arm64 CentOS Stream 10 guest through vagrant-qemu instead of emulating the whole VM, with socket_vmnet giving it a real IP the way libvirt does on Linux, and vagrant-hostmanager keeping /etc/hosts in sync so the UI is reachable by hostname like it already is on Linux. A new container_binfmt role registers qemu-user-static on the guest so it can still run the existing x86_64 container images. Only the quadlet VM is supported this way for now; client/database/proxy still need libvirt. Running ./forge test against the qemu VM currently fails several API tests, because the suite assumes the Foreman API is reachable at the same address as SSH, which holds for libvirt but not for vagrant-qemu's separate NAT and vmnet interfaces. Not fixed here. Depends on theforeman/forklift#1981.
Odilhao
added a commit
to Odilhao/foreman-quadlet
that referenced
this pull request
Aug 20, 2026
foremanctl's containers are x86_64-only, and there was no way to run forge on Apple Silicon at all: no host bootstrap step (theforeman#685), and vagrant-qemu needs a different box format and networking setup than vagrant-libvirt. Adds `forge host-setup`, which installs Vagrant and a hypervisor provider (libvirt on Linux, vagrant-qemu on macOS) through forklift's vagrant role. On Apple Silicon the Vagrantfile now boots a native arm64 CentOS Stream 10 guest through vagrant-qemu instead of emulating the whole VM, with socket_vmnet giving it a real IP the way libvirt does on Linux, and vagrant-hostmanager keeping /etc/hosts in sync so the UI is reachable by hostname like it already is on Linux. A new container_binfmt role registers qemu-user-static on the guest so it can still run the existing x86_64 container images. Only the quadlet VM is supported this way for now; client/database/proxy still need libvirt. Running ./forge test against the qemu VM currently fails several API tests, because the suite assumes the Foreman API is reachable at the same address as SSH, which holds for libvirt but not for vagrant-qemu's separate NAT and vmnet interfaces. Not fixed here. Depends on theforeman/forklift#1981.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Needed for theforeman/foremanctl#685, which asks for a
forge bootstrap-vagrantcommand to bootstrap Vagrant and a hypervisor provider instead of pointing people at docs/vagrant.md. Used by theforeman/foremanctl#757.The vagrant role only ever handled Fedora/CentOS with libvirt. This adds a macOS path (Vagrant, qemu, socket_vmnet, and the vagrant-qemu/vagrant-hostmanager plugins, all through Homebrew), and finishes automating the Linux path too: enabling libvirtd/virtnetworkd and adding the user to the libvirt group were still manual steps from docs/vagrant.md before this.
Tested end to end deploying foremanctl's dev VM on an Apple Silicon Mac.