Below is information on how you can deploy your image after building.
There are many solutions to deploy a virtual machine image and this document does not encompass all of them.
qcow
: QEMU is the primary software that utilizes both the QCOW and QCOW2 formats. These formats allow you to create, manage, and run virtual machines with features like better performance and snapshot capabilities. QEMU.raw
: The raw image format is widely supported across many virtualization tools and cloud server providers. Software like KVM, VMware, and cloud platforms including AWS and Azure can utilize raw images. Libvirt, often used with KVM, also supports raw images extensively. Libvirt.anaconda-iso
: BalenaEtcher is recommended for writing unattended ISO installer files to storage devices to create bootable media. It's user-friendly and cross-platform. Download balenaEtcher.vmdk
: VMware Workstation and VMware ESXi are two prominent platforms that support the VMDK format. They provide comprehensive tools for running and managing virtual machines. VMware Workstation, VMware ESXi.ami
: Amazon EC2 uses the AMI format to launch new virtual servers. You can manage AMIs using Amazon's own tools like AWS Management Console. Amazon EC2.vhd
: Usable on multiple applications such as Microsoft Hyper-V and Azure.
qemu which emulates the architecture.
Installation:
brew install qemu
Usage:
Important note: Assuming you are running the example application, the command will port forward local port 8080 to 80. This can be changed in the below qemu
command.
- Build a RAW image
- Run the following command:
# Change to your VM image location
export DISK_IMAGE=/Users/myusername/bootc/image/disk.raw
# Run the qemu command
# note the 8080:80 port forwarding
qemu-system-aarch64 \
-m 8G \
-M virt \
-accel hvf \
-cpu host \
-smp 4 \
-serial mon:stdio \
-nographic \
-netdev user,id=usernet,hostfwd=tcp::8080-:80 \
-device virtio-net,netdev=usernet \
-drive file=/opt/homebrew/share/qemu/edk2-aarch64-code.fd,format=raw,if=pflash,readonly=on \
-drive file=$DISK_IMAGE,if=virtio,cache=writethrough,format=raw
curl
your local port to check VM accesscurl localhost:8080
- To exit the terminal, type:
Ctrl+a
thenx
vfkit which uses the native Apple hypervisor framework.
NOTE: This will only run NATIVE architecture images. Your image must use the ARM64 output.
Installation:
brew tap cfergeau/crc
brew install vfkit
Usage:
- Build a RAW image
- Run the following command:
# Change to your VM image location
export DISK_IMAGE=/Users/myusername/bootc/image/disk.raw
# Launch VFkit
vfkit --cpus 2 --memory 2048 \
--bootloader efi,variable-store=./efi-variable-store,create \
--device virtio-blk,path=$DISK_IMAGE \
--device virtio-serial,stdio \
--device virtio-net,nat,mac=72:20:43:d4:38:62 \
--device virtio-rng \
--device virtio-input,keyboard \
--device virtio-input,pointing \
--device virtio-gpu,width=1920,height=1080 \
--gui
qemu which emulates the architecture.
Installation:
brew install qemu
Usage:
Important note: Assuming you are running the example application, the command will port forward local port 8080 to 80. This can be changed in the below qemu
command.
- Build a RAW image
- Run the following command:
# Change to your VM image location
export DISK_IMAGE=/Users/myusername/bootc/image/disk.raw
# Run the qemu command
# note the 8080:80 port forwarding
qemu-system-x86_64 \
-m 8G \
-cpu Broadwell-v4 \
-nographic \
-netdev user,id=usernet,hostfwd=tcp::8080-:80 \
-device virtio-net,netdev=usernet \
-snapshot $DISK_IMAGE
curl
your local port to check VM accesscurl localhost:8080
- To exit the terminal, type:
Ctrl+a
thenx