Files
matchbox/docs/grub.md
2019-11-23 15:09:33 -08:00

1.5 KiB

GRUB2 netboot

Use GRUB to network boot UEFI hardware.

Requirements

For local development, install the dependencies for libvirt with UEFI.

Ensure that you've gone through the matchbox with docker and matchbox guides and understand the basics.

Containers

Run matchbox according to matchbox with Docker, but mount the grub group example. Then start the poseidon/dnsmasq Docker image, which bundles a grub.efi.

$ sudo docker run --rm --cap-add=NET_ADMIN quay.io/poseidon/dnsmasq -d -q --dhcp-range=172.17.0.43,172.17.0.99 --enable-tftp --tftp-root=/var/lib/tftpboot --dhcp-match=set:efi-bc,option:client-arch,7 --dhcp-boot=tag:efi-bc,grub.efi --dhcp-userclass=set:grub,GRUB2 --dhcp-boot=tag:grub,"(http;matchbox.foo:8080)/grub","172.17.0.2" --log-queries --log-dhcp --dhcp-option=3,172.17.0.1 --dhcp-userclass=set:ipxe,iPXE --dhcp-boot=tag:pxe,undionly.kpxe --dhcp-boot=tag:ipxe,http://matchbox.foo:8080/boot.ipxe --address=/matchbox.foo/172.17.0.2

Client VM

Create UEFI VM nodes which have known hardware attributes.

$ sudo ./scripts/libvirt create-uefi

Create a VM to verify the machine network boots.

$ sudo virt-install --name uefi-test --boot=uefi,network --disk pool=default,size=4 --network=bridge=docker0,model=e1000 --memory=1024 --vcpus=1 --os-type=linux --noautoconsole