VirtualBox commands

VBoxManage

VBoxManage is the command-line interface to Oracle VM VirtualBox. With it, you can completely control Oracle VM VirtualBox from the command line of your host operating system. VBoxManage supports all the features that the graphical user interface gives you access to, but it supports a lot more than that. It exposes all the features of the virtualization engine, even those that cannot be accessed from the GUI.

You will need to use the command line if you want to do the following:

Use a different user interface than the main GUI such as the VBoxHeadless server. Control some of the more advanced and experimental configuration settings for a VM.

There are two main things to keep in mind when using VBoxManage. First, VBoxManage must always be used with a specific subcommand, such as list or createvm or startvm.

Créer une VM

root@goat01:/data# VBoxManage createvm --name De-ICE_S1.100.iso --register
    Virtual machine 'De-ICE_S1.100.iso' is created and registered.
    UUID: 963827db-6dd9-4222-8c26-846635055395
    Settings file: '/root/VirtualBox VMs/De-ICE_S1.100.iso/De-ICE_S1.100.iso.vbox'

Créer un disque dur

VBoxManage createhd --filename De-ICE_S1.100.iso --size 512

Changer le type OS

VBoxManage modifyvm De-ICE_S1.100.iso --ostype Linux

Spécifier la taille de la ménoire

VBoxManage modifyvm De-ICE_S1.100.iso --memory 256

Ajouter un controler de storage

VBoxManage storagectl De-ICE_S1.100.iso --name SATA --add sata --controller IntelAhci --bootable on

Ajouter un disque

VBoxManage storageattach De-ICE_S1.100.iso --storagectl SATA --port 0 --device 0 --type hdd --medium ""

Enlever un disque

VBoxManage storageattach De-ICE_S1.100.iso --storagectl SATA --port 0 --device 0 --type HDD --medium none

Ajouter un .iso

( [--medium none|emptydrive|additions|||host:|iscsi] )

VBoxManage storageattach De-ICE_S1.100.iso --storagectl SATA --port 0 --device 0 --type dvddrive --medium "/data/ISO/De-ICE_S1.100.iso"

Enlever un .iso

VBoxManage storageattach De-ICE_S1.100.iso --storagectl SATA --port 0 --device 0 --medium "none"

Ajouter une interface réseau

(none|null|nat|bridged|intnet|hostonly|generic|natnetwork])

VBoxManage modifyvm De-ICE_S1.100.iso --nic1 nat --nictype1 82540EM --cableconnected1 on

Démarrer une VM

VBoxManage startvm "De-ICE_S1.100.iso" --type headless

Arrêter une VM

VBoxManage controlvm De-ICE_S1.100.iso poweroff

Contrôler la VM

VBoxManage controlvm