Install RancherOs on FreeNas 11.3

  • The automated RancherOs installation aka Docker VM has been removed in
  • RancherOs doesn’t support EFI boot out of the box
  • Thanks to MKinney howto
  • This howto is provided without warranty
  • TODO the proper way of doing it is somewhere here
  • Some stuff about losetup

1. Make a EFI bootable RancherOs image

  1. wget
  2. wget
  3. mkdir tmpubuntu tmprancheros tmprancheros_dest
  4. sudo mount ubuntuserverlive.iso tmpubuntu
  5. sudo mount rancheros.iso tmprancheros
  6. fallocate -l 150M rancheros.img
  7. gdisk rancheros.img o,y,n,enter,enter,ef00,w,Y
  8. sudo losetup --partscan --show --find rancheros.img
  9. sudo mkfs.fat /dev/loop2p1
  10. sudo mount /dev/loop2p1 rancheros_dest
  11. sudo cp -r tmprancheros/* tmprancheros_dest/
  12. sudo cp -r tmpubuntu/EFI tmprancheros_dest/
  13. Replace the content of tmprancheros_dest/boot/grub/grub.cfg with:
set timeout=5
menuentry "Install Rancher" {
    linux   /boot/vmlinuz-4.14.138-rancher rancher.autologin=tty1 rancher.autologin=ttyS0 rancher.autologin=ttyS1 console=tty1 console=ttyS0 console=ttyS1 printk.devkmsg=on panic=10 ---
    initrd  /boot/initrd-v1.5.5
  1. sudo umount tmprancheros_dest
  2. sudo losetup -d /dev/loop2
  3. sudo umount tmpubuntu tmprancheros

2. Installation in FreeNas as Vm

  1. Create a VM with EFI boot 2GB RAM choose virtio for all the driver
    better performance with linux
  2. Add a RAW device and select your rancheros.img
  3. Start the VM
  4. Go to serial and in the shell cu -l /dev/nmdmXX at this point you should
    have a rancher shell
  5. sudo fdisk /dev/vda then g,n,1,+200M,t,1,n,enter,enter,w you
    should something like at the end
Disk /dev/vda: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 16384 bytes
I/O size (minimum/optimal): 16384 bytes / 16384 bytes
Disklabel type: gpt
Disk identifier: 2B56EE14-44BF-6443-A197-EF73723B715F
Device      Start      End  Sectors  Size Type
/dev/vda1    2048   411647   409600  200M EFI System
/dev/vda2  411648 20971486 20559839  9.8G Linux filesystem
  1. Format the boot partition sudo mkdosfs -n RANCHER -F 32 /dev/vda1
  2. Format the main filesystem sudo mkfs.ext4 -L RANCHER_STATE /dev/vda2
  3. Create a cloud-config.yml see for minimum content
  4. sudo mkdir /dev/sr0 for installer checking about iso mounted before
  5. Install ros with sudo ros install -t gptsyslinux -c cloud-config.yml -d /dev/vda -p /dev/vda2
  6. mkdir /mnt/efipart && sudo mount /dev/vda1 /mnt/efipart
  7. mkdir /mnt/installer && sudo mount /dev/vdb1 /mnt/installer
  8. sudo cp -r /mnt/installer/EFI /mnt/efipart
  9. Add a grub.cfg in /mnt/efipart/EFI/BOOT/grub.cfg with in it:
    You might want to add/remove autologin as you wish below

    • tty0 I think is VNC but I havent tested it
    • ttyS0 is serial (I have autologin enable in serial see below)
set timeout=1
menuentry "Rancher from GPT" {
    search --no-floppy --set=root --label RANCHER_STATE
    linux    /boot/vmlinuz-4.14.138-rancher printk.devkmsg=on rancher.state.wait panic=10 console=tty0 console=ttyS0 rancher.autologin=ttyS0
    initrd    /boot/initrd-v1.5.5
  1. sudo umount /mnt/*
  2. sudo reboot
  3. You are good to go
  4. You can remove the RAW device in the VM config in FreeNas

0 commentaire

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *