basically everything that you can do with the super conveniant virtualbox gui you can do from the commandline on a headless server.

# set default vm directory
# where all vms should reside in
# also if you clone a vm it will be copied in this folder
vboxmanage setproperty machinefolder /vms/

# register/add/import vm/make existing vm known to the system
VBoxManage registervm /path/to/vm.vbox

# unregister vm
VBoxManage unregistervm /path/to/vm.vbox

# list all registered vms
VBoxManage list vms
# show info about a particular vm
# you can also use the vmid
vboxmanage showvminfo vmname

# start vm
VBoxManage startvm vmName --type headless

# should trigger orderly shutdown, if OS is listening to this event
# like push of power button
VBoxManage controlvm vmName acpipowerbutton

# hard off
# like pulling power cord
VBoxManage controlvm vmName poweroff

 

admin