| @@ -29,24 +29,24 @@ Hope this helps others! | |||||
| ## NetBSD | ## NetBSD | ||||
| 1. Install `grub2-bhyve`: | 1. Install `grub2-bhyve`: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| pkg install grub2-bhyve | pkg install grub2-bhyve | ||||
| ``` | |||||
| </code></pre> | |||||
| 2. Create a file called `instdev.map` containing: | 2. Create a file called `instdev.map` containing: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| (cd0) NetBSD-6.1.5-amd64.iso | (cd0) NetBSD-6.1.5-amd64.iso | ||||
| (hd1) netbsd.img | (hd1) netbsd.img | ||||
| ``` | |||||
| </code></pre> | |||||
| 3. Create the file `netbsd.img` with the correct size: | 3. Create the file `netbsd.img` with the correct size: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| truncate -s 3g netbsd.img | truncate -s 3g netbsd.img | ||||
| ``` | |||||
| </code></pre> | |||||
| 4. Run the following commands (or put into a script file) under `sh`: | 4. Run the following commands (or put into a script file) under `sh`: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| MEM=512M | MEM=512M | ||||
| VM=nbsd615 | VM=nbsd615 | ||||
| bhyvectl --destroy --vm=$VM | bhyvectl --destroy --vm=$VM | ||||
| grub-bhyve -r cd0 -M $MEM -m instdev.map $VM <<EOF | |||||
| grub-bhyve -r cd0 -M $MEM -m instdev.map $VM <<EOF | |||||
| knetbsd -h -r cd0a | knetbsd -h -r cd0a | ||||
| (cd0)/netbsdboot | (cd0)/netbsdboot | ||||
| EOF | EOF | ||||
| @@ -54,48 +54,48 @@ Hope this helps others! | |||||
| -s 2:0,virtio-net,tap3 -s 3:0,virtio-blk,./netbsd.img \ | -s 2:0,virtio-net,tap3 -s 3:0,virtio-blk,./netbsd.img \ | ||||
| -s 4:0,ahci-cd,./NetBSD-6.1.5-amd64.iso \ | -s 4:0,ahci-cd,./NetBSD-6.1.5-amd64.iso \ | ||||
| -l com1,stdio -c 2 -m $MEM $VM | -l com1,stdio -c 2 -m $MEM $VM | ||||
| ``` | |||||
| </code></pre> | |||||
| 5. This will run the installer, complete the installation. | 5. This will run the installer, complete the installation. | ||||
| 6. Create a file called `dev.map` containing: | 6. Create a file called `dev.map` containing: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| (hd1) netbsd.img | (hd1) netbsd.img | ||||
| ``` | |||||
| </code></pre> | |||||
| 7. Now in the future, to run NetBSD from the image, run the following commands: | 7. Now in the future, to run NetBSD from the image, run the following commands: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| MEM=512M | MEM=512M | ||||
| VM=nbsd615 | VM=nbsd615 | ||||
| bhyvectl --destroy --vm=$VM | bhyvectl --destroy --vm=$VM | ||||
| grub-bhyve -r cd0 -M $MEM -m dev.map $VM <<EOF | |||||
| grub-bhyve -r cd0 -M $MEM -m dev.map $VM <<EOF | |||||
| knetbsd -h -r ld0a | knetbsd -h -r ld0a | ||||
| (hd1,msdos1)/netbsdboot | (hd1,msdos1)/netbsdboot | ||||
| EOF | EOF | ||||
| bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc \ | bhyve -A -H -P -s 0:0,hostbridge -s 1:0,lpc \ | ||||
| -s 2:0,virtio-net,tap3 -s 3:0,virtio-blk,./netbsd.img \ | -s 2:0,virtio-net,tap3 -s 3:0,virtio-blk,./netbsd.img \ | ||||
| -l com1,stdio -c 2 -m $MEM $VM | -l com1,stdio -c 2 -m $MEM $VM | ||||
| ``` | |||||
| </code></pre> | |||||
| 8. Profit! | 8. Profit! | ||||
| ## OpenBSD | ## OpenBSD | ||||
| 1. Install `grub2-bhyve`: | 1. Install `grub2-bhyve`: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| pkg install grub2-bhyve | pkg install grub2-bhyve | ||||
| ``` | |||||
| </code></pre> | |||||
| 2. Create a file called `instdev.map` containing: | 2. Create a file called `instdev.map` containing: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| (cd0) install57.iso | (cd0) install57.iso | ||||
| (hd1) openbsd.img | (hd1) openbsd.img | ||||
| ``` | |||||
| </code></pre> | |||||
| 3. Create the file `openbsd.img` with the correct size: | 3. Create the file `openbsd.img` with the correct size: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| truncate -s 3g openbsd.img | truncate -s 3g openbsd.img | ||||
| ``` | |||||
| </code></pre> | |||||
| 4. Run the following commands (or put into a script file) under `sh`: | 4. Run the following commands (or put into a script file) under `sh`: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| MEM=512M | MEM=512M | ||||
| VM=obsd57 | VM=obsd57 | ||||
| bhyvectl --destroy --vm=$VM | bhyvectl --destroy --vm=$VM | ||||
| grub-bhyve -r cd0 -M $MEM -m instdev.map $VM <<EOF | |||||
| grub-bhyve -r cd0 -M $MEM -m instdev.map $VM <<EOF | |||||
| kopenbsd -h com0 | kopenbsd -h com0 | ||||
| (cd0)/5.7/amd64/bsd.rdboot | (cd0)/5.7/amd64/bsd.rdboot | ||||
| EOF | EOF | ||||
| @@ -103,17 +103,18 @@ Hope this helps others! | |||||
| -s 2:0,virtio-net,tap3 -s 3:0,virtio-blk,./openbsd.img \ | -s 2:0,virtio-net,tap3 -s 3:0,virtio-blk,./openbsd.img \ | ||||
| -s 4:0,ahci-cd,./install57.iso \ | -s 4:0,ahci-cd,./install57.iso \ | ||||
| -l com1,stdio -c 2 -m $MEM $VM | -l com1,stdio -c 2 -m $MEM $VM | ||||
| </code></pre> | |||||
| 5. This will run the installer, complete the installation. | 5. This will run the installer, complete the installation. | ||||
| 6. Create a file called `dev.map` containing: | 6. Create a file called `dev.map` containing: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| (hd1) netbsd.img | (hd1) netbsd.img | ||||
| ``` | |||||
| </code></pre> | |||||
| 7. Now in the future, to run OpenBSD from the image, run the following commands: | 7. Now in the future, to run OpenBSD from the image, run the following commands: | ||||
| ``` | |||||
| <pre class="fullwidth"><code> | |||||
| MEM=512M | MEM=512M | ||||
| VM=obsd57 | VM=obsd57 | ||||
| bhyvectl --destroy --vm=$VM | bhyvectl --destroy --vm=$VM | ||||
| grub-bhyve -r hd1 -M $MEM -m dev.map $VM <<EOF | |||||
| grub-bhyve -r hd1 -M $MEM -m dev.map $VM <<EOF | |||||
| kopenbsd -h com0 -r sd0a | kopenbsd -h com0 -r sd0a | ||||
| (hd1,openbsd1)/bsdboot | (hd1,openbsd1)/bsdboot | ||||
| EOF | EOF | ||||
| @@ -121,4 +122,5 @@ Hope this helps others! | |||||
| -s 2:0,virtio-net,tap3 -s 3:0,virtio-blk,./openbsd.img \ | -s 2:0,virtio-net,tap3 -s 3:0,virtio-blk,./openbsd.img \ | ||||
| -s 4:0,ahci-cd,./install57.iso \ | -s 4:0,ahci-cd,./install57.iso \ | ||||
| -l com1,stdio -c 2 -m $MEM $VM | -l com1,stdio -c 2 -m $MEM $VM | ||||
| </code></pre> | |||||
| 8. Profit! | 8. Profit! | ||||