1.\" $OpenBSD: vm.conf.5,v 1.5 2016/05/05 09:00:44 schwarze Exp $ 2.\" 3.\" Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> 4.\" Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> 5.\" 6.\" Permission to use, copy, modify, and distribute this software for any 7.\" purpose with or without fee is hereby granted, provided that the above 8.\" copyright notice and this permission notice appear in all copies. 9.\" 10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17.\" 18.Dd $Mdocdate: May 5 2016 $ 19.Dt VM.CONF 5 20.Os 21.Sh NAME 22.Nm vm.conf 23.Nd virtual machine configuration 24.Sh DESCRIPTION 25.Nm 26is the configuration file to configure the virtual machine monitor 27(VMM) subsystem. 28A VMM manages virtual machines (VMs) on a 29.Ar host . 30The VMM subsystem is responsible for creating, destroying, and 31executing VMs. 32.Sh SECTIONS 33.Nm 34is divided into two main sections: 35.Bl -tag -width xxxx 36.It Sy Macros 37User-defined variables may be defined and used later, simplifying the 38configuration file. 39.It Sy VM Configuration 40Configuration for each individual virtual machine. 41.El 42.Pp 43Within the sections, 44the 45.Ar bytes 46argument can be specified with a human-readable scale, 47using the format described in 48.Xr scan_scaled 3 . 49.Pp 50The current line can be extended over multiple lines using a backslash 51.Pq Sq \e . 52Comments can be put anywhere in the file using a hash mark 53.Pq Sq # , 54and extend to the end of the current line. 55Care should be taken when commenting out multi-line text: 56the comment is effective until the end of the entire block. 57.Pp 58Argument names not beginning with a letter, digit, underscore, or slash 59must be quoted. 60.Pp 61Additional configuration files can be included with the 62.Ic include 63keyword, for example: 64.Bd -literal -offset indent 65include "/etc/vm1.example.com.conf" 66.Ed 67.Sh MACROS 68Macros can be defined that will later be expanded in context. 69Macro names must start with a letter, digit, or underscore, 70and may contain any of those characters. 71Macro names may not be reserved words (for example, 72.Ic vm , 73.Ic memory , 74or 75.Ic disk ) . 76Macros are not expanded inside quotes. 77.Pp 78For example: 79.Bd -literal -offset indent 80ramdisk="/bsd.rd" 81vm "vm1.example.com" { 82 memory 512M 83 kernel $ramdisk 84} 85.Ed 86.Sh VM CONFIGURATION 87Each 88.Ic vm 89section starts with a declaration of the virtual machine 90.Ar name : 91.Bl -tag -width Ds 92.It Ic vm Ar name Brq ... 93This name can be any string, and is typically a hostname. 94.El 95.Pp 96Followed by a block of parameters that is enclosed in curly brackets: 97.Bl -tag -width Ds 98.It Cm enable 99Automatically start the VM. 100This is the default if neither 101.Cm enable 102nor 103.Cm disable 104is specified. 105.It Cm disable 106Do not start this VM. 107.It Cm disk Ar path 108Disk image file (may be specified multiple times to add multiple disk images). 109.It Cm kernel Ar path 110Kernel to load when booting the VM. 111.It Cm memory Ar bytes 112Memory size of the VM, in bytes, rounded to megabytes. 113.It Cm interfaces Ar count 114Number of network interfaces to add to the VM. 115.El 116.Sh EXAMPLES 117Create a new VM with 512MB memory, 1 network interface, one disk image 118('disk.img') and boot from kernel '/bsd': 119.Bd -literal -offset indent 120vm "vm2.example.com" { 121 memory 512M 122 interfaces 1 123 disk "/var/vmm/vm2-disk.img" 124 kernel "/bsd" 125} 126.Ed 127.Sh SEE ALSO 128.Xr vmm 4 , 129.Xr vmctl 8 , 130.Xr vmd 8 131.Sh HISTORY 132The 133.Nm 134file format first appeared in 135.Ox 5.9 . 136.Sh AUTHORS 137.An -nosplit 138.An Mike Larkin Aq Mt mlarkin@openbsd.org 139and 140.An Reyk Floeter Aq Mt reyk@openbsd.org . 141