Skip to content

Instantly share code, notes, and snippets.

@douglasmiranda
Last active April 15, 2020 21:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglasmiranda/46b1d1d4f500863c82932b5758f2b86d to your computer and use it in GitHub Desktop.
Save douglasmiranda/46b1d1d4f500863c82932b5758f2b86d to your computer and use it in GitHub Desktop.
Installing CoreOS on my old laptop

As I write this, latest CoreOS is 0.17.2.

Download, flash, boot

Get your .iso: https://coreos.com/os/docs/latest/booting-with-iso.html

Flash / burn a media, it could be a pen drive, cd, sd card with the .iso of your choice.

Tip: you could use some tool like https://etcher.io/

Insert on you laptop and boot from the chosen media.

Install to disk

Make sure you have internet acces on your machine.

We'll install to disk, so follow these steps:

https://coreos.com/os/docs/latest/installing-to-disk.html

Some tips when installing

This is the first time I'm installing CoreOS, so keep that in mind.

You will need a ignition file, which contains tasks to be excecuted after install.

Check here what you are able to do: https://coreos.com/ignition/docs/latest/examples.html


Note: there are some some ways you can get the contents needed to create the ignition file inside your CoreOS installation terminal.

Well, you have internet access, just copy from a address your ssh public key.

Or ssh into your machine with the core user, maybe you want to set a temp password:

sudo passwd core

and then ssh core@MACHINEIP


For now I just want to create to users, the "core" with ssh access, and another user with password auth.

Note: If you want password auth, you'll have to set the passwordHash with a HASH not the RAW password.

For example, you could use the openssl in your CoreOS:

sudo openssl passwd -1

Type your password, and copy the resulting hash.

You will have to create a ignition.json with the contents:

{
  "ignition": {
    "version": "2.0.0",
    "config": {}
  },
  "storage": {},
  "systemd": {},
  "networkd": {},
  "passwd": {
    "users": [
      {
        "name": "core",
        "sshAuthorizedKeys": [
          "My Public SSH KEY"
        ]
      },
      {
        "name": "laptopusername",
        "passwordHash": "password hash",
        "create": {
          "groups": [
            "sudo",
            "docker"
          ]
        }
      }
    ]
  }
}

Alter the ignition file with the username, passwordhash and ssh key of your choice, save, close.

You should probably make sure if your disk is ready. (is empty? data in it will be lost, need backup?)

Then you're ready:

We'll install CoreOS on /dev/sda the stable release with the configs on ignition.json.

coreos-install -d /dev/sda -C stable -i ignition.json

If everything is ok, in the end, you'll see something like:

...
gpg: Good signature from "CoreOS Buildbot (Offical Builds) <buildbot@coreos.com>" [ultimate]
Success! CoreOS Container Linux stable 1465.6.0 is installed on /dev/sda

Boot, after install

Remove your media, restart your machine, boot, and you're in!

Log in with your user and password, then try to log in with ssh from the machine you authorize before with your ssh pub key.

After that you may wanna know about update strategies:

https://coreos.com/os/docs/latest/update-strategies.html

Installed stable, and want some bledding edge things?? Change the update chanel, it's easy:

https://coreos.com/os/docs/latest/switching-channels.html#restart-update-engine

Try Docker:

docker run -it alpine sh

Want to update right away?

update_engine_client -update

Add / update user manually: https://coreos.com/os/docs/latest/adding-users.html#add-user-manually

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