Skip to content

Instantly share code, notes, and snippets.

Last active January 14, 2018 19:20
Show Gist options
  • Save MartinNowak/8077129 to your computer and use it in GitHub Desktop.
Save MartinNowak/8077129 to your computer and use it in GitHub Desktop.
Checklist for preparing FreeBSD-8.4 vagrant boxes.


  • Download FreeBSD-8.4-RELEASE-i386-disc1.iso
  • Open FreeBSD-8.4-i386.ova in VirtualBox
    1. Select File/Import Appliance
  • Boot into sysinstall using FreeBSD-8.4-RELEASE-i386-disc1.iso
    1. Country selection
      • [235] United States
    2. Express install
    3. FDISK Partition Editor
      • [A] = Use Entire Disk
      • [Q] = Finish
    4. Install boot manager
      • [S] Standard
    5. FreeBSD Disklabel Editor
      • [A] = Auto Defaults
      • [Q] = Finish
    6. Choose Distribution
      • [7] Minimal
    7. Choose Installation Media
      • [1] CD/DVD Install from a FreeBSD CD/DVD
    8. User confirmation
      • [yes]
    9. Wait for install to complete
    10. Visit general configuration menu
      • [no]
    11. Exit install & reboot
      • removing CD is done automatically
  • Login as root (no password)
    1. get an IP addr
      • dhclient em0
    2. run
    3. from the VirtualBox Menu Machine/ACPI shutdown
  • Package box
    • vagrant package --base FreeBSD-8.4-i386 --output


set -e -v
# set root password to vagrant
echo vagrant | pw mod user root -h 0
# create vagrant user (password vagrant)
echo vagrant | pw useradd -n vagrant -s /bin/csh -m -h 0
# Install sudo and bash
pkg_add -r sudo bash
# enable passwordless sudo for vagrant
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /usr/local/etc/sudoers
# install authorized ssh keys
mkdir /usr/home/vagrant/.ssh
fetch -o /usr/home/vagrant/.ssh/authorized_keys
chown vagrant:vagrant /usr/home/vagrant/.ssh/authorized_keys
# set network configuration
echo hostname='"'`uname -s`-`uname -r`-`uname -m`'"' >> /etc/rc.conf
echo 'ifconfig_em0="DHCP"' >> /etc/rc.conf
# enable sshd
echo 'sshd_enable="YES"' >> /etc/rc.conf
# disable boot screen
echo 'beastie_disable="YES"' >> /boot/loader.conf
echo 'autoboot_delay="-1"' >> /boot/loader.conf
# Change PACKAGEROOT (ftp doesn't work with default vagrant NAT rules)
echo 'setenv PACKAGEROOT' >> .cshrc
echo 'setenv PACKAGEROOT' >> /usr/home/vagrant/.cshrc
echo 'export PACKAGEROOT=;' >> .bashrc
echo 'export PACKAGEROOT=;' >> /usr/home/vagrant/.bashrc
echo 'Defaults env_keep += "PACKAGEROOT"' >> /usr/local/etc/sudoers
Copy link

All uses of in and on L19 of should be changed to and respectively. These urls are redirected to the correct location when used in a browser but are not redirected when used in a script or from the shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment