http://bald.cat

virtual machines with VBoxManage

VBoxManage is the command line interface to VirtualBox.

VBoxManage list vms
VBoxManage list runningvms

VBoxManage startvm [name] --type headless
VBoxManage controlvm [name] poweroff
VBoxManage showvminfo [name]

VBoxManage unregistervm [name] --delete

create new machine, configure

VBoxManage createvm --name $VM \
	   --ostype Linux_64 \
	   --basefolder ~/workbook/share/virtual-machines

VBoxManage registervm ~/workbook/share/virtual-machines/$VM/$VM.vbox

VBoxManage modifyvm $VM \
	   --memory 1024 \
	   --defaultfrontend headless \
	   --nic1 bridged \
	   --bridgeadapter1 en0 \
	   --keyboard ps2 \
	   --audio none \
	   --usb off

add hard disk

VBoxManage createmedium disk \
	   --filename ~/workbook/share/virtual-machines/$VM/$VM.vdi \
	   --size 3700

VBoxManage storagectl $VM \
	   --name "SATA Controller" \
	   --add sata

VBoxManage storageattach $VM \
	   --storagectl "SATA Controller" \
	   --port 0 \
	   --device 0 \
	   --type hdd \
	   --medium ~/workbook/share/virtual-machines/$VM/$VM.vdi

attach dvd drive

VBoxManage storagectl $VM \
	   --name "IDE Controller" \
	   --add ide
VBoxManage storageattach $VM \
	   --storagectl "IDE Controller" \
	   --port 0 \
	   --device 0 \
	   --type dvddrive \
	   --medium ~/Desktop/crux-3.4.iso

VBoxManage modifyvm $VM \
	   --boot1 dvd \
	   --boot2 disk \
	   --boot3 none \
	   --boot4 none

snapshots

VBoxManage snapshot $VM take "initial setup"

2018 - Élő László hello at bald dot cat