1.\" 2.\" Copyright (c) 2012 NetApp Inc 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" 26.Dd June 24, 2016 27.Dt BHYVELOAD 8 28.Os 29.Sh NAME 30.Nm bhyveload 31.Nd load a 32.Fx 33guest inside a bhyve virtual machine 34.Sh SYNOPSIS 35.Nm 36.Op Fl C 37.Op Fl S 38.Op Fl c Ar cons-dev 39.Op Fl d Ar disk-path 40.Op Fl e Ar name=value 41.Op Fl h Ar host-path 42.Op Fl l Ar os-loader 43.Op Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t 44.Ar vmname 45.Sh DESCRIPTION 46.Nm 47is used to load a 48.Fx 49guest inside a 50.Xr bhyve 4 51virtual machine. 52.Pp 53.Nm 54is based on 55.Xr loader 8 56and will present an interface identical to the 57.Fx 58loader on the user's terminal. 59This behavior can be changed by specifying a different OS loader. 60.Pp 61The virtual machine is identified as 62.Ar vmname 63and will be created if it does not already exist. 64.Sh OPTIONS 65The following options are available: 66.Bl -tag -width indent 67.It Fl c Ar cons-dev 68.Ar cons-dev 69is a 70.Xr tty 4 71device to use for 72.Nm 73terminal I/O. 74.Pp 75The text string "stdio" is also accepted and selects the use of 76unbuffered standard I/O. This is the default value. 77.It Fl d Ar disk-path 78The 79.Ar disk-path 80is the pathname of the guest's boot disk image. 81.It Fl e Ar name=value 82Set the 83.Fx 84loader environment variable 85.Ar name 86to 87.Ar value . 88.Pp 89The option may be used more than once to set more than one environment 90variable. 91.It Fl h Ar host-path 92The 93.Ar host-path 94is the directory at the top of the guest's boot filesystem. 95.It Fl l Ar os-loader 96Specify a different OS loader. 97By default 98.Nm 99will use 100.Pa /boot/userboot.so , 101which presents a standard 102.Fx 103loader. 104.It Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t 105.Ar memsize 106is the amount of memory allocated to the guest. 107.Pp 108The 109.Ar memsize 110argument may be suffixed with one of 111.Cm K , 112.Cm M , 113.Cm G 114or 115.Cm T 116(either upper or lower case) to indicate a multiple of 117Kilobytes, Megabytes, Gigabytes or Terabytes 118respectively. 119.Pp 120.Ar memsize 121defaults to 256M. 122.It Fl C 123Include guest memory in the core file when 124.Nm 125dumps core. 126This is intended for debugging an OS loader as it allows inspection of 127the guest memory. 128.It Fl S 129Wire guest memory. 130.El 131.Sh EXAMPLES 132To create a virtual machine named 133.Ar freebsd-vm 134that boots off the ISO image 135.Pa /freebsd/release.iso 136and has 1GB memory allocated to it: 137.Pp 138.Dl "bhyveload -m 1G -d /freebsd/release.iso freebsd-vm" 139.Pp 140To create a virtual machine named 141.Ar test-vm 142with 256MB of memory allocated, the guest root filesystem under the host 143directory 144.Pa /user/images/test 145and terminal I/O sent to the 146.Xr nmdm 4 147device 148.Pa /dev/nmdm1B 149.Pp 150.Dl "bhyveload -m 256MB -h /usr/images/test -c /dev/nmdm1B test-vm" 151.Sh SEE ALSO 152.Xr bhyve 4 , 153.Xr nmdm 4 , 154.Xr vmm 4 , 155.Xr bhyve 8 , 156.Xr loader 8 157.Sh HISTORY 158.Nm 159first appeared in 160.Fx 10.0 , 161and was developed at NetApp Inc. 162.Sh AUTHORS 163.Nm 164was developed by 165.An -nosplit 166.An Neel Natu Aq Mt neel@FreeBSD.org 167at NetApp Inc with a lot of help from 168.An Doug Rabson Aq Mt dfr@FreeBSD.org . 169.Sh BUGS 170.Nm 171can only load 172.Fx 173as a guest. 174