Skip to content

Instantly share code, notes, and snippets.

@booyaa
Forked from segrax/CreateFreeBSDVm.sh
Last active August 29, 2015 14:27
Show Gist options
  • Save booyaa/d3f115b0fa8459b7db3b to your computer and use it in GitHub Desktop.
Save booyaa/d3f115b0fa8459b7db3b to your computer and use it in GitHub Desktop.
Create a FreeBSD 64bit VM with VirtualBox, on FreeBSD, Accepting VNC Connections
# Create a VM named 'MyBSDBox' (64 bit FreeBSD)
VBoxManage createvm --ostype FreeBSD_64 --register --basefolder /vms --name MyBSDBox
# 1gig of memory, 1 CPU.. and set the network to bridged via EM0, emulating the 82540EM chipset
VBoxManage modifyvm MyBSDBox --memory 1024 --ioapic on --cpus 1 --chipset ich9 --nic1 bridged --nictype1 82540EM --bridgeadapter1 em0
# 20 gig Dynamic HDD image, on sata controller
VBoxManage createhd --size 20000 --filename "/vms/MyBSDBox/MyBSDBox.vdi"
VBoxManage storagectl MyBSDBox --name "SATA Controller" --add sata --controller IntelAhci --portcount 4
VBoxManage storageattach MyBSDBox --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "/vms/MyBSDBox/MyBSDBox.vdi"
# Attach the FreeBSD Disk to the DVD Drive (/root/FreeBSD-10.0-RELEASE-amd64-disc1.iso)
VBoxManage storagectl MyBSDBox --name "IDE Controller" --add ide --controller PIIX4
VBoxManage storageattach MyBSDBox --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /root/FreeBSD-10.0-RELEASE-amd64-disc1.iso
# Set the VNC Password to 'password'
VBoxManage modifyvm MyBSDBox --vrdeproperty VNCPassword=password
# Start the machine, listening for VNC on port 5001
VBoxHeadless --startvm MyBSDBox --vrde on --vrdeproperty TCP/Ports=5001
# After installing OS, shutdown with Ctrl-C, remove the DVD
VBoxManage storageattach MyBSDBox --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium none
# and start it up again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment