| VirtualBox CLI |
|
|
|
| How To - VirtualBox |
| Written by Christian Foronda |
| Tuesday, 19 January 2010 17:06 |
|
VM Creation and Configuration This will create the new VM named, VMName and registers it with VirtualBox. The VM created is an XML file located in your home directory: ~/.VirtualBox/Machines/VMName/VMName.xml.
$ VBoxManage createvm --name VMName -register
Create a virtual disk for your VM: Creat a virtual disk named VMName.vdi, 4GB (4,000MB) in size and with fixed size (non-expanding).
$ VBoxManage createhd --filename VMName.vdi --size 4000 --variant Fixed
Create a Storage Controller to which you'll attach the virtual disk and a virtual CD/DVD drive: This command will create an IDE controller named "IDE Controller" and controller type PIIX4.
$ VBoxManage storagectl VMName --name "IDE Controller" --add ide --controller PIIX4
Attach your virtual disk to your VM:
$ VBoxManage storageattach VMName --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium VMName.vdi
Attach an ISO image for the operating system you want to install:
$ VBoxManage storageattach VMName --storagectl "IDE Controller" --port 0 --device 1 --type dvddrive --medium /path/to/file.iso
Setup Networking: This creates a bridged NIC with cable connected on startup and the Linux system sees the adapter as eth0.
$ VBoxManage modifyvm VMName --nic1 bridged --cableconnected1 on --bridgeadapter1 eth0
Start the VM:
$ VBoxManage startvm VMName Reference: Similar articles |
| Last Updated on Tuesday, 19 January 2010 18:24 |


