Skip to content

Instantly share code, notes, and snippets.

@mappum
Forked from jbenet/Makefile
Last active August 29, 2015 14:16
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 mappum/61e659269111c93fdb94 to your computer and use it in GitHub Desktop.
Save mappum/61e659269111c93fdb94 to your computer and use it in GitHub Desktop.
vmname="PXE Booter"
iso=/ipfs/QmdTmSQtCz9D6vt2AbvQkYo3edFcTYoU7FDmDD7bPWDccA/ipfs.iso
define notfound
$(iso) not found
make sure the daemon is running and mounted:
ipfs daemon &
ipfs mount
endef
export notfound
boot: vm
@stat $(iso) >/dev/null 2>/dev/null || (echo "$$notfound" && false)
VBoxManage startvm $(vmname)
vm:
@VBoxManage list vms | grep $(vmname) >/dev/null || make createvm
createvm:
# create the vm
VBoxManage createvm --name $(vmname) --register
VBoxManage modifyvm $(vmname) --memory 512 --acpi on --boot1 dvd
VBoxManage modifyvm $(vmname) --nic1 nat --nictype1 82540EM --cableconnected1 on
VBoxManage modifyvm $(vmname) --ostype Linux
# add a hdd
VBoxManage createhd --filename ./disk.vdi --size 10000
VBoxManage storagectl $(vmname) --name "IDE Controller" --add ide
VBoxManage storageattach $(vmname) --storagectl "IDE Controller" \
--port 0 --device 0 --type hdd --medium ./disk.vdi
# attach the iso
VBoxManage storageattach $(vmname) --storagectl "IDE Controller" \
--port 1 --device 0 --type dvddrive --medium "$(iso)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment