Skip to content
Vagrant plugin which enables bhyve as a backend(Developing)
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Vagrantfiles add template Vagrantfile Jul 27, 2016
example_box change the way we ask for sudo password Aug 16, 2016
lib Fix NFS issue Sep 7, 2016
locales
spec remove bin May 19, 2016
.gitignore add basic ssh support Jun 26, 2016
.rspec Initial commit May 19, 2016
.travis.yml Initial commit May 19, 2016
Gemfile
LICENSE.txt
README.md update README Sep 16, 2016
Rakefile
vagrant-bhyve.gemspec update README Sep 16, 2016

README.md

vagrant-bhyve

This is a Vagrant plugin which enable FreeBSD's hypervisor bhyve as its backend.

Status

Functions

Function Status
Box format Defined
Check bhyve support Working
Cloning Working(needs gcp package to copy image)
Booting(BIOS) Working
Network Working(needs pf and dnsmasq to provider NAT and DHCP)
SSH/SSH run Working(SSH run may needs bash)
Graceful shutdown Working
ACPI shutdown Working
Destroying Working
Provision Working
File sharing Working(NFS and vagrant-sshfs, maybe switch to VirtFS in the future)
Booting(UEFI) Not working
Port forwarding Not working
Suspend Not supported by bhyve yet
Resume Not supported by bhyve yet

Boxes

Collecting status of boxes from Atlas other than those provided by FreeBSD

Function Status
ubuntu/trusty64 Working
laravel/homestead Untested
hashicorp/precise64 Untested
hashicorp/precise32 Untested
centos/7 Working
puphpet/ubuntu1404-x64 Untested
ubuntu/trusty32 Untested
puphpet/debian75-x64 Untested
debian/jessie64 Working
scotch/box Untested
centos/6 Working

Test

Setup environment

$ git clone https://github.com/jesa7955/vagrant-bhyve.git
$ cd vagrant-bhyve
$ bundle install --path vendor/bundle --binstubs

Note we will need package coreutils and dnsmasq(and of course we will need grub-bhyve to boot Linux box), vagrant-bhyve will try to install them with pkg.

Create a box

Thanks to Steve Wills's work, now you can convert a VirtualBox box to a bhyve one with vagrant-mutate.

Run the box

After a box is created, you should create another Vagrantfile.

Vagrant.configure("2") do |config|
  config.vm.box = "boxname"
end

then execute this command to start the box with bhyve

$ /path/to/vagrant-bhyve/bin/vagrant up --provider=bhyve

SSH into the box

After the box is booted(uped), you can ssh into by executing this command. Note that you will have to use password to authorize for now.

$ /path/to/vagrant-bhyve/bin/vagrant ssh

Shutdown the box and cleanup

This command will shutdown the booted VM and clean up environment

$ /path/to/vagrant-bhyve/bin/vagrant halt

Destroy the box

$ /path/to/vagrant-bhyve/vagrant destroy

Known Issues

FreeBSD can't be shutdown gracefully

This issue seems like a bug of Vagrant core. It even appears when I test with virtualbox provider. The are two know solutions:

  • Add config.vm.guest = :freebsd to Vagrantfile
  • Add config.ssh.shell = "sh" to Vagrantfile

Synced folder is not working correctlly

I met this issue when I try to use vagrant-bhyve to boot centos/7 box. Vagrant uses NFS as default synced folder type. When it fails on your machine and box, you can:

  • Add config.vm.synced_folder ".", "/vagrant", type: "rsync" to your Vagrantfile to ensure that rsync type is used. Vagrant core will raise an error to inform you when there is not rsync find in PATH
  • Run vagrant plugin install vagrant-sshfs to enable vagrant-sshfs

Installation

Now this gem has been published on rubygems.org. You can install it through vagrant plugin install vagrant-bhyve to install it in a normal Vagrant environment

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jesa7955/vagrant-bhyve.

License

MIT

You can’t perform that action at this time.