Skip to content

Validation rules ​

vz checks a lab file in two stages before it creates anything. First it loads the file: YAML syntax, the known keys, and the type and format of each value. Then it validates the lab: names, ranges, references between sections, link ends, subnets, DHCP reservations, port forwarding, vmnet limits, and each node's platform. This page lists every problem each stage reports and how to fix it.

How problems are reported ​

bash
vz validate            # text
vz validate --json     # a ValidationReport, see the CLI reference
  • Location. Each problem has a path into the file, such as nodes[2].interfaces[1].attach or switches.mgmt.ipv4Subnet. List positions start at 0.
  • Severity. An error stops validate, up and node reset with exit code 1. A warning is printed but does not stop anything.
  • All at once. Validation collects every problem, so you see all of them in one run. Loading stops at the first problem, because the rest of the file cannot be read reliably after it. Fix load errors first.
  • Output. One problem is printed as a single alert. Several are printed as a table with severity, location and message.
CommandLoadsValidates
validateyesyes, errors and warnings shown
up, node resetyesyes; warnings shown, errors stop the command
down, destroy, topology, node ..., link, port, media, usbyesno

TIP

Run vz validate after every edit. It is fast, needs no running lab and changes nothing.

Load errors ​

These come from reading and decoding the file. The location is the key where decoding stopped.

MessageCauseFix
cannot read <path>: no such fileThe lab file does not exist.Run from the lab's folder or pass -f <file>.
cannot read <path>: <reason>The file exists but cannot be read.Check permissions and encoding (UTF-8).
YAML syntax error: ...Malformed YAML.Fix indentation, quotes or brackets at the line shown.
missing required key '<key>'A required key is absent.Add it. Required: schemaVersion, name, nodes; per node name, disks; per share tag, path; per display width, height; per interface name; per USB device vendorId, productId; per reservation mac, ipv4; per forwarding rule protocol, hostPort, address, guestPort; per storage path.
unknown key '<key>' (allowed: ...)A key vz does not know, often a typo.Use one of the allowed keys listed in the message.
expected a string, expected true or false, expected a number, expected a list, expected a mappingThe value has the wrong type.Write the value in the expected form. Quote MAC addresses.
expected ..., found nullA key with no value (memory:).Give it a value or remove the key.
'<value>' is not an allowed valueAn enum key such as bus, caching, sync, protocol or family has another value.See the allowed values in the lab file reference.
'<value>' is not a size; use a number with B, KiB, MiB, GiB or TiB, e.g. 2GiBBad size.Use whole numbers and binary units, for example 512MiB. 2GB and 1.5GiB are not accepted.
'<value>' is not a valid attach value, expected switch/<name> or link/<name>Bad attach.Use switch/<name> or link/<name>.
'<value>' is not a MAC address, expected e.g. 52:54:00:0a:00:01Bad MAC.Six two-digit hex pairs separated by :.
'<value>' is not an IPv4 addressBad ipv4 in a reservation.Dotted quad, for example 10.30.0.11.
'<value>' is not an IPv4 subnet, expected e.g. 10.0.1.0/24Bad ipv4Subnet.CIDR notation.
'<value>' is not an IPv6 prefix, expected e.g. fd00:10:1::/64Bad ipv6Prefix.An IPv6 address, /, and 0 to 128.
'<value>' is not a USB id, expected e.g. 0x0403A USB id string that is not 0x and four hex digits.Write 0x0403 (a YAML number) or "0x0403".
USB id <n> is out of range 0...0xffffA USB id number that does not fit 16 bits.Use the id from the device.

Validation errors and warnings ​

Top level ​

LocationSeverityMessageFix
schemaVersionerrorunsupported schemaVersion N, this vz reads version 27Set schemaVersion: 27, or update vz.
nameerrorinvalid lab nameLowercase letters, digits and -, starting with a letter, up to 63 characters.
stateerrormust not be emptyRemove the key or give a path.
stateerror... cannot be the state directory: vz destroy deletes it, and it holds the lab file or your filesGive the state its own folder, for example state: ./.vz-state. Also checked for --state.
stateerrorthe state directory path is too long for its control socket (N of 103 bytes)Use a shorter state: path or lab name, or a shorter VZ_HOME.
nodeswarningthe lab has no nodesAdd a node.

Storages ​

LocationSeverityMessageFix
storages.<name>errorinvalid storage nameFollow the name rules.
storages.<name>.patherrormust not be emptyGive a file path.
storages.<name>.patherrorunknown disk format: use .asif, .raw, .img, .iso or .ipswUse one of those extensions.
storages.<name>.sizeerroran ISO image cannot be created; remove sizeRemove size.
storages.<name>.sizeerrora restore image cannot be created; remove sizeRemove size.
storages.<name>.sizeerrormust be larger than 0Give a real size.
storages.<name>warningwritable storage is used by 'a', 'b'; do not run them at the same timeUse readOnly: true or overlay: true on all but one, or do not start them together.

Nodes ​

LocationSeverityMessageFix
nodes[i].nameerrorinvalid node nameFollow the name rules.
nodes[i].nameerrorduplicate node name, already used by nodes[k]Rename one.
nodes[i].cpuserrormust be at least 1Use 1 or more.
nodes[i].memoryerrormust be a non-zero multiple of 1MiBFor example 1GiB or 1536MiB.
nodes[i].nestedVirtualizationwarningthis Mac does not support nested virtualization (needs M3 or newer)Remove it, or run on an M3 or newer Mac. vz up fails on this Mac.
nodes[i].initerrormust not be emptyRemove the key or give a path.
nodes[i].displays[j].widtherrormust be in 320...8192
nodes[i].displays[j].heighterrormust be in 200...8192
nodes[i].clipboarderrorclipboard needs at least one displayAdd a display or remove clipboard.
nodes[i].soundwarningboth output and input are false; remove sound or enable one
nodes[i].usb[j]warningdevice ... is listed twiceRemove the duplicate.

Platforms ​

Each node's platform adds its own rules. The platform table checks the name and the host limits; the rest comes from that platform.

LocationSeverityMessageFix
nodes[i].platformerrorunknown platform '...'; use apple or genericUse a known platform, or remove the key for generic.
nodeserrorN apple nodes (...); one Mac runs at most 2 at a timeApple's license allows two macOS VMs per Mac.
nodes[i].disks[j]errora .ipsw restore image installs macOS; it needs platform: applegeneric: remove the .ipsw, or set platform: apple.
nodes[i].platformwarningmacOS guests are experimental: the install has not been tested end to end yetapple: shown for every macOS node.
nodes[i].rosettaerrorthe Rosetta share is for Linux guests; macOS has Rosetta built inapple: remove rosetta.
nodes[i].nestedVirtualizationerrornested virtualization needs platform: genericapple: remove it.
nodes[i].secureBooterrorsecureBoot is a UEFI setting; macOS boots with Apple's own secure bootapple: remove it.
nodes[i].clipboarderrorclipboard sharing needs a SPICE agent in the guest, and macOS has noneapple: remove it.
nodes[i].displayserrormacOS needs a display for its installer and login windowapple: remove displays: [].
nodes[i].consoleLogwarningmacOS writes nothing to vz's serial consoleapple: remove consoleLog; use vz node display.
nodes[i].diskserrorlist one restore image (.ipsw), not Napple: keep one .ipsw.
nodes[i].diskserrormacOS needs a disk to install onto: add a writable disk with a size, for exampleapple: add that disk.
nodes[i].disks[j]errormacOS installs onto the first disk that is not a .ipsw: make it writable, without overlay, for exampleapple: remove overlay and readOnly from that disk, or put another disk first.
nodes[i].initerrorfor platform apple, init must be a #cloud-config file / not valid YAML / the first user under users needs a name / macOS needs a password for user ...: set plain_text_passwd / cannot read ...apple: fix the user-data file. See init.
nodes[i].initwarningmacOS uses only users and ssh_pwauth from init; ignored: ...apple: other cloud-config keys do nothing on macOS.
nodes[i].initwarningmacOS creates only the first user, ... / macOS ignores these keys of user ...: ... / ssh_pwauth needs a user under users; without one, Setup Assistant runsapple: informational.

Disks ​

LocationSeverityMessageFix
nodes[i].diskserrora node needs at least one diskAdd a disk.
nodes[i].disks[j]errorset either path or storageAdd one of them.
nodes[i].disks[j]errorset either path or storage, not bothRemove one.
nodes[i].disks[j].patherrormust not be empty / unknown disk formatUse .asif, .raw, .img, .iso or .ipsw.
nodes[i].disks[j].sizeerroran ISO image cannot be created; remove size
nodes[i].disks[j].sizeerrora restore image cannot be created; remove size
nodes[i].disks[j].overlayerrora restore image is installer media; remove overlay and cacheA .ipsw is read by the macOS installer, never layered.
nodes[i].disks[j].sizeerrormust be larger than 0
nodes[i].disks[j].sizewarningsize only creates missing files or grows overlays, but the disk is read-onlyRemove size or readOnly.
nodes[i].disks[j].sizeerrorsize belongs to the storage definition, not to the diskMove size to the storage.
nodes[i].disks[j].storageerrorunknown storageDefine it under storages.
nodes[i].disks[j].readOnlywarningISO images are always attached read-only; add readOnly: trueAdd readOnly: true.
nodes[i].disks[j].cacheerrorcache needs overlay: trueAdd overlay: true or remove cache.
nodes[i].disks[j].connectederroronly USB disks can be connected or disconnectedUse bus: usb or remove connected.
nodeswarning'<file>' is written by 'a' and also used by 'a', 'b'; do not run them at the same timeA writable disk file (no readOnly, no overlay) is shared. Use an overlay, make it read-only, or do not start the nodes together.

Shares ​

LocationSeverityMessageFix
nodes[i].shares[j].tagerrorinvalid tag: use letters, digits, '.', '_' and '-' (max 36)Must start with a letter or digit.
nodes[i].shares[j].tagerrortag 'rosetta' is reservedPick another tag. Use rosetta: true for Rosetta.
nodes[i].shares[j].tagerrorduplicate tag, already used by shares[k]Tags are unique per node.
nodes[i].shares[j].patherrormust not be empty

Interfaces ​

LocationSeverityMessageFix
nodes[i].interfaces[j].nameerrorinvalid interface nameA letter, then letters, digits, ., _, -; up to 15 characters.
nodes[i].interfaces[j].nameerrorduplicate interface nameNames are unique per node.
nodes[i].interfaces[j].macerror... is a multicast address; the first byte must be evenUse a unicast MAC, for example 52:54:00:....
nodes[i].interfaces[j].macerrorMAC ... is already used by node/interfaceEvery written MAC must be unique in the lab.
nodes[i].interfaces[j].connectederrora free interface (no attach) cannot be connected or disconnectedAdd attach or remove connected.
nodes[i].interfaces[j].attacherrorunknown switch '...' / unknown link '...'Define it under switches or links, or fix the name.
nodes[i].interfaceswarningN interfaces on switches; vmnet documents a limit of 4 per VM, links are not limitedUse links, or fewer switch NICs, if the node fails to start.
switcheswarningN interfaces on switches in total; vmnet documents a limit of 32Same.
LocationSeverityMessageFix
links.<name>errorinvalid link nameFollow the name rules.
links.<name>.mtuerrormust be in 1280...65535
links.<name>.bufferwarningunusual buffer size; 1MiB to 256MiB is expectedRemove buffer to use the default.
links.<name>warninglink is not used by any interfaceAttach two NICs, or remove it.
links.<name>errorlink has only one end; a cable needs exactly twoAttach a second NIC on another node.
links.<name>errorboth ends are on node '...'; a cable must join two different nodesMove one end to another node.
links.<name>errorlink has N ends; a cable joins exactly two, use a switch for moreUse a switch.
links.<name>warningends disagree: ... starts connected, ... starts disconnectedSet the same connected on both ends.

Switches ​

LocationSeverityMessageFix
switches.<name>errorinvalid switch nameFollow the name rules.
switches.<name>.mtuerrormust be in 1280...65535
switches.<name>.ipv4Subneterror/N is too small; use /30 or largerUse a shorter prefix, such as /24.
switches.<name>.ipv4Subnetwarning... has host bits set; ... will be usedWrite the network address, for example 10.30.0.0/24.
switches.<second>.ipv4Subneterror... overlaps ... of switch '<first>'Give each switch its own range.
switches.<name>warningswitch has no interfaces attachedAttach a NIC, or remove the switch.

DHCP reservations ​

LocationSeverityMessageFix
switches.<name>.dhcpReservationserrorreservations need dhcp: trueRemove dhcp: false or the reservations.
switches.<name>.dhcpReservations[k].macerrorno interface on switch '...' has MAC ...; set the same mac on the interfaceWrite the same mac on the interface that attaches to this switch.
switches.<name>.dhcpReservations[k].macerrorMAC ... is already reserved by dhcpReservations[m]One reservation per MAC.
switches.<name>.dhcpReservations[k].ipv4error... is already reserved by dhcpReservations[m]One reservation per address.
switches.<name>.dhcpReservations[k].ipv4error... is outside <subnet>Use an address inside ipv4Subnet.
switches.<name>.dhcpReservations[k].ipv4error... is the network or broadcast addressUse a host address.
switches.<name>.dhcpReservations[k].ipv4error... is the Mac's address on this switchThe first host (.1 in a /24) belongs to the Mac.

Port forwarding ​

LocationSeverityMessageFix
switches.<name>.portForwardingerrorport forwarding needs NAT; set nat4 or nat6 to true
switches.<name>.portForwarding[k].hostPorterrormust be in 1...65535
switches.<name>.portForwarding[k].guestPorterrormust be in 1...65535
switches.<name>.portForwarding[k].hostPorterrortcp port N on the Mac is already forwarded by ...Each protocol, family and host port only once, across all switches.
switches.<name>.portForwarding[k].addresserror'...' is not an IPv4 address / not an IPv6 addressFix the address, or set family.
switches.<name>.portForwarding[k].familyerrorIPv4 forwarding needs nat4: true / IPv6 forwarding needs nat6: trueTurn on NAT for that family.
switches.<name>.portForwarding[k].addresserror... is outside <subnet>Use the guest's address on this switch.
switches.<name>.portForwarding[k].addresswarning... has no DHCP reservation, so no node is guaranteed to have itAdd a reservation for that address.

Problems found only at start ​

Some problems can only be seen on the Mac at vz up, when vz builds the VMs. They are reported as errors of up (and in <state>/lab.log), not by validate:

  • a disk file, init path or share folder that does not exist, or an init folder without user-data
  • apple: a missing or unreadable .ipsw (no macOS restore image at ...), no .ipsw while macOS is not installed yet, a restore image this Mac cannot run, or fewer CPUs or less memory than that macOS needs
  • an overlay size smaller than the base image, or smaller than the existing overlay (disks never shrink)
  • cpus above what this Mac allows, nested virtualization on a Mac older than M3, Rosetta not installed
  • a USB device that is not plugged in, or a binary that cannot claim USB accessories
  • a binary without the virtualization entitlement, and vmnet errors such as a subnet already used by another running lab

See Troubleshooting for each of these.

See also ​