OpenBSD manual page server

Manual Page Search Parameters

VM.CONF(5) File Formats Manual VM.CONF(5)

vm.confvirtual machine configuration

vm.conf is the configuration file to configure the virtual machine monitor (VMM) subsystem. A VMM manages virtual machines (VMs) on a host. The VMM subsystem is responsible for creating, destroying, and executing VMs.

vm.conf is divided into three main sections:

User-defined variables may be defined and used later, simplifying the configuration file.
Configuration for each individual virtual machine.
Configuration for virtual switches.

Within the sections, the bytes argument can be specified with a human-readable scale, using the format described in scan_scaled(3).

The current line can be extended over multiple lines using a backslash (‘\’). Comments can be put anywhere in the file using a hash mark (‘#’), and extend to the end of the current line. Care should be taken when commenting out multi-line text: the comment is effective until the end of the entire block.

Argument names not beginning with a letter, digit, underscore, or slash must be quoted.

Additional configuration files can be included with the include keyword, for example:

include "/etc/vm1.example.com.conf"

Macros can be defined that will later be expanded in context. Macro names must start with a letter, digit, or underscore, and may contain any of those characters. Macro names may not be reserved words (for example, vm, memory, or disk). Macros are not expanded inside quotes.

For example:

ramdisk="/bsd.rd"
vm "vm1.example.com" {
	memory 512M
	boot $ramdisk
}

Each vm section starts with a declaration of the virtual machine name:

name {...}
This name can be any string, and is typically a hostname.

Followed by a block of parameters that is enclosed in curly brackets:

path
Kernel or BIOS image to load when booting the VM. If not specified, the default is to boot using the BIOS image in /etc/firmware/vmm-bios.
Automatically start the VM. This is the default if neither enable nor disable is specified.
Do not start this VM.
path
Disk image file (may be specified multiple times to add multiple disk images).
[name] [{...}]
Network interface to add to the VM. The optional name can be either ‘tap’ to select the next available tap(4) interface on the VM host side (the default) or tapN to select a specific one. Valid options are:
group-name
Assign the interface to a specific interface “group”. For example, this can be used to write pf.conf(5) rules for several VM interfaces in the same group. The group-name must not end with a digit.
[locked] lladdr [etheraddr]
Change the link layer address (MAC address) of the interface on the VM guest side. If not specified, a randomized address will be assigned by vmd(8). If the locked keyword is specified, vmd(8) will drop packets from the VM with altered source addresses.
name
Set the virtual switch by name. See the SWITCH CONFIGURATION section about virtual switches. This option is ignored if a switch with a matching name cannot be found.
Start the interface forwarding packets. This is the default.
Stop the interface from forwarding packets.
count
Optional minimum number of network interfaces to add to the VM. If the count is greater than the number of interface statements, additional default interfaces will be added.
bytes
Memory size of the VM, in bytes, rounded to megabytes. The default is 512M.
user[:group]
Set the owner of the VM to the specified user or group. The owner will be allowed to start or stop the VM and open the VM's console.
:group
Set the owner to the specified group.

A virtual switch allows VMs to communicate with other network interfaces on the host system via either bridge(4) or switch(4). The network interface for each virtual switch defined in vm.conf is automatically created by vmd(8), but it is also possible to pre-configure switch interfaces using hostname.if(5) or ifconfig(8) (see the BRIDGE and SWITCH sections in ifconfig(8) accordingly). When a VM is started, virtual network interfaces which are assigned to a virtual switch have their tap(4) interface automatically added into the corresponding bridge(4) or switch(4) interface underlying the virtual switch.

Virtual switches can be configured at any point in the configuration file. Each switch section starts with a declaration of the virtual switch:

name {...}
This name can be any string, and is typically a network name.

Followed by a block of parameters that is enclosed in curly brackets:

interface
Add interface as a member of the switch. Any network interface can be added, typically as an uplink interface, but it can be a member of at most one switch.
Automatically configure the switch. This is the default if neither enable nor disable is specified.
If this option is specified, vmd(8) will drop packets with altered sources addresses that do not match the link layer addresses (MAC addresses) of the VM interfaces in this switch.
Do not configure this switch.
group-name
Assign each interface to a specific interface “group”. For example, this can be used to write pf.conf(5) rules for several VM interfaces in the same group. The group-name must not end with a digit.
name
Set the switch(4) or bridge(4) network interface of this switch. If not specified, bridge0 will be used where the interface unit will be incremented for each switch, e.g. bridge0, bridge1, ... If the type is changed to switch0, it will be used for each following switch.
Start the switch forwarding packets. This is the default.
Stop the switch from forwarding packets.

Create a new VM with 1GB memory, 1 network interface connected to “uplink”, and one disk image ‘disk.img’:

vm "vm2.example.com" {
	memory 1G
	disk "/var/vmm/vm2-disk.img"
	interface { switch "uplink" }
}

Create the switch "uplink" with an additional physical network interface:

switch "uplink" {
	add em0
}

vmm(4), vmctl(8), vmd(8)

The vm.conf file format first appeared in OpenBSD 5.9.

Mike Larkin <mlarkin@openbsd.org> and Reyk Floeter <reyk@openbsd.org>.

March 25, 2017 OpenBSD-6.1