Skip to content

Instantly share code, notes, and snippets.

@vans163
Last active November 6, 2021 22:15
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vans163/72376a8d92819556aa682fee9d5e02f0 to your computer and use it in GitHub Desktop.
Save vans163/72376a8d92819556aa682fee9d5e02f0 to your computer and use it in GitHub Desktop.
Virtualbox Commandline stuff
#Create storage
VBoxManage createhd --filename VMName.vdi --size 40000 --format VDI
VBoxManage modifyhd GoDial.vdi --resize 30500
VBoxManage list hdds
VBoxManage closemedium disk $(UUID) --delete
#Create VM
VBoxManage createvm --name "VMName" --ostype Windows7_64 --register
VBoxManage modifyvm "VMName" --memory 2048 --vram 128 --acpi on --ioapic on
VBoxManage storagectl "VMName" --name "IDE Controller" --add ide --controller PIIX4
VBoxManage storagectl "VMName" --name "SATA Controller" --add sata --controller IntelAHCI
VBoxManage modifyvm "VMName" --nic1 bridged --bridgeadapter1 enp2s0 --nictype1 82540EM
VBoxManage storageattach "VMName" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium VMName.vdi
VBoxManage storageattach "VMName" --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium /Download/test.iso
VBoxManage storageattach "VMName" --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium none
VBoxManage modifyvm "VMName" --boot1 dvd
VBoxManage modifyvm "VMName" --vrde on
VBoxManage modifyvm "VMName" --vrdeport 9999
VBoxHeadless --startvm "VMName" --vrde on
#USB Stuff
VBoxManage storageattach ctest \
--storagectl "SATA Controller" \
--device 0 \
--port 0 \
--type hdd \
--medium Default.vdi
VBoxManage list usbhost
VBoxManage list usbfilters
VBoxManage controlvm "VMName" usbattach 1123ecf-a536-4cee-7536-eb64b92036ac
VBoxManage usbfilter add 0 --target "VMName" --name EXTDISK --vendorid 0x5788 --productid 0x52a
VBoxManage usbfilter remove 0 --target "VMName"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment