Articles‎ > ‎

VBoxManage Tool




Initialisation


Launch Windows Command 

In Windows, Execute cmd.exe

Type all command below in this window except "C:\Users\fabien>".

 

Init

C:\Users\fabien>

set PATH=%VBOX_INSTALL_PATH%;%PATH%
set vmname=oralin11


Machine State


Start VM

C:\Users\fabien>

VBoxManage startvm %vmname%

Shutdown VM

C:\Users\fabien>

VBoxManage controlvm %vmname% acpipowerbutton

Save Machine State

C:\Users\fabien>

VBoxManage controlvm %vmname% savestate

Other States are: pause, resume


VRDP


Install Extension Pack


VirtualBox 4.1 Oracle VM VirtualBox Extension Pack All platforms 
Support for USB 2.0 devices, VirtualBox RDP and PXE boot for Intel cards. See this chapter from the User Manual for an introduction to this Extension Pack. The Extension Pack binaries are released under the VirtualBox Personal Use and Evaluation License (PUEL).
Please install the extension pack with the same version as your installed version of VirtualBox!

Enable VRDE

C:\Users\fabien>
 
set vrdeport=4511
VBoxManage modifyvm %vmname% --vrde on --vrdeport %vrdeport%

Start VM

C:\Users\fabien>

VBoxManage startvm %vmname% --type headless
 
or

C:\Users\fabien>

VBoxHeadless --startvm %vmname%

and

C:\Users\fabien>

mstsc /v:127.0.0.1:%vrdeport%


Creation of VM oralin* with VBoxManage


Configuration for oralin11 (nat ip addr : 10.0.2.11) - used in Cluster tutorial

C:\Users\fabien>

set vmname=oralin11
set sshrule=ssh11,tcp,,5011,10.0.2.11,22 
set vrdeport=4511
set iso="N:\ISO\OracleLinux-R6-U0-Server-x86_64-dvd.iso" 
set rootvdi="C:\Users\fabien\VirtualBox VMs\%vmname%\root.vdi" 
set sybasebinvdi="C:\Users\fabien\VirtualBox VMs\%vmname%\sybase_bin.vdi" 
set sybasedatavdi="C:\Users\fabien\VirtualBox VMs\%vmname%\sybase_data.vdi" 
set vbshared="C:\Users\fabien\VirtualBox Shared"

Configuration for oralin21 (nat ip addr : 10.0.2.21) - can be used as Standalone Machine in other tutorial

C:\Users\fabien>

set vmname=oralin21
set sshrule=ssh21,tcp,,5021,10.0.2.21,22
set vrdeport=4521
set iso="N:\ISO\OracleLinux-R6-U0-Server-x86_64-dvd.iso"
set rootvdi="C:\Users\fabien\VirtualBox VMs\%vmname%\root.vdi"
set sybasebinvdi="C:\Users\fabien\VirtualBox VMs\%vmname%\sybase_bin.vdi"
set sybasedatavdi="C:\Users\fabien\VirtualBox VMs\%vmname%\sybase_data.vdi"
set vbshared="C:\Users\fabien\VirtualBox Shared"

Creation

C:\Users\fabien>

VBoxManage createvm --name %vmname% --ostype Oracle_64 --register

VBoxManage modifyvm %vmname% --cpus 1 --memory 1024 --rtcuseutc on
VBoxManage modifyvm %vmname% --boot1 dvd --boot2 disk --boot3 none --boot4 none
VBoxManage modifyvm %vmname% --bioslogofadein off --bioslogofadeout off

VBoxManage modifyvm %vmname% --nic1 nat --natdnsproxy1 on
VBoxManage modifyvm %vmname% --natpf1 %sshrule%
VBoxManage modifyvm %vmname% --nic2 intnet --intnet2 "intnet1"
VBoxManage modifyvm %vmname% --nic3 intnet --intnet3 "intnet2"
VBoxManage modifyvm %vmname% --vrde on --vrdeport %vrdeport%

VBoxManage modifyvm %vmname% --audio none --usb off

VBoxManage storagectl %vmname% --name "IDE Controller" --add ide --controller PIIX4

VBoxManage storageattach %vmname% --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium %iso%

VBoxManage storagectl %vmname% --name "SATA Controller" --add sata --controller IntelAHCI

VBoxManage createhd --filename %rootvdi% --size 8192
VBoxManage storageattach %vmname% --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium %rootvdi%

VBoxManage createhd --filename %sybasebinvdi% --size 4096
VBoxManage storageattach %vmname% --storagectl "SATA Controller" --port 1 --device 0 --type hdd --medium %sybasebinvdi%

VBoxManage createhd --filename %sybasedatavdi% --size 5120
VBoxManage storageattach %vmname% --storagectl "SATA Controller" --port 2 --device 0 --type hdd --medium %sybasedatavdi%

VBoxManage sharedfolder add %vmname% --name VirtualBox_Shared --hostpath %vbshared% --automount

Start VM

C:\Users\fabien>

VBoxManage startvm %vmname%

or

C:\Users\fabien>

VBoxManage startvm %vmname% --type headless

mstsc /v:127.0.0.1:%vrdeport% /w:800 /h:600