# Installing RancherOS on disk with iPXE

**URL:** <https://forums.suse.com/t/installing-rancheros-on-disk-with-ipxe/1168>\
**Category:** RancherOS\
**Created:** [December 4, 2015, 1:33pm UTC](https://forums.suse.com/t/installing-rancheros-on-disk-with-ipxe/1168 "2015-12-04T13:33:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brutus333](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@brutus333](https://forums.suse.com/u/brutus333)\
**Post date:** [December 4, 2015, 1:33pm UTC](https://forums.suse.com/t/installing-rancheros-on-disk-with-ipxe/1168/1 "2015-12-04T13:33:25Z")

</div>

Hello!  
I am trying to automate the installation of the RancherOS on a virtual machine.  
The route I took involves booting the RancherOS via iPXE (which works fine) with a custom cloud-config file (generated by Foreman) and after running the ros install command.  
I’m not sure how to automatically call the ros install command during iPXE boot; I looked at: [https://github.com/rancher/os/issues/446#issuecomment-131446590](https://github.com/rancher/os/issues/446#issuecomment-131446590) and I’m thinking to run a command via a container like they does, but how to ensure that the container starts only once and not at every boot?  
Is there any better way to automate the RancherOS install?

Thank you,  
Virgil

---

<div class="post-metadata">

**Author:** ![wiktor](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/wiktor/32/628_2.png) [@wiktor](https://forums.suse.com/u/wiktor)\
**Post date:** [December 6, 2015, 5:22pm UTC](https://forums.suse.com/t/installing-rancheros-on-disk-with-ipxe/1168/2 "2015-12-06T17:22:49Z")

</div>

I’m using a simple cloud config like that:

```auto
#cloud-config
write_files:
  - path: /opt/rancher/bin/install.yml
    permissions: "0700"
    content: |
      #cloud-config
      hostname: rancher-os
      ssh_authorized_keys:
        - ... 
  - path: /opt/rancher/bin/start.sh
    permissions: "0700"
    content: |
      #!/bin/bash
      echo Y | sudo ros install -f -c /opt/rancher/bin/install.yml -d /dev/sda

```

Yep, that’s cloud config inside cloud config. The outer one is used only during first boot to install to disk. The inner one is used after install.
