nlf / dhyve Goto Github PK
View Code? Open in Web Editor NEWdocker meets xhyve
docker meets xhyve
I used the -m
option when I created the container, and dhyve status
also shows that I configured 8G
of memory. Despite that the dhyve os only shows 3GB when I use free
to show the total memory.
initially this will just be supporting a -n
flag on init to specify a name, and making sure we aren't overwriting an existing vm. they can just be subdirectories in $HOME/.dhyve
upgrade should check dhyve-os for latest version and binaries instead of dhyve
Instead of $HOME/.dhyve/
it should be possible to install dhyve also in other folders, e.g. on external drives.
we could make a launchd agent to automatically start docker at boot (and socat if we decide to go that route)
we should check for the latest release in github and download that instead of pulling from master or a hardcoded release
looks like this will still require a custom build
this will let us get rid of the ssh and scp commands
i know we discussed this at some point and said no because the xhyve binary is out of date, but i just noticed that a HEAD
target is available in homebrew which builds the latest git revision. that would certainly work for our purposes.
the file /Library/Preferences/SystemConfiguration/com.apple.vmnet
doesn't exist.
This leads to errors of the flavor:
The domain/default pair of (/Library/Preferences/SystemConfiguration/com.apple.vmnet, Shared_Net_Mask) does not exist
/usr/local/bin/dhyve: line 82: ( << 24) | ( << 16) | ( << 8) | : syntax error: operand expected (error token is "<< 24) | ( << 16) | ( << 8) | ")
/usr/local/bin/dhyve: line 82: ( << 24) | ( << 16) | ( << 8) | : syntax error: operand expected (error token is "<< 24) | ( << 16) | ( << 8) | ")
/usr/local/bin/dhyve: line 91: & : syntax error: operand expected (error token is "& ")
so this is just a thought i had, but i wanted to write it down so we could talk about it..
if we add a dependency on socat, we can actually create a unix socket on the host osx system that would automatically forward to the running vm's docker daemon, which would totally eliminate the need for the user to ever call eval "$(dhyve env)"
and most things would just work™
worth the extra dependency for the simplicity?
In our company my docker containers need to talk to http via a http proxy.
Within boot2docker I was using the boot2docker profile and I exported the http_proxy env variable there.
I am not sure how to approach this actually with dhyve and there might be better solutions or existing workarounds.
Ideally I would like to add some env variables to the VM maybe when creating it or even have a dedicated option on dhave to add a http(s) proxy because it might be a quite general use case?
everything but the kernel, initrd, and disk should be stored in one file. having all these text files with one line in them is silly.
I found your custom boot2docker with your pull request, but the URLs in download_boot2docker
scares me and someone probably.
I recommend you to add some comments or put them in the release page at nlf/boot2docker or here.
What do you think?
dhyve up
seems to change my default route to go over the bridge interface instead of en(0|1), and then I have to manually restore the default route in order to do anything over the network again. I'd be delighted to offer extra debug information, but I'm not sure what to collect or how.
With latest xhyve from git today, dhyve up fails to start, endlessly waiting for something. Host is OSX 10.11
$ sudo dhyve up
[dhyve] starting..........................................................................................................................................................................................
But seems to be started:
$ dhyve status
[dhyve] status: running
name: dhyve
pid: 31013
ip: 192.168.64.4 [dhyve.vm]
disk: 10G /Users/rrj/.dhyve/disk.img
args: -A -m 2G -c 1 -s 0:0,hostbridge -l com1,stdio -s 31,lpc -s 2:0,virtio-net -s 4,virtio-blk,/Users/rrj/.dhyve/disk.img -U 2996454B-06DE-43B0-9FC6-9E9F38D1DCAE -f kexec,/Users/rrj/.dhyve/bzImage,/Users/rrj/.dhyve/rootfs.cpio.xz
kargs: console=ttyS0 hostname=dhyve
versions:
dhyve: v2.0.0
vm: v1.2.0
However not reachable:
$ ping 192.168.64.4
PING 192.168.64.4 (192.168.64.4): 56 data bytes
ping: sendto: Host is down
ping: sendto: Host is down
$ ifconfig bridge100
bridge100: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=3<RXCSUM,TXCSUM>
ether 62:03:08:09:dc:64
inet 192.168.64.1 netmask 0xffffff00 broadcast 192.168.64.255
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en6 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 24 priority 0 path cost 0
Address cache:
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
xhyverun.sh
for the same version of xhyve works fine.
dhyve starts but never detects an IP address in the VM. dhcpd_leases
seems to be empty, so the issue perhaps is inside the VM, or the xhyve command used to start dhyve?
dhyve up
[dhyve] this command requires root, restarting with sudo..
[dhyve] starting..................................................................................................................................................................................
I've just run into this on a couple of systems. It would be really helpful if there's a way to see the xhyve log, tail or tee somewhere would be fine BTW. I've been killing xhyve and running it in its own tmux session to work this out.
Mounting NFS share:ip: RTNETLINK answers: Network is unreachable
tsc: Refined TSC clocksource calibration: 2891.323 MHz
clocksource tsc: mask: 0xffffffffffffffff max_cycles: 0x29ad3e522e4, max_idle_ns: 440795354379 ns
ip: RTNETLINK answers: Network is unreachable
Switched to clocksource tsc
ip: RTNETLINK answers: Network is unreachable
ip: RTNETLINK answers: Network is unreachable
ip: RTNETLINK answers: Network is unreachable
ip: RTNETLINK answers: Network is unreachable
ip: RTNETLINK answers: Network is unreachable
ip: RTNETLINK answers: Network is unreachable
ip: RTNETLINK answers: Network is unreachable
ip: RTNETLINK answers: Network is unreachable
FAIL
Starting ntpd: OK
Starting dropbear sshd: OK
Starting docker: OK
Configuring sysctl: net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
OK
bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
Bridge firewalling registered
DhyveOS
dhyve login:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
xhyve 63055 root cwd DIR 44,7 20 2 /projects
xhyve 63055 root txt REG 1,3 218808 6864004 /usr/local/Cellar/xhyve/0.2.0/bin/xhyve
xhyve 63055 root txt REG 1,3 37744 6814530 /System/Library/Frameworks/Hypervisor.framework/Versions/A/Hypervisor
xhyve 63055 root txt REG 1,3 39584 6823415 /System/Library/Frameworks/vmnet.framework/Versions/A/vmnet
xhyve 63055 root txt REG 1,3 638288 6840128 /usr/lib/dyld
xhyve 63055 root txt REG 1,3 488540694 6855761 /private/var/db/dyld/dyld_shared_cache_x86_64
xhyve 63055 root 0u CHR 16,2 0t20941 693 /dev/ttys002
xhyve 63055 root 1u CHR 16,2 0t20941 693 /dev/ttys002
xhyve 63055 root 2u CHR 16,2 0t20941 693 /dev/ttys002
xhyve 63055 root 3u KQUEUE count=1, state=0x12
xhyve 63055 root 4u systm 0t0
xhyve 63055 root 5u REG 44,45 21474839552 93 /virt/dhyve/disk.img
xhyve 63055 root 6u KQUEUE count=1, state=0xa
xhyve 63055 root 7 PIPE 0xc574a8b8bb570cb 16384 ->0xc574a8b8bb56c4b
xhyve 63055 root 8 PIPE 0xc574a8b8bb56c4b 16384 ->0xc574a8b8bb570cb
ip addr
in dhyve itself:hyve login: docker
Password:
DhyveOS version 1.1.0, build master : cac41a5 - Sun Aug 2 18:33:50 UTC 2015
Docker version 1.7.1, build 786b29d
$ ip addr
1: lo: <LOOPBACK> mtu 65536 qdisc noop
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: dummy0@NONE: <BROADCAST,NOARP> mtu 1500 qdisc noop
link/ether 4e:a4:a1:e8:f8:1c brd ff:ff:ff:ff:ff:ff
3: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
link/ether de:f4:cf:47:cf:32 brd ff:ff:ff:ff:ff:ff
4: docker0@NONE: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
link/ether e2:e3:ad:c6:a8:f1 brd ff:ff:ff:ff:ff:ff
inet 172.17.42.1/16 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::e0e3:adff:fec6:a8f1/64 scope link
valid_lft forever preferred_lft forever
$
ifconfig
from hostlo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=1<PERFORMNUD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>
ether a8:20:66:52:0c:f8
inet6 fe80::aa20:66ff:fe52:cf8%en0 prefixlen 64 scopeid 0x4
inet6 2001:1620:f00:8287:aa20:66ff:fe52:cf8 prefixlen 64 autoconf
inet6 2001:1620:f00:8287:587:4177:3a78:f49e prefixlen 64 autoconf temporary
inet 10.0.0.2 netmask 0xffffff00 broadcast 10.0.0.255
nd6 options=1<PERFORMNUD>
media: autoselect (100baseTX <full-duplex,flow-control>)
status: active
en1: flags=8823<UP,BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500
ether 8c:2d:aa:3e:03:9b
nd6 options=1<PERFORMNUD>
media: autoselect (<unknown type>)
status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 32:00:13:b2:3e:00
media: autoselect <full-duplex>
status: inactive
en3: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 32:00:13:b2:3e:01
media: autoselect <full-duplex>
status: inactive
p2p0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 2304
ether 0e:2d:aa:3e:03:9b
media: autoselect
status: inactive
awdl0: flags=8903<UP,BROADCAST,PROMISC,SIMPLEX,MULTICAST> mtu 1484
ether 2a:67:44:0b:44:40
nd6 options=1<PERFORMNUD>
media: autoselect
status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether aa:20:66:25:38:00
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 6 priority 0 path cost 0
member: en3 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 7 priority 0 path cost 0
nd6 options=1<PERFORMNUD>
media: <unknown type>
status: inactive
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
inet6 fe80::a593:f7c7:e721:9c45%utun0 prefixlen 64 scopeid 0xb
inet6 fdc9:ad4b:5e7a:f651:a593:f7c7:e721:9c45 prefixlen 64
nd6 options=1<PERFORMNUD>
en7: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
ether 2e:21:53:c1:d7:7a
media: autoselect
status: active
bridge100: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=3<RXCSUM,TXCSUM>
ether aa:20:66:25:38:64
inet 192.168.64.1 netmask 0xffffff00 broadcast 192.168.64.255
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en7 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 12 priority 0 path cost 0
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
It seems dhyve does not cope well with Cisco AnyConnect based VPNs. Servers behind the VPN are pingable from the host, but not from the dhyve guest.
I'm assuming the host does not know that it should route between the bridge and the VPN. Any ideas on how to achieve this?
I had to manually pull it.
if we have, for example dhyve
and dhyve-os
into separate repos, then it's possible to update one without impacting the other or having to create an artificial release that copies the same binaries or script as the previous release.
we'll have to make another repo for the formula, but it would make things nicer for users
$ dhyve ssh
[dhyve] starting ssh session..
ssh: Could not resolve hostname dhyve.vm: nodename nor servname provided, or not known
Adding dhyve.vm to /etc/hosts helped.
Maybe the .vm tld collides with vagrant-landrush?
$ cat /etc/resolver/vm
# Generated by landrush, a vagrant plugin
nameserver 127.0.0.1
port 10053
If the coreutils are installed via homebrew the dhyve init fails with:
[dhyve] saving options..done
[dhyve] generating a new ssh key..done
[dhyve] generating a disk image..mktemp: too few X's in template ‘dhyve’
/usr/local/bin/dhyve: Zeile 246: /dhyve, please format-me: Permission denied
cp: cannot create regular file ‘/.ssh/authorized_keys’: Permission denied
tar: could not chdir to ''
Removing them from the search path fixes this:
[dhyve] saving options..done
[dhyve] generating a new ssh key..done
[dhyve] generating a disk image...done
[dhyve] downloading vm version v1.3.0..done
[dhyve] finished creating vm, to start it run 'dhyve up'
I can't connect using ssh. I've set up the vm multiple times, but it doesn't work.
$ ssh [email protected]
Connection closed by 192.168.64.3
$ ssh dhyve.vm
Connection closed by 192.168.64.3
Any idea what's the problem?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.