Discussion:
Creating a BHyve guest
(too old to reply)
James B. Byrne via freebsd-questions
2016-05-30 18:34:59 UTC
Permalink
I am trying, without much success, to create a FreeBSD guest on a
FreeBSD host, both version 10.3. These are the steps I have followed
thus far (refs.: the Handbook s. 21.7 and the wiki
https://wiki.freebsd.org/Jenkins/VMSetup ).

To create the BHyve based VM on the FreeBSD host the following steps
were followed.

1. We are using the zfs file system which combines both file-system
and volume management. We first create a pool to hold our VM disk
images. These are where the storage used by the VM will be created.

zfs create zroot/vm


2. Next we set the mode for the VM storage pool image files to be
considered devices. This provides certain improvements in performance
and security as it relates to VM guests.

zfs set volmode=dev zroot/vm
zfs get volmode zroot/vm


3. Now we create a disk image file to hold the VM. We will name it
after the vm that we intend to create (samba_dc01) so that it is
readily identifiable on the host. The existing MS AD-DC can only
support a 120Gbyte disk which is only 50% utilised so a 200Gbyte (-V
200G) should prove sufficient.

zfs create -V 200G zroot/vm/samba_dc01.img

find /dev -name samba_dc01\*
/dev/zvol/zroot/vm/samba_dc01.img


4. At this point a suitable install source must be obtained. These are
usually disk files that contain a CD-ROM or DVD iso9660 formatted data
disk. Because of the format specification sued these are often
referred to simply as isos. In this case the FreeBSD isos are found at
ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/ISO-IMAGES/10.3/.
The version number (10.3) naturally will change over time and so must
be accounted for when specifying the url. The utility wget or curl can
be used to directly download the appropriate iso image file to a
suitable location on the host's file system.
However the install image file is transferred it is important that the
downloaded file be checked against its SHA256 or SHA512 signature as
given on the source site to insure that the download is intact and is
identical to the file on the source. The checksums are contained in a
suitable named file provided from the host. In this case it was
ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/ISO-IMAGES/10.3/CHECKSUM.SHA256-FreeBSD-10.3-RELEASE-amd64

sha256 -q /root/FreeBSD-10.3-RELEASE-amd64-dvd1.iso
3f33fc506b18d752564c3ba92419592a489fceef43f73827c42a4e4d31fd4b7d

grep FreeBSD-10.3-RELEASE-amd64-dvd1.iso
CHECKSUM.SHA256-FreeBSD-10.3-RELEASE-amd64
SHA256 (FreeBSD-10.3-RELEASE-amd64-dvd1.iso) =
3f33fc506b18d752564c3ba92419592a489fceef43f73827c42a4e4d31fd4b7d


5. Once the iso image for the installer is downloaded, in this case to
the /root directory, and its checksum verified then the process of
creating a new FreeBSD VM instance is carried out using the supplied
shell script.

sh /usr/share/examples/bhyve/vmrun.sh \
-c 2 -m 4096M -t tap0 \
-d /dev/zvol/zroot/vm/samba_dc01.img \
-i -I /root/FreeBSD-10.3-RELEASE-amd64-dvd1.iso \
samba_dc01

This all seems to work as documented. I configure the new vm, confirm
my choices and shut down. When I attempt to restart the new system
using either of the following then the attempt fails.

bhyve -A -H -P -s 0:0,hostbridge \
-s 1:0,lpc \
-s 2:0,virtio-net,tap0 \
-s 3:0,virtio-blk,/dev/zvol/zroot/vm/samba_dc01.img \
-l com1,stdio -c 2 -m 4096M \
samba_dc01
virtual machine cannot be booted

or

sh /usr/share/examples/bhyve/vmrun.sh \
-c 2 -m 4096M -t tap0 \
-d samba_dc01.img \
samba_dc01
Launching virtual machine "samba_dc01" ...
Installation CDROM image "./release.iso" is not readable


I cannot see any other steps in the documentation that I have read.
What am I missing or what am I doing wrong?
--
*** e-Mail is NOT a SECURE channel ***
Do NOT transmit sensitive data via e-Mail
Do NOT open attachments nor follow links sent by e-Mail

James B. Byrne mailto:***@Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3
Shane Ambler
2016-05-31 06:54:30 UTC
Permalink
Post by James B. Byrne via freebsd-questions
I am trying, without much success, to create a FreeBSD guest on a
FreeBSD host, both version 10.3. These are the steps I have followed
thus far (refs.: the Handbook s. 21.7 and the wiki
https://wiki.freebsd.org/Jenkins/VMSetup ).
5. Once the iso image for the installer is downloaded, in this case to
the /root directory, and its checksum verified then the process of
creating a new FreeBSD VM instance is carried out using the supplied
shell script.
sh /usr/share/examples/bhyve/vmrun.sh \
-c 2 -m 4096M -t tap0 \
-d /dev/zvol/zroot/vm/samba_dc01.img \
-i -I /root/FreeBSD-10.3-RELEASE-amd64-dvd1.iso \
samba_dc01
This all seems to work as documented. I configure the new vm, confirm
my choices and shut down. When I attempt to restart the new system
using either of the following then the attempt fails.
sh /usr/share/examples/bhyve/vmrun.sh \
Post by James B. Byrne via freebsd-questions
-c 2 -m 4096M -t tap0 \
-d samba_dc01.img \
shouldn't that be -d /dev/zvol/zroot/vm/samba_dc01.img
unable to find that leads to searching for cd image...
Post by James B. Byrne via freebsd-questions
Post by James B. Byrne via freebsd-questions
samba_dc01
Launching virtual machine "samba_dc01" ...
Installation CDROM image "./release.iso" is not readable
--
FreeBSD - the place to B...Software Developing

Shane Ambler
Bernt Hansson
2016-05-31 07:26:05 UTC
Permalink
Post by James B. Byrne via freebsd-questions
This all seems to work as documented. I configure the new vm, confirm
my choices and shut down. When I attempt to restart the new system
using either of the following then the attempt fails.
bhyve -A -H -P -s 0:0,hostbridge \
-s 1:0,lpc \
-s 2:0,virtio-net,tap0 \
-s 3:0,virtio-blk,/dev/zvol/zroot/vm/samba_dc01.img \
-l com1,stdio -c 2 -m 4096M \
samba_dc01
virtual machine cannot be booted
or
sh /usr/share/examples/bhyve/vmrun.sh \
-c 2 -m 4096M -t tap0 \
-d samba_dc01.img \
samba_dc01
Launching virtual machine "samba_dc01" ...
Installation CDROM image "./release.iso" is not readable
I cannot see any other steps in the documentation that I have read.
What am I missing or what am I doing wrong?
You need to set the correct iso filename in vmrun.sh.

Line 40
DEFAULT_ISOFILE="./release.iso"
Bernt Hansson
2016-05-31 14:04:42 UTC
Permalink
Post by Bernt Hansson
Post by James B. Byrne via freebsd-questions
This all seems to work as documented. I configure the new vm,
confirm
my choices and shut down. When I attempt to restart the new system
using either of the following then the attempt fails.
bhyve -A -H -P -s 0:0,hostbridge \
-s 1:0,lpc \
-s 2:0,virtio-net,tap0 \
-s 3:0,virtio-blk,/dev/zvol/zroot/vm/samba_dc01.img \
-l com1,stdio -c 2 -m 4096M \
samba_dc01
virtual machine cannot be booted
or
sh /usr/share/examples/bhyve/vmrun.sh \
-c 2 -m 4096M -t tap0 \
-d samba_dc01.img \
samba_dc01
Launching virtual machine "samba_dc01" ...
Installation CDROM image "./release.iso" is not readable
I cannot see any other steps in the documentation that I have read.
What am I missing or what am I doing wrong?
You need to set the correct iso filename in vmrun.sh.
Line 40
DEFAULT_ISOFILE="./release.iso"
I thought that I had already installed the OS from the iso in step 5.
I am now at the point of rebooting the installed OS. That implies
that the need for a boot CD is no longer present. Why is the CD image
still necessary? And why is this step not documented in the handbook
if it is in fact required?
No idea why you need to set the iso filename. Never used the bihyve
program, just took a quick look
in that file.
James B. Byrne via freebsd-questions
2016-05-31 12:42:42 UTC
Permalink
Post by Bernt Hansson
Post by James B. Byrne via freebsd-questions
This all seems to work as documented. I configure the new vm,
confirm
my choices and shut down. When I attempt to restart the new system
using either of the following then the attempt fails.
bhyve -A -H -P -s 0:0,hostbridge \
-s 1:0,lpc \
-s 2:0,virtio-net,tap0 \
-s 3:0,virtio-blk,/dev/zvol/zroot/vm/samba_dc01.img \
-l com1,stdio -c 2 -m 4096M \
samba_dc01
virtual machine cannot be booted
or
sh /usr/share/examples/bhyve/vmrun.sh \
-c 2 -m 4096M -t tap0 \
-d samba_dc01.img \
samba_dc01
Launching virtual machine "samba_dc01" ...
Installation CDROM image "./release.iso" is not readable
I cannot see any other steps in the documentation that I have read.
What am I missing or what am I doing wrong?
You need to set the correct iso filename in vmrun.sh.
Line 40
DEFAULT_ISOFILE="./release.iso"
I thought that I had already installed the OS from the iso in step 5.
I am now at the point of rebooting the installed OS. That implies
that the need for a boot CD is no longer present. Why is the CD image
still necessary? And why is this step not documented in the handbook
if it is in fact required?
--
*** e-Mail is NOT a SECURE channel ***
Do NOT transmit sensitive data via e-Mail
Do NOT open attachments nor follow links sent by e-Mail

James B. Byrne mailto:***@Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3
Loading...