FreeBSD on Vagrant
Table of Contents
- FreeBSD on Vagrant
Simply copy the Vagrantfile from this repository to the project you want to run the VM from and you are done. The box will be downloaded for you. The root password is vagrant.
Create your own FreeBSD Box
This is for people who want to have their own customized box, instead of the box I made for you with the scripts in this repository.
VirtualBox works best with the following settings:
- System -> Motherboard -> Hardware clock in UTC time
- System -> Acceleration -> VT/x/AMD-V
- System -> Acceleration -> Enable Nested Paging
- Storage -> Attach a .vdi disk (this one we can minimize later)
- Network -> Adapter 1 -> Advanced -> Adapter Type -> Paravirtualized Network (virtio-net)
- Network -> Adapter 2 -> Advanced -> Attached to -> Host-Only Adapter
- Network -> Adapter 2 -> Advanced -> Adapter Type -> Paravirtualized Network (virtio-net)
I would also recommend to disable all the things you are not using, such as audio and usb.
Installation from FreeBSD ISO
Attach the ISO as a CD and boot it. Default installation should work. Deselect games and ports system components. Select UTC when asked for timezone and machine hardware clock. In network configuration step select vtnet0 and configure it with IPv4 DHCP.
Boot into your clean FreeBSD installation. You can now run the
vagrant-setup.sh script from this repository. This will install and
setup everything which is needed for Vagrant to run. First, in your FreeBSD
box, login as root and fetch the installation script:
fetch --no-verify-peer -o /tmp/vagrant-setup.sh \ https://raw.github.com/arkadijs/vagrant-freebsd/master/bin/vagrant-setup.sh
Package for Vagrant
Before packaging, I would recommend trying to reduce the size of the disk a bit more. In Linux you can do:
VBoxManage modifyvdi <freebsd-virtual-machine>.vdi compact
You can now package the box by running the following on your local machine:
vagrant package --base <name-of-your-virtual-machine> --output <name-of-your-box>
./package.sh script in the repo to do the packaging.
I forked this repository from wunki freebsd.
The above is released under the BSD license -- who would have thought! Meaning, do whatever you want, but I would sure appreciate if you contribute any improvements back to this repository.