Skip to content

Instantly share code, notes, and snippets.

@woahdae
Forked from MartinNowak/FreeBSD-8.4-amd64.ova
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woahdae/3fa2c97eb2f9af23c190 to your computer and use it in GitHub Desktop.
Save woahdae/3fa2c97eb2f9af23c190 to your computer and use it in GitHub Desktop.

Preparing FreeBSD-8.4-i386.box

  • 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 setup.sh
    3. from the VirtualBox Menu Machine/ACPI shutdown
  • Package box
    • vagrant package --base FreeBSD-8.4-i386 --output FreeBSD-8.4-i386.box

Preparing FreeBSD-8.4-amd64.box

#!/bin/sh
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 https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub
chown vagrant:vagrant /usr/home/vagrant/.ssh/authorized_keys
# set network configuration
cat <<EOF > /etc/rc.conf
hostname=freebsd-8.4
ifconfig_vtnet0_name="em0"
ifconfig_vtnet1_name="em1"
ifconfig_em0="DHCP"
# virtualbox
vboxguest_enable="YES"
vboxservice_enable="YES"
# NFS
rpcbind_enable="YES"
nfs_client_enable="YES"
sshd_enable="YES"
EOF
# disable boot screen
echo 'beastie_disable="YES"' >> /boot/loader.conf
echo 'autoboot_delay="-1"' >> /boot/loader.conf
# Use the preferred way of configuring the pkg repo
mkdir -p /usr/local/etc/pkg/repos
echo "FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
mirror_type: "srv",
enabled: yes
}
" >> /usr/local/etc/pkg/repos/freebsd-official.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment