All checks were successful
Run Check Script / check (pull_request) Successful in 1m32s
Example: Linux VM from ISO
This example deploys a simple Linux virtual machine from an ISO URL.
What it creates
- One isolated virtual network (
linuxvm-net, 192.168.101.0/24) - One Ubuntu Server VM with the ISO attached as a CD-ROM
- The VM is configured to boot from the CD-ROM first, allowing installation
- After installation, the VM can be rebooted to boot from disk
Prerequisites
- A running KVM hypervisor (local or remote)
HARMONY_KVM_URIenvironment variable pointing to the hypervisor (defaults toqemu:///system)HARMONY_KVM_IMAGE_DIRenvironment variable for storing VM images (defaults to harmony data dir)
Usage
cargo run -p example_linux_vm
After deployment
Once the VM is running, you can connect to its console:
virsh -c qemu:///system console linux-vm
To access the VM via SSH after installation, you'll need to configure a bridged network or port forwarding.
Clean up
To remove the VM and network:
virsh -c qemu:///system destroy linux-vm
virsh -c qemu:///system undefine linux-vm
virsh -c qemu:///system net-destroy linuxvm-net
virsh -c qemu:///system net-undefine linuxvm-net