8 ms·
Xhyve – Lightweight Virtualization on OS X Based on Bhyve
- tachion 11y agoThe title is a bit misleading, it could say 'Xhyve – Lightweight Virtualization for OS X based on FreeBSD's Bhyve'
- pyvpx 11y agoBhyve is FreeBSDs...? I don't follow how it is misleading.
- tachion 11y agoIt is in fact - it is called The BSD Hypervisor [1] and so far it exists only on FreeBSD, and this is where it was born. There are some forks to port it to other platforms (like Joyent's SmartOS) but they're closed and not out yet. I consider technology awareness, competition and diversity a very good thing, therefore I think its important to mention FreeBSD in this case (and other BSD's too in other cases). By the way, have you donated to FreeBSD [2] and OpenSSH [3] yet? ;) [1] http://bhyve.org/ http://bhyve.org/ [2] https://www.freebsdfoundation.org/donate/ https://www.freebsdfoundation.org/donate/ [3] http://www.openbsd.org/donations.html http://www.openbsd.org/donations.html
- pyvpx 11y agoI've been buying OpenBSD CD's since 3.4 and a long time friend has commit bits with the FreeBSD project. I am a big BSD supporter :)
- alisnic 11y agoThis 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 11y agoIt explicitly says: xhyve may make a good solution for running Docker on your Mac, for instance.
- DoubleMalt 11y agoWell it might be an alternative to virtualbox for boot2docker.
- mendocino 11y agoNot sure how useful OS X containers would be. Are you deploying on OS X?
- alisnic 11y agoThe benefit for me would be quick, isolated development environments. I want to boot a contained swarm of services connected to each other in a single command, and shut them down in a single command as well
- mateuszf 11y agoAnd installing docker / docker-compose / machine, etc. using one brew command would be a great addition in order to ease introduction of the tool to the whole team.
- mikewhy 11y agobrew install docker docker-compose docker-machine open https://kitematic.com/download/ Kitematic might even come with docker, docker-machine. It will then set up a docker machine for you and you're ready to go.
- deleted 11y ago[deleted]
- mchiang 11y agoYes, Kitematic does install docker-machine automatically which also sets up docker. For CLI, in Kitematic menu there is a button where you can install the binaries.
- Osmium 11y agoReally 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 11y agoNot 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.
- delinka 11y agoI'm thinking you mean "tight UI integration."
- lvillani 11y agoVMWare Fusion is, in my experience, everything but horrible for battery life. I frequently spin up VMs with Vagrant, do something with them and then switch to other tasks. More often than not, I forget to shut them off, mostly because their impact on the battery life is so minimal that I don't notice them until I run `vagrant global-status`.
- devonkim 11y agoThis probably depends greatly upon whether your machine has discrete graphics or not. On Macbook Pros with nVidia graphics like my 2014 higher-tier Macbook Pro, there is a dramatic loss in battery when the discrete graphics kicks in. However, most Macs sold now don't have discrete graphics because the Intel integrated graphics is honestly pretty decent nowadays for most tasks. The difference is 3 hours of battery and 8+ for me. Google Chrome, similarly, tends to drain my battery a lot, and that alone has encouraged me to go to Safari on Macs.
- merb 11y agoEhm when we talk about Vmware Fusion and discrete Graphics you are obviously wrong. You could change the graphic mode in Vmware Fusion, so that you save lots of power..
- sudioStudio64 11y agoOK. 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.)
- walterbell 11y agoHopefully Apple will add Hypervisor.framework support for Intel's hardware-virtualized graphics, https://01.org/zh/blogs/skjain/2014/intel®-graphics-virtualization-update?langredirect=1 https://01.org/zh/blogs/skjain/2014/intel®-graphics-virtuali...?
- mateuszf 11y agoIt would be great if Docker integrated / embedded that instead of forcing users to download / configure VirtualBox + boot2docker.
- jkyle 11y agoI'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.
- acdha 11y agoDocker has a huge interest in making it easy for the legions of Mac-toting developers to use it easily without first telling you to get complex, fragile external tooling like vagrant or virtualbox working. I doubt it'd go in the mainline product but I'd be shocked if in a year or two there isn't a Docker.app one-stop option which makes it trivial to run popular Linux apps.
- nickstinemates 11y ago> I'd be shocked if in a year or two there isn't a Docker.app one-stop option which makes it trivial to run popular Linux apps. That sounds really compelling, and something along the lines of what Kitematic is doing, but even simpler.
- acdha 11y agoThanks for mentioning Kitematic – I'd forgotten the name but this was my first reaction when I saw their product announcement. It's a nice way to make their product even smoother.
- jkyle 11y ago> use it easily without first telling you to get complex, fragile external tooling like vagrant or virtualbox working. I won't get into virtualbox. But I haven't found vagrant very fragile at all since Mitchell moved to omnibus (quite a while back). Most of the issues I had with vagrant were directly related to virtualbox, not vagrant itself. > Docker has a huge interest in making it easy for the legions of Mac-toting developers Well, sort of. They have a product that is inherently linux based. Getting a nice setup working on OS X is pretty trivial, takes a developer maybe a couple of hours one time to have something working.If they use someone else's solution, it takes minutes. Here's an ansible task I use to configure an ubuntu machine[1]. It's all of 24 lines. If you're running it against a VM, you just forward the 2375 port to your host. Then the workflow looks like: vagrant up docker build -t jkyle/awesomeness . Course you can get fancier. Ansible can pull down docker projects using git, build, and run them for you as well. [1] https://gist.github.com/jameskyle/b8e573d63da4dbaaf31a https://gist.github.com/jameskyle/b8e573d63da4dbaaf31a
- ionforce 11y agoI 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!
- 72deluxe 11y agoThat'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 11y agoI 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.
- 72deluxe 11y agoI had been making do with VMWare Fusion 5, so it truly refused to work on Yosemite. (I also had Parallels 8 at home, which refused to work). Hopefully the upgrades will be only necessary every two years. Stability problems with VirtualBox are very real. I haven't touched that for years.
- driverdan 11y ago> Stability problems with VirtualBox are very real. I haven't touched that for years. What issues do you have? I've been running VirtualBox on OS X for 6+ years and have never had stability issues. I usually have a few VMs running at a time via vagrant.
- acdha 11y agoUntil at least a couple of years ago, it was common for it to cause kernel panics if running during a sleep/wake cycle or when exercising the GPU. I used to work with a couple of people who used it and they'd have an unplanned coffee break at least once a week.
- osxrand 11y agoI'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 11y agoYou 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
- mrsteveman1 11y agoMost Macs have had VT-x enabled since.... 2007? The critical hardware feature they didn't all have is EPT[1], which may be required here in addition to VT-x. [1] https://en.wikipedia.org/wiki/Second_Level_Address_Translation#EPT https://en.wikipedia.org/wiki/Second_Level_Address_Translati...
- ruda 11y agoThis (missing) EPT must be the reason my MacBook Pro from 2009 is crashing when running it. Thanks for pointing that
- osxrand 11y agoThanks, was running to a client and didn't have time to check it out right away. Hmm, turns out my Mac Pro does have VMX : 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 DTES64 MON DSCPL VMX EST TM2 SSSE3 CX16 TPR PDCM Maybe it's the EPT mentioned by @mrsteveman1
- 11y ago
- jkyle 11y agoRan 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 11y agoLooks more like an issue with the VM rather than xhyve. Serial console does not seem to get respawned.
- tw04 11y agoThis 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 11y agoNote that apart from bhyve (available today), FreeBSD 11 will also come with Xen Dom0 support.
- itgoon 11y agoI hadn't heard about that - that's great news! I may finally be able to start stealthing it into test environments.
- walterbell 11y agoGreat news. That will allow ZFS in a FreeBSD driver VM, providing storage for other guests, even with a Linux dom0. Is FreeBSD 11 expected this year?
- stock_toaster 11y agoNext year in july: https://www.freebsd.org/releases/11.0R/schedule.html https://www.freebsd.org/releases/11.0R/schedule.html
- saidajigumi 11y agoDefinitely 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.
- falcolas 11y agoFair 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.
- bstx 11y agoDid you have a VirtualBox VM running before xhyve?
- techdragon 11y agoI 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.
- bruienne 11y agoThis 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 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.
- bruienne 11y agoBlegh, https://gist.github.com/bruienne/d1053df883b47822c6e0 https://gist.github.com/bruienne/d1053df883b47822c6e0
- alfonsodev 11y agothanks! what about volume mounting and port forwarding, are supported already?
- simonvdv 11y agoYour 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/ 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.
- philips 11y agoI 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 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. :)