Monday, July 2, 2012

VirtualBox VM basic storage

At first, storage controllers must be setup on the VM:
  
$ VBoxManage storagectl vm1
  --name SATA
  --add sata
  --controller IntelAHCI
  
Then, virtual hard-disks are created and attached to a storage controller on the VM:
 
$ cd $HOME
 
$ VBoxManage createhd 
  --filename .VirtualBox/VM/vm1/hd1
  --size 20480 
 
$ VBoxManage storageattach vm1 
  --storagectl SATA
  --port 0 
  --device 0 
  --type hdd 
  --medium .VirtualBox/VM/vm1/hd1.vdi

$ VBoxManage showhdinfo .VirtualBox/VM/vm1/hd1.vdi