Skip to content

Instantly share code, notes, and snippets.

@jbenet
Last active August 29, 2015 14:16
Show Gist options
  • Save jbenet/76afa70955910a2ed097 to your computer and use it in GitHub Desktop.
Save jbenet/76afa70955910a2ed097 to your computer and use it in GitHub Desktop.
boot-to-ipfs
vmname="IPFS"
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)"
@jbenet
Copy link
Author

jbenet commented Mar 7, 2015

ipfs daemon & ; sleep 10
ipfs mount
make

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