Date: 2016-10-04 Version: 1.2
Author: [email protected]
This is my short documentation on how to install RancherOS on FreeNAS.
Versions used:
- RancherOS v.0.6.1
- FreeNAS 9.10-stable
- iohyve v0.7.5 2016/04/14
Gav wrote a comprehensive blog-post about this. Find it here: Gav's Tech Blog
We're going to differ from Gav's tutorial right bevore he installs Ubuntu. So we're going to instead download RancherOS:
[root@freenas ~]$ iohyve fetch https://releases.rancher.com/os/latest/rancheros.iso
[root@freenas ~]$ iohyve renameiso rancheros.iso rancheros-v0.6.1.iso
[root@freenas ~]$ iohyve isolist
The last command is only to make sure we did everything right. So now we create and setup the guest:
[root@freenas ~]$ iohyve create rancheros 100G
[root@freenas ~]$ iohyve set rancheros loader=grub-bhyve ram=8G cpu=1 con=nmdm0 os=debian
[root@freenas ~]$ iohyve list
I'm not really sure if we're going to need os=debian or if other parameters work better. That's just what I used first and it worked. Obviously you should modify the parameters to your liking.
[root@freenas ~]$ iohyve install rancheros rancheros-v0.6.1.iso
RancherOS doesn't boot on its own, so we need to do this manually via grub-console. Attaching to the console should be done in a seperate ssh-session.
[user@freenas ~]$ sudo iohyve console rancheros
# press ENTER, you should see the grub-prompt
grub> set root=(cd0,msdos1)
grub> linux /boot/vmlinuz ro
grub> initrd /boot/initrd
grub> boot
This should get you to the login-prompt of RancherOS (login: rancher). No password is needed for login or sudo. Next we'll need to create the cloud-config.yml file to store our ssh-keys. Now see references from the RancherOS docs: here and here too
[rancher@rancher ~]$ vi cloud-config.yml
-----
# cloud-config.yml
ssh_authorized_keys:
- <your pubkey here>
CAVE: Don't forget the leading dash before your pubkey!
[rancher@rancher ~]$ sudo ros install -c cloud-config.yml -d /dev/sda
The reboot doesn't actually happen. Now quit the console via ~~.
.
Finally start RancherOS via iohyve start rancheros
and try to ssh into the
machine using ssh rancher@rancher
. If wanted/needed you can enable RancherOS
to auto-start at boottime via iohyve set rancheros boot=1
. From here on continue your adventures.
When i Run
grub> set root=(cd0,msdos1)
grub> linux /boot/vmlinuz ro
error: file `/boot/vmlinuz' not found.
grub>
could you help