Home   >>   Virtual Box   >>   VirtualBox CLI
VirtualBox CLI PDF Print E-mail
( 0 Votes )
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
VirtualBox Command Line Management Interface Version 3.0.8_OSE
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Virtual machine 'VMName' is created and registered.
UUID: eb399696-8d46-4842-9ef4-56c15aeb70c3
Settings file: '/home/cf/.VirtualBox/Machines/VMName/VMName.xml'

 

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).
The virtual disk is created under ~/.VirtualBox/HardDisks/VMName.vdi

    $ 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
Waiting for the remote session to open...

Remote session has been successfully opened.


Reference:
http://www.linux-mag.com





blog comments powered by Disqus
Last Updated on Tuesday, 19 January 2010 18:24