Giter VIP home page Giter VIP logo

coreos-xhyve's Introduction

CoreOS + xhyve

WARNING

  • xhyve is a very new project, expect bugs! You must be running OS X 10.10.3 Yosemite or later and 2010 or later Mac for this to work.
  • if you use any version of VirtualBox prior to 5.0 then xhyve will crash your system either if VirtualBox is running or had been run previously after the last reboot (see xhyve's issues #5 and #9 for the full context). So, if you are unable to update VirtualBox to version 5, or later, and were using it in your current session please do restart your Mac before attempting to run xhyve.

Step by Step Instructions

Install xhyve

from homebrew (recommended)

$ brew install xhyve

or from source

$ git clone https://github.com/mist64/xhyve
$ cd xhyve
$ make
$ sudo cp build/xhyve /usr/local/bin/

check it is working...

$ xhyve -h
Usage: xhyve [-behuwxACHPWY] [-c vcpus] [-g <gdb port>] [-l <lpc>] ...

Download and run CoreOS

By default, the following commands will fetch the latest CoreOS Alpha image available, verify it (if you have gpg installed in your system) with the build public key, and then run it under xhyve.

coreos-xhyve-fetch
sudo coreos-xhyve-run

In your terminal you should see something like this:

This is localhost (Linux x86_64 4.0.3) 02:59:17
SSH host key: 92:2e:78:25:8e:81:f3:74:61:c7:3b:79:db:3b:0f:c2 (DSA)
SSH host key: 55:19:07:2c:44:9d:0c:f8:61:9e:95:97:61:ab:c5:c5 (ED25519)
SSH host key: ba:69:da:37:7e:c2:b6:26:e4:72:b5:94:d4:b8:97:bb (RSA)
eth0: 192.168.64.1 fe80::24d7:36ff:fe1d:cf32

localhost login: core (automatic login)

CoreOS stable (695.0.0)
Update Strategy: No Reboots
Last login: Thu Jun 11 02:59:17 +0000 2015 on /dev/tty1.
core@localhost ~ $

Now you can try to ssh in:

Or try out docker:

$ brew install docker
$ docker -H 192.168.64.1:2375

Or try out rkt:

$ systemd-run rkt --insecure-skip-verify run coreos.com/etcd,version=v2.0.10 -- --listen-client-urls 'http://0.0.0.0:2379,http://0.0.0.0:4001'

And test from your laptop:

$ curl 192.168.64.1:2379/version
etcd 2.0.10

Customize

The coreos-xhyve-fetch and coreos-xhyve-run behavior can be customized through the following environment variables:

  • XHYVE
    defaults to xhyve.
    sets the absolute location (or name, in which case it will search in the $PATH) of the default xhyve binary to use.

  • CHANNEL
    defaults to alpha.
    available alternatives are stable and beta

  • VERSION
    defaults to latest.

  • CPUS
    defaults to 1.

  • MEMORY
    defaults to 1024.
    value is understood as being in MB.

  • UUID defaults to a random uuid.
    set to a constant value in order to achieve the same IP address across VM reboots.

  • SSHKEY
    defaults to none if set it will add, on startup, the given SSH public key to the core user's authorized_keys file (it is usually in ~/.ssh/id_rsa.pub).

    sudo coreos-xhyve-run SSHKEY="ssh-rsa AAAAB3...== [email protected]" ...
    
  • ROOT_HDD
    defaults to none. if set to the absolute path of a pre-formated ext4 disk image, then the provided image will be used for a writable root partition, allowing data to persist across reboots of the VM.

    creating a disk image:

    dd if=/dev/zero of=./xhyve.img bs=1M count=5000
    /usr/local/opt/e2fsprogs/sbin/mkfs.ext4 -L ROOT xhyve.img
    

    note: this requires you to install e2fsprogs (brew install e2fsprogs)

  • EXTRA_ARGS
    defaults to none.
    used to manually set additional VM parameters that do not fit elsewhere (tap devices, etc).

  • CLOUD_CONFIG
    defaults to https://raw.githubusercontent.com/coreos/coreos-xhyve/master/cloud-init/docker-only.txt
    has to be a valid, reachable, URL, pointing to a valid cloud-config file.

    tip:
    see here for how to host your custom cloud-config locally, so that you can run CoreOS locally without any online dependencies, then on /etc/apache2/users/<YourUsername>.conf replace Allow from localhost by Allow from localhost, 192.168.0.0/255.255.0.0.
    usage would be something like...
    CLOUD_CONFIG=http://192.168.64.1/~am/coreos-xhyve/xhyve.cloud-init ./coreos-xhyve-run

For any given VM you can define all your custom settings in a file and then just consume it like coreos-xhyve-run -f custom.conf. See here for an example.

coreos-xhyve's People

Contributors

andrewrothstein avatar antoniomeireles avatar bakins avatar bcwaldon avatar c4milo avatar chancez avatar jonboulle avatar kyab avatar marineam avatar philips avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coreos-xhyve's Issues

TLS errors connecting OSX docker client to CoreOS guest

Brought up both alpha and stable coreos images on xhyve, works fine. Now trying to connect with docker client from OSX:

$ docker -H 192.168.64.5:2375 images
An error occurred trying to connect: Get https://192.168.64.5:2375/v1.19/images/json: tls: oversized record received with length 20527

Tested with docker client 1.7.1, 1.6.2 and 1.5.0. The above command works fine directly on the CoreOS guest. Is there perhaps some TLS configuration needed here?

Install to disk

Currently this script runs exclusively out of memory, make it a (default) option to run from disk. xhyve supports this so it shoudl just be a matter of creating an empty file or even using an existing CoreOS disk image.

assign static IP/s

assigning static IPs would be nice too, specially if you want to run a few xhyve/coreos VMs at the same time

No space left on device with docker

When I try to run one of my docker-composed containers I quickly run out of space.
I see the disk is currently only 512Mb, is there a way to increase this?

No output

I'm trying to get this running. xhyve runs. But what is the expected out put from ./coreos-xhyve-fetch Mine is empty. Any pointers for debugging it?

This is the output from sudo ./coreos-xhyve-run BTW:

kexec: failed to load kernel imgs/coreos_production_pxe.vmlinuz
                                                               ./coreos-xhyve-run: line 17:  3764 Abort trap: 6           xhyve $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_HDD -f kexec,imgs/$VMLINUZ,imgs/$INITRD,"$CMDLINE"

figure out automation of IP addresses

It is a bit annoying that you have to visually find the IP address from the terminal and setup docker, ssh, etc. Figure out a way to automate this.

Single command CoreOS launch

How plausible would it be to have a single command that could fetch and verify CoreOS images then launch them.

Something like:

$./coreos --root=/tmp/foo.img --release=695.0.0
Downloading 695.0.0 image...
Verifying image...
Extracting to root disk...
Booting CoreOS 695.0.0:
... boot stuff

Minor corrections to the blog post

The blog should note that you need gpg installed before running:

$ ./coreos-xhyve-fetch

This can be achieved on some systems with:

$ brew install gpg


This line has a typo:

$ sudo ./sudo coreos-xhyve-run

and should read:

$ sudo ./coreos-xhyve-run


This line also has a typo:

$ docker -H:2375 run -it --rm busybox

and should read:

$ docker -H :2375 run -it --rm busybox

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.