Installing on FreeBSD's Bhyve

I’m trying to install this on Bhyve and I seem to just get stuck in the grub bootloader. How do you get this thing booted on *hyve?

might be late but i’ve successfuly installed rancheros on freenas 9.10 following coreos instruction here :

replace grub-cd0.cfg content with:
linux (cd0)/boot/vmlinuz rancher.password=rancher rancher.state.autoformat=[/dev/sda,/dev/vda]
initrd (cd0)/boot/initrd

replace grub-hd0.cfg content with:
linux (hd0,msdos1)/boot/vmlinuz-v0.5.0-rancheros console=tty0
initrd (hd0,msdos1)/boot/initrd-v0.5.0-rancheros

And replace OS install instruction with RancherOS ones (sudo ros install …)

Hope it helps :slight_smile:

Running FreeBSD 12.0-RELEASE-p10 GENERIC amd64

I installed iohyve and put this to /etc/rc.conf

iohyve_flags="kmod=1 net=em0"

This will autoload required modules. Acording to iohyve setup you need to specify start command where you define network card and pool you want your hivez to live:

# iohyve setup pool=tank kmod=1 net=em0

Next you pull in latest CD:

# iohyve fetch

Install bhyves grub loader:

# pkg install grub2-bhyve

For next steps you will neet two consoles open, one will start vm, second will attach to session to complete install:

iohyve create rancher 100G
iohyve set rancher loader=grub-bhyve ram=8G cpu=4 con=nmdm0 os=debian
iohyve install rancher rancheros.iso

Now switch to second terminal and type:

iohyve console rancher

Just press Enter if there is no input cursor, You should then see:

Starting console on rancher…
~~. to escape console [uses cu(1) for console]

Now when you are in grub issue this commands:

grub> set root=(cd0,msdos1)
grub> linux /boot/vmlinuz-4.14.138-rancher ro rancher.password=MySecretPassword
grub> initrd /boot/initrd-v1.5.4 
grub> boot

You will start boot process of RancherOS, then login with user rancher and password from above command:

ros-sysinit:info: RancherOS v1.5.4 started
Linux 4.14.138-rancher
RancherOS #1 SMP Sat Aug 10 11:25:46 UTC 2019 rancher ttyS0
docker-sys: lo:
rancher login: rancher

Next you create cloud-config.yml:

[rancher@rancher ~]$ vi cloud-config.yml

and insert something that fits your network, mine ssh key is at .ssh/

  - ssh-rsa ThiSloNgStringFromSSHKEY

        dhcp: false

Next step is to check config yaml and start installation:

[rancher@rancher ~]$ sudo ros config validate -i cloud-config.yml
[rancher@rancher ~]$ sudo ros install -c cloud-config.yml -d /dev/sda

You should see something like this:

INFO[0000] No install type specified…defaulting to generic
Installing from rancher/os:v1.5.4
Continue [y/N]: y
INFO[0025] start !isoinstallerloaded
INFO[0026] trying to load /bootiso/rancheros/installer.tar.gz
Loaded image: rancher/os-installer:latest
INFO[0026] Loaded images from /bootiso/rancheros/installer.tar.gz
INFO[0026] starting installer container for rancher/os-installer:latest (new)
Installing from rancher/os-installer:latest
mke2fs 1.45.2 (27-May-2019)
64-bit filesystem support is not enabled. The larger fields afforded by this feature enable full-strength checksumming. Pass -O 64bit to rectify.
Discarding device blocks: done
Creating filesystem with 26213888 4k blocks and 26214400 inodes
Filesystem UUID: edbfaaa2-900c-4758-a8ec-941b8db9ff64
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Writing inode tables: done
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information: done

Continue with reboot [y/N]: y
INFO[0035] Rebooting
INFO[0035] Setting reboot timeout to 60 (rancher.shutdown_timeout set to 60)
…^[ ] reboot:info: Setting reboot timeout to 60 (rancher.shutdown_timeout set to 60)
.=.[ ] reboot:info: Stopping /docker : d0dc40e8c38e
…C…[ ] reboot:info: Stopping /ntp : 6a9f3c8a269c
.>.[ ] reboot:info: Stopping /network : 06583eef61c9
…<…[ ] reboot:info: Stopping /udev : 2022f2d3cc6a
.B.[ ] reboot:info: Stopping /system-cron : 34c0f89e323c
…>…[ ] reboot:info: Stopping /syslog : f4947287051c
.<.[ ] reboot:info: Stopping /acpid : 6a4b0deacf01
.acpid: exiting
.I…[ ] reboot:info: Console Stopping [/console] : 26be4e958484
…[ 787.439005] reboot: Restarting system

But wait, it is not over yet :slight_smile: You have to go back to console one where you started iohyve (just press enter to exit some notifications), and create grub.cfg (next to file). Just cd in /iohyve/rancher

set root=(hd0,1) 
linux /boot/vmlinuz* printk.devkmsg=on rancher.state.wait console=tty0 ro rancher.password=aZAFxJ2C2wzS6nEq
initrd /boot/initrd*

Just last tweak before you start vm:

iohyve set rancher os=custom
iohyve start rancher

If you did not close two opened terminals, one should present you with rancher login.