I’m newbie to CoreOS :)
about coreos: http://coreos.com/
just referred to http://coreos.com/docs/qemu/
# tail -1 /etc/lsb-release ;uname -ri
DISTRIB_DESCRIPTION="Ubuntu 13.10"
3.11.0-12-generic x86_64
# qemu-system-x86_64 --version
QEMU emulator version 1.5.0 (Debian 1.5.0+dfsg-3ubuntu5), Copyright (c) 2003-2008 Fabrice Bellard
|
download a shell which is used to boot CoreOS and a image.
# wget http://storage.core-os.net/coreos/amd64-generic/dev-channel/coreos_production_qemu.sh
# wget http://storage.core-os.net/coreos/amd64-generic/dev-channel/coreos_production_qemu_image.img.bz2
# chmod u+x coreos_production_qemu.sh
# bunzip2 coreos_production_qemu_image.img.bz2
# file coreos_production_qemu_image.img
coreos_production_qemu_image.img: QEMU QCOW Image (v2), 5721032192 bytes
|
Seen from the script, it seems to boot coreos with KVM.
# Default to KVM, fall back on full emulation
# ${METADATA} will be mounted in CoreOS as /media/metadata
qemu-system-x86_64 \
-name "$VM_NAME" \
-uuid "$VM_UUID" \
-m ${VM_MEMORY} \
-machine accel=kvm:tcg \
-drive index=0,if=virtio,media=disk,format=qcow2,file="${IMAGE_PATH}" \
-net nic,vlan=0,model=virtio \
-net user,vlan=0,hostfwd=tcp::"${SSH_PORT}"-:22 \
-fsdev local,id=metadata,security_model=none,readonly,path="${METADATA}" \
-device virtio-9p-pci,fsdev=metadata,mount_tag=metadata \
"$@"
RET=$?
|
to loting to the coreos, you need create ssh key.
on the KVM host
# whoami
root
# ssh-keygen
|
boot the coreos
# whoami
root
# ./coreos_production_qemu.sh -nographic
This is localhost.unknown_domain (Linux x86_64 3.10.10+) 16:41:38
SSH host key: ac:df:9b:7d:0f:e7:46:6c:72:1c:a5:3f:52:7d:17:ae (RSA)
SSH host key: c2:e1:9a:69:cc:6a:03:12:51:43:6f:bf:5c:71:70:d9 (DSA)
bond0:
docker0: 172.17.42.1 fe80::f411:23ff:feb9:1c9c
eth0: fe80::5054:ff:fe12:3456
gre0:
gretap0:
lo: 127.0.0.1 ::1
tunl0:
This is localhost.unknown_domain (Linux x86_64 3.10.10+) 16:49:11
SSH host key: ac:df:9b:7d:0f:e7:46:6c:72:1c:a5:3f:52:7d:17:ae (RSA)
SSH host key: c2:e1:9a:69:cc:6a:03:12:51:43:6f:bf:5c:71:70:d9 (DSA)
bond0:
docker0: 172.17.42.1 fe80::9428:21ff:fefa:8097
eth0: fe80::5054:ff:fe12:3456
gre0:
gretap0:
lo: 127.0.0.1 ::1
tunl0:
localhost login:
|
open a terminal and login to the coreos
on the KVM host
root@ubuntu:~# ssh -l core -p 2222 127.0.0.1
The authenticity of host '[127.0.0.1]:2222 ([127.0.0.1]:2222)' can't be established.
RSA key fingerprint is ac:df:9b:7d:0f:e7:46:6c:72:1c:a5:3f:52:7d:17:ae.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[127.0.0.1]:2222' (RSA) to the list of known hosts.
______ ____ _____
/ ____/___ ________ / __ \/ ___/
/ / / __ \/ ___/ _ \/ / / /\__ \
/ /___/ /_/ / / / __/ /_/ /___/ /
\____/\____/_/ \___/\____//____/
core@localhost ~ $
core@localhost ~ $ sudo su -
localhost ~ #
localhost ~ # cat /etc/lsb-release
DISTRIB_ID=CoreOS
DISTRIB_RELEASE=106.0.0
DISTRIB_CODENAME="West Coast Style"
DISTRIB_DESCRIPTION="CoreOS 106.0.0 (Official Build) dev-channel amd64-generic test"
COREOS_RELEASE_BOARD=amd64-generic
COREOS_RELEASE_DESCRIPTION="106.0.0 (Official Build) dev-channel amd64-generic test"
COREOS_RELEASE_NAME=CoreOS
COREOS_RELEASE_TRACK=dev-channel
COREOS_RELEASE_VERSION=106.0.0
COREOS_AUSERVER=htt
localhost .ssh # shutdown -h now
|
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.