-
-
Notifications
You must be signed in to change notification settings - Fork 0
How to Use This Repo
The files contained in this repository will not work on their own. Unfortunately due to Apple's EULA, we can't distribute the actual Vagrant .box
file that this repository's code references. You will have to build your own QEMU image for use with the open source libvirt
& qemu
tools.
Thanks to the OSX-KVM project, this has become much easier.
The steps to create an image for use with KVM, libvirt
and QEMU are documented at the following link:
Once you have a working QCOW2 .img
file, and libvirt
VM (.xml
definition for use with virsh
), you are ready to create a Vagrant Box as usual.
There is a helper script, package.sh
in this repo which helps to run the same packaging command used to create the private LyraPhase-runner box. To use this:
- Optional: Edit the
Vagrantfile
and change any settings you may wish.
- This
Vagrantfile
will be packaged as default settings for distribution inside the.box
file. - For example, you may wish to:
- Change the box name:
config.vm.box
- Change the hostname:
config.vm.hostname
- Change the NVRAM file path or name:
libvirt.nvram
- Assign more RAM:
libvirt.memory
- Change number of CPUs:
CPU_SOCKETS
,CPU_CORES
,CPU_THREADS
(Hint: Stick to a supported well-known CPU topology for your Host)
- Change the box name:
- It's not recommended to stray too far away from the default hardware configuration, unless you are experienced at using
libvirt
VM definitions for macOS
- Edit
info.json
:
- Replace
author
with your Vagrant Cloud or CI/CD username
-
Run
package.sh
and pass it your.box
output filename:./package.sh exampleuser-monterey-12-1-base.box
-
Use for any testing, CI/CD projects that need a MacOS VM!
- Plain Vagrant Box:
- Place a
Vagrantfile
that references your.box
URL and/or name in your project's directory - Run
vagrant up
as usual
- Place a
- Test Kitchen:
-
Install
vagrant-libvirt
Vagrant plugin:vagrant plugin install vagrant-libvirt
-
Place a
.kitchen.libvirt.yml
in your cookbook's directory -
Under
driver
settings, set:driver: vagrant
, &provider: libvirt
driver: name: vagrant provider: libvirt
-
Reference the
.box
URL and/or name for any per-host MacOS platforms under test:platforms: - name: macos-12.1 lifecycle: pre_converge: - remote: sudo mkdir -p /tmp/kitchen - remote: sudo chown -R vagrant:vagrant /tmp/kitchen driver: box: exampleuser/monterey-12-1-base box_url: http://example-privatehost.local:8888/exampleuser-monterey-12-1-base.box communicator: ssh gui: true customize: memory: 4096