(OK)(OK) Creating VMs from an existing VDI file in CLI (VBoxManage) in Fedora 23

[root@localhost virtualbox-os]#
cp android-x86_64-6.0-rc1-0.vdi android-x86_64-6.0-rc1-1.vdi; cp android-x86_64-6.0-rc1-0.vdi android-x86_64-6.0-rc1-2.vdi; cp android-x86_64-6.0-rc1-0.vdi android-x86_64-6.0-rc1-3.vdi; cp android-x86_64-6.0-rc1-0.vdi android-x86_64-6.0-rc1-4.vdi; cp android-x86_64-6.0-rc1-0.vdi android-x86_64-6.0-rc1-5.vdi;

VBoxManage internalcommands dumphdinfo android-x86_64-6.0-rc1-1.vdi

VBoxManage internalcommands sethduuid android-x86_64-6.0-rc1-1.vdi
VBoxManage internalcommands sethduuid android-x86_64-6.0-rc1-2.vdi
VBoxManage internalcommands sethduuid android-x86_64-6.0-rc1-3.vdi
VBoxManage internalcommands sethduuid android-x86_64-6.0-rc1-4.vdi
VBoxManage internalcommands sethduuid android-x86_64-6.0-rc1-5.vdi

// VBoxManage modifyvm android-x86_64-6.0-rc1-1 --memory 1024 --vram 128 --usb off --audio pulse --audiocontroller sb16 --acpi on --rtcuseutc off --boot1 disk --boot2 dvd --nic1 bridged --bridgeadapter1 virbr0

for (int i=1; i<=5; i++) {

VBoxManage createvm --name android-x86_64-6.0-rc1-1 --ostype Linux_64 --register
VBoxManage modifyvm android-x86_64-6.0-rc1-1 --memory 1024 --vram 128 --usb off --audio pulse --audiocontroller sb16 --acpi on --rtcuseutc off --boot1 disk --boot2 dvd --nic1 hostonly --nictype1 Am79C973 --hostonlyadapter1 vboxnet0
VBoxManage storagectl android-x86_64-6.0-rc1-1 --name "IDE Controller" --add ide --controller PIIX4
VBoxManage storageattach android-x86_64-6.0-rc1-1 --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium android-x86_64-6.0-rc1-1.vdi

}

VBoxManage showvminfo android-x86_64-6.0-rc1-1

VBoxManage startvm android-x86_64-6.0-rc1-1

VBoxManage controlvm android-x86_64-6.0-rc1-1 poweroff
    //pause|resume|reset|poweroff|savestate|acpipowerbutton|acpisleepbutton|

for (int i=1; i<=5; i++) {

// delete VM
VBoxManage unregistervm android-x86_64-6.0-rc1-1
rm /root/VirtualBox\ VMs/android-x86_64-6.0-rc1-1 -rf

//VBoxManage unregistervm android-x86_64-6.0-rc1-1 [--delete]

}


posted @ 2016-06-27 21:59  张同光  阅读(127)  评论(0编辑  收藏  举报