HELP: please setting up RancherOS

csjjpm

Contributor
Joined
Feb 16, 2015
Messages
126
Hi,
I'm following this https://www.truenas.com/community/resources/how-to-rancheros-on-freenas-11-0.50/
I've setup a iohyve pool with;
iohyve setup pool=WD20EARS kmod=1 net=em0
this has created a folder '/mnt/iohyve'

I wget the iso into my root user folder in shell but when I do cpiso I get an error

root@freenas:~ # iohyve cpiso rancheros.iso
Copying rancheros.iso from rancheros.iso...
cp: /iohyve/ISO/rancheros.iso: No such file or directory

the command has created a rancheros.iso folder but it is empty
root@freenas:/mnt/iohyve/ISO # ls -l
total 1
drwxr-xr-x 2 root wheel 2 Jan 20 22:02 rancheros.iso

any ideas what I'm doing wrong?
thank you
Paul
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Are you really running 11.0 today? With 11.3 or TrueNAS 12.0 there's a UI for VMs ... I'm puzzled by the presence of iohyve at all.
 

csjjpm

Contributor
Joined
Feb 16, 2015
Messages
126
Hi. I've got TrueNAS 12 but I thought it mustn't be supported as in VNC it fails to boot UEFI and goes straight to shell.
I can't pick Grun or UEFI-CSM as it says VNC doesn't work with those. Not sure how I am supposed to install it.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
RancherOS can only boot from GRUB, sorry. I went through this pain when the 11.3 upgrade came out, and wrote up some tips.

 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Second part of the RancherOS how-to:

 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
However, RancherOS is EOL, but k3os isn't at a 1.x release yet, so there's no official RancherLabs solution at this point. I'm running RancherOS 1.5.7, the latest release until k3os is ready. Some enterprising folks have forked RancherOS to a new project, BurmillaOS, which looks promising.
 
Last edited:

csjjpm

Contributor
Joined
Feb 16, 2015
Messages
126
Hi Samuel, thank you for letting me know. I think I'll wait and look at k3os when it is released.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Depending on how soon k3os becomes available, you may also want to consider TrueNAS Scale, which will run k3s natively.
 

myway

Cadet
Joined
Jun 1, 2021
Messages
2
@csjjpm here is how to, and give you my self-create rancher ufei ready img file.

rancheros-v1.5.8-truenas.vm.img.7z

sudo passwd rancher

[rancher@RancherOS ~]$ sudo fdisk -l
Disk /dev/vda: 8 GiB, 8589934592 bytes, 16777216 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

Disk /dev/sda: 200 MiB, 209715200 bytes, 409600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 131072 bytes
I/O size (minimum/optimal): 131072 bytes / 131072 bytes
Disklabel type: gpt
Disk identifier: 7C7D5507-E5CF-40FB-966B-9EA473384E62

Device Start End Sectors Size Type
/dev/sda1 2048 409566 407519 199M EFI System


[rancher@RancherOS ~]$ sudo fdisk /dev/vda
g,n,1,enter,+200M,t,1,n,enter,enter,enter,w

[rancher@RancherOS ~]$ sudo fdisk -l /dev/vda
Disk /dev/vda: 8 GiB, 8589934592 bytes, 16777216 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: 1D8F9247-9F90-F04E-9DF8-6282A73C0654

Device Start End Sectors Size Type
/dev/vda1 2048 411647 409600 200M EFI System
/dev/vda2 411648 16777182 16365535 7.8G Linux filesystem

#Format the boot partition
[rancher@RancherOS ~]$ sudo mkdosfs -n RANCHER_UEFI -F 32 /dev/vda1

#Format the main filesystem

[rancher@RancherOS ~]$ sudo mkfs.ext4 -L RANCHER_STATE /dev/vda2
mke2fs 1.43.9 (8-Feb-2018)
Creating filesystem with 2045691 4k blocks and 512064 inodes
Filesystem UUID: ad2f757f-835f-4c62-8b9d-9d666f198379
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

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

#Create a cloud-config.yml
[rancher@RancherOS ~]$ sudo vi /home/rancher/cloud-config.yml


...

#Cheat installer checking about iso mounted
[rancher@RancherOS ~]$ sudo mkdir /dev/sr0

#Install ros
[rancher@RancherOS ~]$ sudo ros install -f -t gptsyslinux -c /home/rancher/cloud-config.yml -d /dev/vda -p /dev/vda2 --no-reboot --debug


#Move UEFI and boot file from /dev/sda1 (pre-mount rancheros.img) to /dev/vda1 (EFI System)
[rancher@RancherOS ~]$ sudo fdisk -l

Disk /dev/vda: 8 GiB, 8589934592 bytes, 16777216 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: 1D8F9247-9F90-F04E-9DF8-6282A73C0654

Device Start End Sectors Size Type
/dev/vda1 2048 411647 409600 200M EFI System
/dev/vda2 411648 16777182 16365535 7.8G Linux filesystem

Disk /dev/sda: 200 MiB, 209715200 bytes, 409600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 131072 bytes
I/O size (minimum/optimal): 131072 bytes / 131072 bytes
Disklabel type: gpt
Disk identifier: 7C7D5507-E5CF-40FB-966B-9EA473384E62

Device Start End Sectors Size Type
/dev/sda1 2048 409566 407519 199M EFI System

[rancher@RancherOS ~]$ mkdir /mnt/efipart && sudo mount /dev/vda1 /mnt/efipart
[rancher@RancherOS ~]$ mkdir /mnt/installer && sudo mount /dev/sda1 /mnt/installer
[rancher@RancherOS ~]$ sudo cp -r /mnt/installer/ /mnt/efipart


#change grub.cfg in /mnt/efipart/BOOT/grub/ as below
#ttyS0 is serial ( autologin enable in serial )

set timeout=15
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
menuentry "Rancher from GPT" {
search --no-floppy --set=root --label RANCHER_STATE
linux /boot/vmlinuz-4.14.138-rancher printk.devkmsg=on rancher.state.dev=LABEL=RANCHER_STATE rancher.state.wait panic=10 console=tty0 rancher.autologin=tty0 console=ttyS0 rancher.autologin=ttyS0
initrd /boot/initrd-v1.5.8
}

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.8
}

#--lable RANCHER_STATE is what we done before as "sudo mkfs.ext4 -L RANCHER_STATE /dev/vda2" .

[rancher@RancherOS ~]$ sudo umount /mnt/installer
[rancher@RancherOS ~]$ sudo umount /mnt/efipart
[rancher@RancherOS ~]$ sudo shutdown

#remove RAW setting in TrueNAS VM config .
Reboot and have fun.
 
Top