This is part of "[[AntranigVartanian/HowToContributeSetup|a setup to contribute to FreeBSD]]"
For this example we'll be using [[/VirtualBox|VirtualBox]].
===== Things you need =====
* [[/VirtualBox|VirtualBox]]
* [[http://ftp.freebsd.org/pub/FreeBSD/doc/handbook/book.pdf|PDF]] copy of the [[https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/|Handbook]]
* ISO of the latest -CURRENT snapshot | you can download them from [[https://download.freebsd.org/ftp/snapshots/|here]]
===== Setup VirtualBox =====
First, setup a [[https://www.virtualbox.org/manual/ch06.html#network_hostonly|Host-Only Networking Adapter]], make sure to disable the DHCP Server.
Assuming the Host-Only Network now is ''%%vboxnet0%%'' with the IP address ''%%192.168.56.1/24%%'', you will see ''%%vboxnet0%%'' interface on your host.
Create a new virtual machine, in the network section, enable ''%%Adapter 2%%'' and attach it to the ''%%Host-Only Adapter%%'' and set the name to ''%%vboxnet0%%''. If you plan to do network programming, you might as well set ''%%Promiscuous Mode%%'' to ''%%Allow All%%''.
===== Installing FreeBSD =====
Now you will need to install %%FreeBSD%%. [[https://www.freebsd.org/doc/handbook/bsdinstall.html|Chapter 2. Installing FreeBSD]] section of the handbook has this covered. Make sure that you use ZFS, this will be handy later.
For the network setup, use ''%%em0%%'' and set it to use DHCP.
After the installation is complete, you will need to configure ''%%em1%%'' as well. Here are the commands to do so.
sysrc ifconfig_em1="inet 192.168.56.13 netmask 255.255.255.0
Shut down the machine by running ''%%shutdown -p now%%'' and remove the Disc from the VM.
===== Logging from the Host =====
If everything was done properly, now you can SSH from the Host. Since [[/VirtualBox|VirtualBox]]'s VGA is not very easy to use, an SSH connection will allow you to copy and paste content from your terminal.
ssh -l myuser 192.168.56.13
Alternatively, if you want to log-in as root, edit the ''%%/etc/ssh/sshd_config%%'' file and change ''%%PermitRootLogin%%'' to ''%%yes%%'', don't forget to uncomment and restart the daemon! :)
===== What now? =====
Now go back to the [[AntranigVartanian/HowToContributeSetup|Setup]] and let's configure what's needed for Src and Ports!
==== TODO ====
* Maybe setup instructions using Vagrant?
* Setup instructions with bhyve.
* Setup instructions using the official VM images from RE.