Name: coreos-xhyve
Owner: CoreOS
Description: Container Linux running on xhyve hypervisor
Created: 2015-06-11 02:11:43.0
Updated: 2018-05-23 09:09:02.0
Pushed: 2018-01-04 20:27:50.0
Size: 40
Language: Shell
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
ew install xhyve
t clone https://github.com/mist64/xhyve
xhyve
ke
do cp build/xhyve /usr/local/bin/
yve -h
e: xhyve [-behuwxACHPWY] [-c vcpus] [-g <gdb port>] [-l <lpc>] ...
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.
os-xhyve-fetch
coreos-xhyve-run
In your terminal you should see something like this:
is localhost (Linux x86_64 4.0.3) 02:59:17
host key: 92:2e:78:25:8e:81:f3:74:61:c7:3b:79:db:3b:0f:c2 (DSA)
host key: 55:19:07:2c:44:9d:0c:f8:61:9e:95:97:61:ab:c5:c5 (ED25519)
host key: ba:69:da:37:7e:c2:b6:26:e4:72:b5:94:d4:b8:97:bb (RSA)
: 192.168.64.1 fe80::24d7:36ff:fe1d:cf32
lhost login: core (automatic login)
OS stable (695.0.0)
te Strategy: No Reboots
login: Thu Jun 11 02:59:17 +0000 2015 on /dev/tty1.
@localhost ~ $
Now you can try to ssh in:
h core@192.168.64.1
Or try out docker:
ew install docker
cker -H 192.168.64.1:2375
Or try out rkt:
stemd-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:
rl 192.168.64.1:2379/version
2.0.10
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).
coreos-xhyve-run SSHKEY="ssh-rsa AAAAB3...== x@y.z" ...
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:
f=/dev/zero of=./xhyve.img bs=1M count=5000
/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
replaceAllow from localhost
byAllow 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.