/vagrant-blank-box

An empty Vagrant box to test PXE booting over the network, or booting from local ISO files

Primary LanguageMakefileApache License 2.0Apache-2.0

Vagrant blank box

An empty box to test PXE booting over the network, or booting from local ISO files. And possibly attach USB devices, or allocate some storage on local attached disks.

Our goal is to have a virtual box with 2 vCPU, 1 GB RAM, 2x CD/DVD ROM drives, 4x network adapters, 4x storage devices, and an enabled USB controller. The boot order should be:

  • Removable devices
  • CD-ROM drive
  • Hard drive
  • Network

The hardware should be compatible with Linux 3.x, which is good as far back as CentOS 7 and Ubuntu 16.04.

Import this box locally

vagrant box add blank-box.json --provider vmware_desktop
vagrant box add blank-box.json --provider virtualbox

Oracle Virtualbox

After creating the VM with Virtualbox use Vagrants built-in awesome support for Virtualbox to package it up:

vagrant package --base blank --output blank-virtualbox.box

The image file is a gzip compressed tarball. For the sake of version control we have extracted the contents into blank-virtualbox. Vagrant packages the Virtualbox up like so:

Vagrantfile
box-disk001.vmdk
box-disk002.vmdk
box-disk003.vmdk
box-disk004.vmdk
box.ovf

After this we added a metadata.json file because the documentation says it should be there, and also removed the base_mac hardcoded generated value in Vagrantfile.

VMware Workstation Pro

The lowest common version that supports these features is Workstation 14.x (compatible with ESX1 6.7 and Fusion 10.x)

  • NVMe devices
  • UEFI Secure Boot
  • Trusted Platform Module (TPM)
  • I/O MMU virtualization

The contents of the Vagrant box is documented in https://www.vagrantup.com/docs/providers/vmware/boxes#contents

The files that are strictly required for a VMware machine to function are: nvram, vmsd, vmx, vmxf, and vmdk files.

There is also the metadata.json file used by Vagrant itself.

Once we have created a suitable virtual machine in VMware Workstation we have:

blank-disk1.vmdk
blank-disk2.vmdk
blank-disk3.vmdk
blank-disk4.vmdk
blank.vmsd
blank.vmx
blank.vmxf
blank.vmx.lck

Notably missing is the nvram file but it seems that we do without it. We will also skip the lck directory.