-
-
Save mappum/61e659269111c93fdb94 to your computer and use it in GitHub Desktop.
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="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