export VM="vm-name"
VBoxManage createhd --filename $VM.vdi --size <size in KB>
VBoxManage list ostypes | grep -i "^ID:"
VBoxManage createvm --name $VM --ostype <os type> --register
VBoxManage storagectl $VM --name "SATA Controller" --add sata --controller IntelAHCI
VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium $VM.vdi
VBoxManage storagectl $VM --name "IDE Controller" --add ide
VBoxManage storageattach $VM --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium <isofile>
VBoxManage modifyvm $VM --memory 1024
VBoxManage modifyvm $VM --boot1 dvd --boot2 disk --boot3 none --boot4 none
VBoxManage modifyvm $VM --macaddress1 <mac>
VBoxManage modifyvm $VM --nic1 bridged --bridgeadapter1 em1
VBoxManage setproperty vrdeextpack "Oracle VM VirtualBox Extension Pack"
VBoxManage modifyvm $VM --vrde on
VBoxManage modifyvm $VM --vrdeport <port>
VBoxManage modifyvm $VM --vrdeauthtype external
VBoxManage setproperty vrdeauthlibrary "VBoxAuthSimple"
VBoxManage internalcommands passwordhash "<password>"
VBoxManage setextradata $VM "VBoxAuthSimple/users/<username>" "<hash>"
VBoxHeadless --startvm $VM &
VBoxManage controlvm $VM acpipowerbutton
VBoxManage snapshot $VM take "<name>"
VBoxManage snapshot $VM delete "<name>"
VBoxManage clonevm $VM --snapshot "<name>" --name "<new name>" --register
VBoxManage unregistervm $VM --delete
VBoxManage storageattach $VM --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium /usr/share/virtualbox/VBoxGuestAdditions.iso
(게스트에서)
apt-get install dkms build-essential linux-headers-$(uname -r)
mkdir /mnt/dvd
mount -t iso9660 -o ro /dev/cdrom /mnt/dvd
cd /mnt/dvd
./VBoxLinuxAdditions.run
VBoxManage sharedfolder add $VM --name <name> --hostpath <path> --automount
(게스트에서)
mount -t vboxsf <name> <path>