Last active
August 29, 2015 14:16
-
-
Save jbenet/76afa70955910a2ed097 to your computer and use it in GitHub Desktop.
boot-to-ipfs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)" |
Author
jbenet
commented
Mar 7, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment