Friday, November 1, 2013

How to - Create a Ubuntu VM in Virtualbox


I used VirtualBox a few times in the past & happen to use it again recently. I downloaded the VirtualBox 4.3.6 software from https://www.virtualbox.org/wiki/Downloads. And installation was easy & quick.

However, VM creation required some experimentation/tuning. Primarily because I started using them without really digging much initially. So, I will provide here the steps that eventually worked for me in creating a VM in VirtualBox & then effectively using it.


  • I opened VirtualBox and clicked on "New" on the top left hand side of the VM:

                        

  • Next, I provided the VM name in "Name" field and named my VM as "Ubuntu_Test_VM":

                          

      Then click "Continue".

  • Next, I configured the RAM size the VM can/should use. Please note that this RAM size configuration can be changed even after creating the VM. So, instead of planning the RAM size immediately, one can configure some minimal RAM size to get started. I configured 512MB RAM for my VM:
                       
      Then clicked "Continue".

    • Next comes the hard disk configuration:














              Here, I tried using "Use an existing virtual hard disk file". To use this option, I downloaded VDI images from http://virtualboxes.org/images/ to supply the input this option requires. I tried compiling linux kernel in the VM & eventually hit the "out of disk space" error. When I tried to understand whether I can increase disk size, I learnt that VDI images are created with fixed disk size and hence can't be resized or can't be resized easily. The VDI image I downloaded was configured with a 11GB hard disk & was insufficient to compile a new linux kernel within that size.

             So, I discarded that VM and then used "Create a virtual hard drive now" option which allowed me to customize the disk space for the VM:













          Then clicked "Create".

    • Next, I left the default value "VDI":













              Then clicked "Continue".

        • Next, I chose the option "Dynamically Allocated" as I wasn't sure how much disk space I needed to fit in a new custom linux kernel:













                  Then clicked "Continue".

              • Next, the configuration dialog expected me to provide a maximum limit on the disk size. Even though I selected "Dynamically allocated" in the previous screen, this maximum size is a protective measure that ensures that this VM doesn't usurp unreasonable disk space & making guest or other VMs run out of disk space:














                    Then clicked "Create".

              • Now, I saw my new VM in the list of VirtualBox VMs:













              • We created a VM. However, this VM is not yet in a bootable state. For instance, if I select my VM and click "Start" on the top menu of VrtualBox, it took me to a screen which expected me to provide the iso image required to boot the image:






                       
                     


                     


                     Here, I downloaded ubuntu 13.10 ISO from http://www.ubuntu.com/download/desktop & provided this as input in the above screen.

                      Then clicked "Start".

                • Next, the VM stated and took me to try/install screen:

                        









                         I chose "Install Ubuntu" option. Then followed through ubuntu installation dialog to get to Ubuntu desktop. I am not elaborating on Ubuntu installation dialog as this blog post is intended for VM creation only.

                    
                  Hope this helps.

                  No comments:

                  UA-48797665-1