2 Quickstart
Jeroen Janssen edited this page 2023-05-28 15:42:32 +02:00

A simple overview of the commands needed to install vm-bhyve and start a HardenedBSD guest.

1. fetch https://code.laylo.cloud/laylo/vm-bhyve-laylo/archive/main.tar.gz
2. tar zxf main.tar.gz
3. cd vm-bhyve-laylo
4. make install
5. pkg install grub2-bhyve edk2-bhyve tmux
6. zfs create tank/vm
7. sysrc vm_enable="YES"
8. sysrc vm_dir="zfs:tank/vm"
9. vm init
10. cp /usr/local/share/examples/vm-bhyve-laylo/* /mountpoint/for/tank/vm/.templates/
11. vm switch create public
12. vm switch add public igb0
13. vm iso https://mirror.laylo.io/pub/hardenedbsd/13-stable/amd64/amd64/installer/LATEST/bootonly.iso
14. vm create myguest
15. vm install [-f] myguest bootonly.iso
16. vm console myguest

Line 1-4
Download vm-bhyve-laylo, extract and install it.

Line 5
Install the dependencies.

Line 6
Create a dataset for your virtual machines. If you're not using ZFS, just create a normal directory.

Lines 7-8
Enable vm-bhyve in /etc/rc.conf and set the dataset to use. If not using ZFS, just set $vm_dir="/my/vm/folder".

Line 9
Run the vm init command to create the required directories under $vm_dir and load kernel modules.

Line 10 Install the sample templates that come with vm-bhyve-laylo.

Lines 11-12
Create a virtual switch called 'public' and attach your network interface to it. Replace igb0 with whatever interface connects your machine to the network.

Line 13
Download a copy of HardenedBSD 13-stable.

Lines 14-15
Create a new guest using the default.conf HardenedBSD template, run the installer and then connect to its console. At this point proceed through the installation as normal. By specifying the -f option before the install command, the guest will run directly on your terminal so the console command is not required.