top | item 9690846

Xhyve – Lightweight Virtualization on OS X Based on Bhyve

226 points| ingve | 10 years ago |pagetable.com | reply

72 comments

order
[+] bruienne|10 years ago|reply
This runs boot2docker pretty well out of the box. I made the required edits to xhyverun.sh as found in this gist: https://gist.github.com/bruienne/d1053df883b47822c6e

It requires that you copy the vmlinuz64 and initrd.img files from the B2D ISO to a local filesystem location. As of right now enabling networking requires root privileges. Not sure if the Hypervisor framework has user-level accommodations for that.

[+] simonvdv|10 years ago|reply
Your script is pretty much the same as mine, good to see :) For everyone who wants to give it a try and wants some instructions http://simonvanderveldt.nl/boot2docker-on-xhyve/

I've also done some quick benchmarks, they are at the bottom of the post. Virtualbox had about 50% higher disk IO performance in my measurements.

Regarding the root permissions for networking: As far as I know it shouldn't be necessary if you sign the xhyve binary, haven't tried that though.

[+] Osmium|10 years ago|reply
Really glad to see someone using Hypervisor.framework, looks like it has a lot of potential. Fusion/Parallels always seem far too heavyweight to me.
[+] tachion|10 years ago|reply
Not to mention they're paid solutions, closed source and are horrible for battery life. Their only advantage is nice set of GUI tools and tight OS X integration.
[+] alisnic|10 years ago|reply
This is great, is it possible to make it work with Docker?

Edit: Yes, it is.

Edit2: It is possible, but whether is it worth it or not is still a question. xhyve is a supervisor after all, you still need to boot a vm to use Docker. So if you like me, thought for a second that this can make containers in OSX a reality, don't get excited too early.

[+] piranha|10 years ago|reply
It explicitly says: xhyve may make a good solution for running Docker on your Mac, for instance.
[+] DoubleMalt|10 years ago|reply
Well it might be an alternative to virtualbox for boot2docker.
[+] STRML|10 years ago|reply
If you want a better solution on OSX than you already have, try https://github.com/codekitchen/dinghy - it does a really great job of wrapping Vagrant and taking care of setting up NFS instead of the incredibly slow default vboxfs.

Alternatively I've used Parallels + NFS with Vagrant for boot2docker but it's a real pain to get set up correctly. Dinghy just did it automatically, and also set up DNS and NTP for me. Can't recommend it enough.

[+] mendocino|10 years ago|reply
Not sure how useful OS X containers would be. Are you deploying on OS X?
[+] saidajigumi|10 years ago|reply
Definitely time to add Hypervisor.framework to the list of interesting things on OS X to check out. Related: I'd love to see a Vagrant provider for Xhyve, may have to hack on that a bit later.
[+] sudioStudio64|10 years ago|reply
OK. That's freaking awesome. I like seeing FreeBSD technology being brought into the mainstream in OS X. (I don't even use OS X, but this is cool.)
[+] ionforce|10 years ago|reply
I guess this is pronounced "X-hive" and "B-hive"?

Initially I thought it was "zive" and "bive", like "bive" was a foreign word from somewhere. Bhyve, the muse of unit tests!

[+] falcolas|10 years ago|reply
Fair warning, this may cause a Kernel panic. I've contributed to the bug with my trace, but it's definitely something to keep in mind when checking it out.

I really want this to work, though. It would be a great replacement for VirtualBox.

[+] techdragon|10 years ago|reply
I honestly wouldn't notice. 10.10 kernel panics on me about once a day. It's the WORST EVER release of OSX by an amazing margin.
[+] bstx|10 years ago|reply
Did you have a VirtualBox VM running before xhyve?
[+] philips|10 years ago|reply
I wrote a quick set of scripts to get CoreOS booting under xhyve as a container host. The defaults will expose SSH and a docker client port and drop you directly into a shell. Some quick getting started info here:

https://github.com/coreos/coreos-xhyve#coreos--xhyve

Lots of GitHub issues filed for next steps in exploring this technology. Really exciting to see a simple CLI driven virtualization option on OSX. Patches accepted. :)

[+] tw04|10 years ago|reply
This project is awesome. No more vmware fusion for me. Props to netapp for funding and driving the bhyve project. FreeBSD was desperately in need of native virtualization capabilities.
[+] 4ad|10 years ago|reply
Note that apart from bhyve (available today), FreeBSD 11 will also come with Xen Dom0 support.
[+] jkyle|10 years ago|reply
Ran the script. Hit Ctrl-D instead of sudo halt and it hung, had to kill the proc from another shell.

But, compiled clean, test vm started fast. Will look at again.

[+] mendocino|10 years ago|reply
Looks more like an issue with the VM rather than xhyve. Serial console does not seem to get respawned.
[+] mateuszf|10 years ago|reply
It would be great if Docker integrated / embedded that instead of forcing users to download / configure VirtualBox + boot2docker.
[+] jkyle|10 years ago|reply
I'm not sure docker would want to do this or if that's even an appropriate feature to integrate.

I'd rather see it supported by vagrant, which would seem an appropriate tool to manage them with.

[+] osxrand|10 years ago|reply
I'm curious why there is a restriction of 2010 or newer mac. Is it something in the CPU that's needed? I've 10.10.3 installed on a non supported mac and wanted to use this, but getting errors when I try the test Linux
[+] tw04|10 years ago|reply
You need a CPU that supports Intel's virtualization instruction set. Specifically VT-x. You can check if your CPU supports it with: sysctl machdep.cpu.features

You're looking for VMX. Here's an example from mine (highlighted the flag you're looking for):

machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL * VMX * SMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C

[+] stephenr|10 years ago|reply
I would imagine it needs Intel vt-x.
[+] 72deluxe|10 years ago|reply
That's really great! I had to rebuy VMware at work and Parallels at home when Yosemite came out because of the new hypervisor framework modifications that these two needed under Yosemite (I presume).

I don't really use the OSX integration of both systems, other than file mapping/sharing (I run Linux and Windows VMs).

Glad to see this, many thanks!

[+] acdha|10 years ago|reply
I don't know about Parallels but VMWare Fusion 6 runs just fine on Yosemite – there's almost no reason to upgrade unless you want new icons.

That said, I'm completely with you on the value of Hypervisor.framework for people who are e.g. running Linux test instances and not really seeing much benefit from the UI integration but who still want to avoid the performance / stability problems caused by using virtualbox.

[+] tachion|10 years ago|reply
The title is a bit misleading, it could say 'Xhyve – Lightweight Virtualization for OS X based on FreeBSD's Bhyve'
[+] pyvpx|10 years ago|reply
Bhyve is FreeBSDs...? I don't follow how it is misleading.