Skip to content

Full Example Template

Matt Churchyard edited this page Apr 11, 2016 · 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.

guest="freebsd"
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
Specify the type of operating system for this guest. In v0.12.5+ this option is no longer required as long as the correct loader is specified.

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

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

Lines 5-7
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 8-9
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.