Skip to content
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

Add applehv provisioning documentation #711

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Binary file added modules/ROOT/assets/images/vfkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
** xref:provisioning-gcp.adoc[Booting on GCP]
** xref:provisioning-hyperv.adoc[Booting on Hyper-V]
** xref:provisioning-ibmcloud.adoc[Booting on IBM Cloud]
** xref:provisioning-applehv.adoc[Booting on macOS]
** xref:provisioning-kubevirt.adoc[Booting on KubeVirt]
** xref:provisioning-libvirt.adoc[Booting on libvirt]
** xref:provisioning-openstack.adoc[Booting on OpenStack]
Expand Down
57 changes: 57 additions & 0 deletions modules/ROOT/pages/provisioning-applehv.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
= Provisioning Fedora CoreOS on AppleHV

This guide shows how to provision new Fedora CoreOS (FCOS) instances on macOS using https://github.com/crc-org/vfkit[vfkit].


== Prerequisites

Before provisioning an FCOS machine, you must have an Ignition configuration file containing your customizations. If you do not have one, see xref:producing-ign.adoc[Producing an Ignition File].

You will also need to build or acquire https://github.com/crc-org/vfkit[vfkit]. Prebuilt binaries are also available from its https://github.com/crc-org/vfkit/releases/tag/v0.6.0[releases] page. Vfkit, like QEMU, has many options which are outside the scope of this provisioning example. Please consider reading their https://github.com/crc-org/vfkit/tree/main/doc[documentation].

== Booting a new VM on macOS

This section shows how to boot a new VM with vfkit. Vfkit is known to work with both Intel and Apple Silicon based Macs.

=== Fetching the AppleHV image

Fetch the latest image suitable for your target stream (or https://fedoraproject.org/coreos/download/[download and verify] it from the web). Remember to download the appropriate image based on the architecture of your Mac. Once downloaded, you will also need to decompress the image.

=== Setting up a new VM

Vfkit is not a stateful virtual machine framework. You simply need to run the vfkit binary to start a virtual machine. The following command line will launch a VM with:

* 2 virtual CPUs
* 2 GB of memory
* a network device that will receive a IP address from Vfit
* a GUI console with keyboard and mouse support

.Launching FCOS with Vfkit
[source, bash]
----
IGNITION_CONFIG="/path/to/example.ign"
IMAGE="/path/to/image.qcow2"

./vfkit --cpus 2 --memory 2048 \
--bootloader efi,variable-store=efi-variable-store,create \
--device virtio-blk,path=${IMAGE} \
--device virtio-net,nat \
--ignition ${IGNITION_CONFIG} \
Copy link
Member

Choose a reason for hiding this comment

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

interesting that vfkit supports an --ignition arg. neat.

--device virtio-input,keyboard \
--device virtio-input,pointing \
--device virtio-gpu,width=800,height=600 \
--gui
----

Note: The AppleHV hypervisor does not allow you to see early boot and kernel messages. While you will see a GRUB boot menu, you will not see anything until later in the boot.

=== Exploring the OS

image::vfkit.png[Vfkit GUI]

When FCOS is completed booting, you will see the IP address of the VM displayed in the GUI window. Vfkit will lease an address in the `192.168.64.0/24` network. At this point, you can either choose to login or SSH to the VM. Unlike some other virtualization providers, you can SSH to the virtual machine from the host.

[source, bash]
----
ssh [email protected]

Choose a reason for hiding this comment

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

I haven't looked at the doc explaining how to geneate the ignition file, but does the ssh key need to be explicitly specified here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no it doesnt assuming you use a key in a place you know the system will look. in my case, i used an existing key in ~/.ssh

----