Skip to content

Instantly share code, notes, and snippets.

@s1lvester
Last active March 17, 2021 02:47
Show Gist options
  • Save s1lvester/fc5bcd4d3eb8e0c93b11854a01a0a034 to your computer and use it in GitHub Desktop.
Save s1lvester/fc5bcd4d3eb8e0c93b11854a01a0a034 to your computer and use it in GitHub Desktop.
Write-up on playing around with RancherOS

RancherOS write-along

Date: 2016-10-04 Version: 1
Author: [email protected]

I just installed RancherOS on my FreeNAS-Machine See this gist. Afterwards this is a small writeup on what I did next.

First Container

See Quick Start Guide in the Rancher docs.

# Everything below via [rancher@rancher ~]$

sudo system-docker ps
sudo docker ps

There are two docker-daemons! The system-docker runs only system services, the other one only client containers.

# Install and run "linux-dash" (a server-monitor)

$ sudo system-docker run -d --net=host --name busydash husseingalal/busydash

In the commad, we used --net=host to tell System Docker not to containerize the container’s networking, and use the host’s networking instead. After running the container, you can see the monitoring server by accessing http://rancher . To make the container survive use:

$ sudo mkdir -p /opt/rancher/bin
$ sudoedit /opt/rancher/bin/start.sh

    # Autostart

    # Update and Start busydash
    sudo system-docker pull husseingalal/busydash
    sudo system-docker start busydash

$ sudo chmod 755 /opt/rancher/bin/start.sh

System Consoles

The whole RancherOS isn't persistend. So everything gets lost after reboot.

$ sudo ros console enable ubuntu

This should enable persistence inside the following directories:

/home
/opt
/var/lib/docker
/var/lib/rancher

So after a reboot I'm greeted with a standard ubuntu shell. YEAY! After the usual stuff this should feel like home:

$ sudo apt-get update
$ sudo apt-get install git vim tmux zsh
$ git clone git clone https://github.com/s1lvester/mydotfiles .mydotfiles

... and so on.

OMG! I FUBAR!

If you're like me, then sooner or later you're going to FUBAR. The great thing about RancherOS is that state in which you're booting is defined by the kernel line. So here are my 2ct on how to fix upcoming issues.

  1. attach to the console in a second ssh-session to the FreenNAS-root.
  2. in the first session stop the rancheros-bhyve and restart. I used sleep 2 && iohyve start rancheros in order to get enough time to switch sessions
  3. interrupt the grub-autoboot and press e
  4. delete the state parameters and add rancher.password=rancher
  5. you'll be able to login via console.
@tomru
Copy link

tomru commented Jun 6, 2019

Thanks for this!

sudo ros enable console ubuntu
should be
sudo ros console enable ubuntu

@s1lvester
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment