| VM.CONF(5) | File Formats Manual | VM.CONF(5) |
vm.conf — virtual
machine configuration
vm.conf is the configuration file for the
virtual machine monitor, vmm(4), which is responsible for
creating, destroying, and executing virtual machines (VMs).
vm.conf is divided into the following main
sections:
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.
Arguments 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"
A macro is defined with a command of the form
name=value. The macro
name can contain letters, digits, and underscores and
cannot be a reserved word (for example, vm,
memory, or disk). Within
unquoted arguments, the string $name is later expanded
to value.
For example:
ramdisk="/bsd.rd"
vm "vm1.example.com" {
memory 512M
boot $ramdisk
}
The following settings can be configured globally:
agentx
[context context]
[path socket]local
prefix
address/prefixlocal interface in the
VM configuration section below.
The default is 100.64.0.0/10.local
inet6 [prefix
address/prefix]socket
owner
user:groupstaggered
start parallel
parallelism delay
delayEach vm section starts with the
declaration of a virtual machine name:
vm
name {...}The block enclosed in curly braces can contain the following parameters:
allow
instance {...}boot
pathboot
device devicecdromcdrom parameter.diskdisk parameter.netboot
parameter as if the VM was network booted. In addition, the DHCP lease
advertises “auto_install” in the bootfile option making
it suitable for use with autoinstall(8). Note, this
is not to be confused with pxeboot(8) but rather a
simulated network boot.Currently disk and
cdrom only work with VMs booted using BIOS.
cdrom
pathenableenable nor disable is
specified.disabledisk
path [format
fmt]qcow2 (a sparse file format which reduces storage)
or raw. If left unspecified, the format defaults
to raw if it cannot be derived automatically.local] interface
[name] [{...}]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
group-namelocked] lladdr
[etheraddr]locked
keyword is specified, vmd(8) drops packets from the
VM with altered source addresses.rdomain
rdomainidswitch
nameupdownA local interface auto-generates an
IPv4 subnet for the interface, configures a gateway address on the VM
host side, and runs a simple DHCP/BOOTP server for the VM. This option
can be used for layer 3 mode without configuring a switch.
If the global local
inet6 option is enabled, a routable IPv6 gateway
address is generated on the host side. Unlike the IPv4 option,
vmd(8) does not respond to DHCPv6 or router
solicitation messages itself. Use rad(8) listening on
the interface group, e.g. interface
tap for auto-configuring the VMs
accordingly.
interfaces
countinterface statements, additional default
interfaces are added.memory
bytesowner
user:groupsevsevesIt is possible to use configured or running VMs as a template for
additional instances of the VM. An instance is just like a normal
vm and is configured with the following declaration
of the virtual machine name:
vm
parent instance
name {...}The new instance inherits settings from the VM
parent, except for exclusive options such as
disk, interface lladdr, or
interface name. The
configuration options are identical to the
VM configuration, but restricted
to the allowed instance options.
The allowed instance options are configured in the parent VM:
allow
instance {...}Valid options are:
bootcdromdiskinstanceinterfacememoryowner
user[:group]owner
:groupA virtual switch allows VMs to communicate with other network
interfaces on the host system via either bridge(4) or
veb(4). The network interface for each virtual switch
defined in vm.conf is pre-configured using
hostname.if(5) or ifconfig(8) (see the
BRIDGE and VEB 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
veb(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:
switch
name {...}The block enclosed in curly braces can contain the following parameters:
enableenable nor disable is
specified.locked
lladdrdisablegroup
group-nameinterface
namerdomain
rdomainidupdownCreate a new VM with 1GB memory, 1 network interface connected to “uplink”, with one disk image /home/joe/vm2-disk.img, owned by user ‘joe’:
vm "vm2.example.com" {
memory 1G
disk "/home/joe/vm2-disk.img"
interface { switch "uplink" }
owner joe
}
Create a new VM as an instance from ‘vm2.example.com’:
vm "vm2.example.com" instance "vm3.example.com" {
disk "/home/joe/vm3-disk.img"
}
Create the switch "uplink" with an additional physical network interface:
switch "uplink" {
interface bridge0
}
The vm.conf file format first appeared in
OpenBSD 5.9.
Mike Larkin <mlarkin@openbsd.org> and Reyk Floeter <reyk@openbsd.org>.
Each guest requires one tap(4) device per assigned interface and one pty(4) device. Administrators may need to create additional devices using MAKEDEV(8).
| July 6, 2025 | Debian |