Skip to content

Full Example Template

Matt Churchyard edited this page Jun 22, 2018 · 3 revisions

Below is an example of a full template for running a FreeBSD guest. See the Supported Guest Examples page for examples of configurations for other operating systems.

All templates are stored inside $vm_dir/.templates and should be called [my-template-name].conf. You can create as many templates as you like, and specify them in the create command as follows:

vm create -t my-template-name myguest

If no template name is specified when creating a guest, default.conf is used.

Example Template (FreeBSD guest)

loader="bhyveload"
cpu=2
memory=512M
disk0_type="virtio-blk"
disk0_name="disk0.img"
disk0_dev="file"
network0_type="virtio-net"
network0_switch="public"

Line 1
FreeBSD guests need to be loaded with the bhyveload loader

Lines 2-3
The number of cpu cores and the amount of memory to give this guest. The memory option can end with M or G.

Lines 4-6
The options for the first disk. This is the disk the guest will boot from. The disk0_dev option is not required and will default to file. It's also possible to use ZVOLs or custom disks - see the disk examples page for more details.

Lines 7-8
Options for the first network adapter. If no networking is required, these options can be removed. The only supported interface type is currently virtio-net. This interface will be automatically connected to the public virtual switch if it can be found.