CoreOS installation on BareMetal or VirtualBox via CoreOS ISO image

oreOS Linux is the leading container operating system, designed to be managed and run at massive scale, with minimal operational overhead. Applications on CoreOS run in containers, providing developer-friendly tools for deploying software.

First time I heard about CoreOS I wanted to install on my Virtualbox to test . Testing is my way to learn . You may have AWS or Digital Ocen account  to create and install CoreOS via ready snapshots but I prefer to install it in my Virtualbox on my laptop . So I start searching about CoreOS and I find a lot of detailed installation documents that wanted you  to know about other topics such as etcd , fleet , etc . But no . I just want to install as simplest as I can to try . CoreOS has its own way of installation .

It is not like other distributions to boot from the os installation media and partitioning and next - next to install . here we need to write a script ( cloud-config.yaml ) In this file we will describe the hostname , what is the username and ssh key for login  , etc . For a basic setup we will just set these 4 options . So use your editor and create cloud-config.yaml with the following content . Here we specify the hostname . username to login to our system . This username should be in suders and docker groups so that we can run docker later . and the ssh authorized keys so that we can connect password less . 

hostname: node001
 - name: omid
      - sudo
      - docker
      - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDHvxiNz2qJJFFwtPYhWaKjdE7k+Pcmzshvd3Qahp4ekG150FbUqDjJo4j53s4bmNTWthx43ICvYjDdVtHpU1zYOqIA+GvI1FFpFIgq6mb1g39eJcubakbgZbFGEk0JQCmWMt6g6vBk8S2mb97jjNGyOyDpLcJa8gxh54Dn9jDoVQ== Omid@Omids

The cloud-config file uses the YAML file format, which uses whitespace and new-lines to delimit lists, associative arrays, and values. CoreOS website has a useful syntax checker you can use . to validate the config file. So What is the next step ? How can I install the CoreOS with this file ? We need to boot from a Linux Distro and run the config YAML . So why not using the CoreOS itself . Download ISO file from CoreOS website and Load to virtual box . Set the Virtual box networking to Bridge network . Because We need to copy cloud-config.YAML into our booted CoreOS. After booting with coreOS iso scp the cloud config file .

scp omid@ . 

and install the core os on local disk /dev/sda/ with our cloud-config.yaml file . 
sudo coreos-install -c cloud-config.yaml -d /dev/sda/ 
That's it . It will download . partition and install the CoreOS .