xref: /openbsd/etc/examples/vm.conf (revision 4bdff4be)
1# $OpenBSD: vm.conf,v 1.11 2021/11/11 09:38:14 claudio Exp $
2
3#
4# Macros
5#
6sets="/var/www/htdocs/pub/OpenBSD/snapshots/amd64/"
7
8#
9# Virtual machines
10#
11
12switch "uplink" {
13	# This switch will use bridge0, defined by /etc/hostname.bridge0, as
14	# the underlying interface.  veb(4) is also supported
15	interface bridge0
16}
17
18switch "local" {
19	interface bridge1
20	down
21}
22
23# OpenBSD snapshot install test
24vm "openbsd.vm" {
25	boot $sets "bsd.rd"
26
27	# First disk from 'vmctl create -s 4G "/home/vm/OpenBSD.img"'
28	disk "/home/vm/OpenBSD.img"
29
30	# Second disk from OpenBSD contains the install sets
31	disk $sets "install60.img"
32
33	# Interface will show up as tap(4) on the host and as vio(4) in the VM
34	interface { switch "uplink" }
35	interface { switch "local" }
36}
37
38# Another VM that is disabled on startup
39vm "vm1.example.com" {
40	disable
41	memory 1G
42	disk "/home/vm/vm1-disk.img"
43
44	# Use a specific tap(4) interface with a hardcoded MAC address
45	interface tap3 {
46		lladdr 00:11:22:aa:bb:cc
47		down
48	}
49}
50