Skip to content

Instantly share code, notes, and snippets.

@s8sg
Last active January 14, 2019 04:41
Show Gist options
  • Save s8sg/f90fdf15ca92303ef4751dc1b1c20b04 to your computer and use it in GitHub Desktop.
Save s8sg/f90fdf15ca92303ef4751dc1b1c20b04 to your computer and use it in GitHub Desktop.
Getting Started With Firecracker

Firecracker - QuickStart

Overview

Overview

Getting Started with a MicroVM

Get Latest Binary

curl -LOJ https://github.com/firecracker-microvm/firecracker/releases/download/v0.13.0/firecracker-v0.13.0
mv firecracker-v0.13.0 firecracker
chmod +x firecracker

Set r/w access to kvm

sudo setfacl -m u:${USER}:rw /dev/kvm

Copy file to $PATH

sudo cp firecracker /usr/bin/

Use firectl

Build firectl binary (Note: golang1.11 is needed)

sudo yum install -y git
git clone https://github.com/firecracker-microvm/firectl
cd firectl
make

Copy binary to $PATH

sudo cp firecracker /usr/bin/

Download kernel and root filesystem

fsSL -o /tmp/hello-vmlinux.bin https://s3.amazonaws.com/spec.ccfc.min/img/hello/kernel/hello-vmlinux.bin
curl -fsSL -o /tmp/hello-rootfs.ext4 https://s3.amazonaws.com/spec.ccfc.min/img/hello/fsfiles/hello-rootfs.ext4

Create microVM

./firectl \
  --kernel=/tmp/hello-vmlinux.bin \
  --root-drive=/tmp/hello-rootfs.ext4 \
  --kernel-opts="console=ttyS0 noapic reboot=k panic=1 pci=off nomodules rw"

Login to the microvm with username/password

root
root

Stop microvm with reboot command

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