Skip to content

Instantly share code, notes, and snippets.

@tomohiro
Last active July 26, 2020 19:26
Show Gist options
  • Save tomohiro/8d1ce3f0e266c0d110d9 to your computer and use it in GitHub Desktop.
Save tomohiro/8d1ce3f0e266c0d110d9 to your computer and use it in GitHub Desktop.
Creating persistent storage with CoreOS + xhyve

Creating persistent storage with CoreOS + xhyve

Environment

Setup

Install the xhyve:

$ brew install xhyve

Install dependencies:

$ brew install e2fsprogs  # For format a disk image
$ brew install gpg        # For verify a downloaded CoreOS image

Clone the coreos-xhyve repository:

$ git clone https://github.com/coreos/coreos-xhyve

Fetch a CoreOS image:

$ cd coreos-xhyve
$ ./coreos-xhyve-fetch

Create a root disk and format that:

$ dd if=/dev/zero of=./xhyve.img bs=1g count=5  # Create a 5GB disk
$ $HOMEBREW_ROOT/opt/e2fsprogs/sbin/mkfs.ext4 -L ROOT xhyve.img

Create a custom.conf like below:

$ vi custom.conf
MEMORY=2048
CHANNEL=alpha
UUID=A781EE16-5E1F-40C3-8DA4-C40E76D2E2FB # To Created by `uuidgen` command
ROOT_HDD=/absolute/path/to/your/coreos-xhyve/xhyve.img

Launch the CoreOS:

$ sudo ./coreos-xhyve-run -f custom.conf

References

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