Madhav Kobal's Blog

This blog will be dedicated to Linux, Open Source and Technology news, affairs, how-tos and virtually EVERYTHING in these domains.

How to create VirtualBox virtual machines from Command line

Posted by madhavkobal on 20/08/2009

You can create VirtualBox virtual machines from command line in 3 easy steps. We will assume Ubuntu 9.10 in the following example.

  1. Create new virtual machine:$ VBoxManage createvm --name "Ubuntu 9.10" --register
  2. Create virtual hard disk (5 GB):$ VBoxManage createhd --filename "Ubuntu.vdi" --size 5000 --remember
  3. Modify virtual machine:$ VBoxManage modifyvm "Ubuntu 9.10" --memory "512MB" --hda "Ubuntu.vdi" --dvd /home/toor/karmic-desktop-i386.iso --acpi on --boot1 dvd --nic1 nat
    • –memory – memory size
    • –hda – specify virtual hard disk
    • –dvd – specify ISO image file
    • –acpi on – enable ACPI support
    • –boot1 – specify boot order
    • –nic1 – network setting

Now you can start virtual machine by typing this command:

$ VBoxManage startvm "Ubuntu 9.10"

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: