At the time of writing, Rancher does not publish VM images that are not aimed at a particular cloud provider and I therefore set about installing RancherOS with just the provided ISO.

Step 1: Download and import images

To begin, download the RancherOS ISO and then upload it into OpenNebula’s image system.

sudo -u oneadmin -i
cd /tmp
oneimage create --name RancherOS --path /tmp/rancheros.iso \
                --prefix hd --type CDROM -d default

The image type CDROM is used as the ISO is used to install the OS rather than as a boot disk. Although it may be possible to boot from the image with a different prefix than hd, this is the one I got working first (using vd did not work).

Now that we have an installer ISO, let’s create a blank qcow2 image that will be used as the OS disk and then import it into OpenNebula.

qemu-img create -f qcow2 -o size=10G /tmp/blank.qcow2
oneimage create --name Blank --path /tmp/blank.qcow2 \
                --prefix vd --type OS -d default --driver qcow2

In this case, we specify the qcow2 driver, type and prefix for an OS disk.

Step 2: Creating a template

Once the images have been imported, we can create a template to use for RancherOS. It is composed of the following parts:

  • A boot disk (Blank) for the OS to be installed on.

  • A cdrom (RancherOS) to install the OS with.

  • The correct boot order for installing and then using RancherOS.

  • A network adapter.

The following template is an example of the above requirements.

  IMAGE="Blank 10GB",
  SIZE="10240" ]
  IMAGE="RancherOS v0.4.4",
  IMAGE_UNAME="james" ]
  TYPE="vnc" ]
  NETWORK_UNAME="james" ]
  BOOT="hd,cdrom" ]

You can either adapt the above or manually create one with the onetemplate tool or SunStone GUI.

NB: As the RancherOS ISO does not support OpenNebula’s contextualization, we must manually configure networking (shown below).


Step 3: Creating a VM

Create a new VM with the template that was configured in the previous step and then use the built-in VNC client (part of the SunStone GUI) to see the console. If the above was done correctly, the VM should have booted from the RancherOS ISO.

Step 4: Install RancherOS onto the main disk

Once the VM has booted, login with the username rancher and password rancher. Following the instructions on the RancherOS documentation, install RancherOS to /dev/vda and then (when asked) choose to reboot. If everything was installed correctly, the VM will now boot from RancherOS on the hard drive.

An example cloud config is shown below (see the RancherOS cloud config reference).

  - ssh-rsa AAAAB3...igrw== MyKey

        dhcp: false
        mtu: 1500
      # If this MAC address happens to match eth0, eth0 will be programmed to use DHCP.
        dhcp: true

Once you’ve made a cloud config file with all of the required configuration, use the ros command to install RancherOS to the main disk.

vi cloud-config.yml
sudo ros install -c cloud-config.yml -d /dev/vda

Step 5: Install the RancherOS server

Login to the VM with one of the SSH keys configured above and then use the following command to install the server (where is the VM IP address configured in the cloud-config.yml above).

ssh rancher@
# In the VM
sudo docker run -d --restart=always -p 8080:8080 rancher/server

In a few minutes, your new RancherOS install will be visible at Enjoy!

If anything isn’t clear please contact me via Twitter or the e-mail shown below and I’ll do my best to update this guide.