As a developer, I’m always testing new apps, scripts and many other components, usually any of these things are pretty harmless but other could be quite destructive, in that case I cannot risk the stability of my main Windows machine (yeah, the word “stability” could also be a sarcasm) so… here is where a virtual machine can solve the problem.

In this example, I’m going to show you how to actually setup an Ubuntu Installation on VirtualBox, I will assume that you have Oracle VirtualBox installed (if not, you can grab it here and install it, easy as pie!!) and that you have an Ubuntu Desktop .iso file (you can grab it here).

 

1. Launch Oracle VirtualBox

The main screen is really simple in comparison to other virtualization tools like VMware Workstation.

Oracle VirtualBox Main Screen

 

2. Click on New and provide your virtual machine data

Once you click on New, the following questions will appear on screen (navigate all tabs):

You have to name your virtual machine and select the right OS and architecture, just like this image

Name your Virtual Machine

Select a good amount of ram for your virtual machine, I recommend 2 GB for an Ubuntu machine

Set the right amount of RAM on your VM

Choose create a new virtual disk now

Create a virtual disk now

Make it fixed, it will consume your real disk space immediately but the performance will be better. The dynamic option will make your disk to growth by itself based on the amount of data present in your virtual disk, for example, once you start running your VM and create/download file on it, the disk will increase its size automatically until it reaches it maximum size set, but it won’t decrease the size of the virtual disk if you start deleting file within the VM.

Select a Fixed Virtual Disk

Choose VDI, it does offer great interoperability between host operating systems. The other options can be used if you plan to use the same virtual disk with other virtualization products like VMware (vmdk) or Virtual PC (vhd).

Select a VDI filetype for better interoperability

Select a good amount of disk space for you VM, 8GB is recommended by default, but I will go for 20GB since I need this virtual machine for heavy work.

Select 80GB of disk space for your VM

Once you set the size, Oracle Virtual will start creating the disk, this will take some minutes…

Wait until the virtual disk is created

At this point your VM is ready, take a good time to browse all the information present on the main screen

Check all the information of your fresh virtual machine

Now click at the Settings button, go to Storage, click over the Disk (a CD-like figure) icon at the Storage Tree section, then look at the Attributes Section click over the Disk icon next to the CD/DVD drive dropdown box, select the option called: Choose a virtual CD/DVD Disk file… look for the Ubuntu .iso file and select it, then close the Settings window by clicking OK.

NOTE: You can navigate other options here, like increasing the amount of virtual processors, but it’s up to you.

Check all the information of your fresh virtual machine

 

3. Now that you have your VM ready, let’s install Ubuntu

Once you set the .iso in the right place, you can start your VM by clicking at the Start button at the main screen, then you will see the following action:

 

Once you hit start, another window will be opened, the oracle virtualbox start screen will be displayed.

VirtualBox Boot Screen

Now ubuntu install will start, you have to follow all instructions on screen in order to proceed, click on every image to set what do.

Click on Install UbuntuClick on continue, you can check the other options but it will increase the installation time Leave the first option selected, since this is a virtual machine for destructive operations, you don't really need top security or fancy customizationsChoose the location, it will affect regional settings and repositoriesChoose the keyboard layout that fits correctly with youNow, create your first user of your ubuntu installationOnce you set your first user Ubuntu will start deploying the OSAt this point, click at the restart button. Ubuntu is readyIf you see that strange message, just hit ENTER, Ubuntu will eject the .iso automatically (if not, you have to go the Settings again and remove it manually)At this point, after the restart, you can now login into your fresh machineUbuntu is ready for usage, but the screen resolution is so small...

You have notice that the screen resolution is small, that’s because Ubuntu requires some special packages to perform well in a virtualized environment. Here is what you have to do, look for terminal:

Click at the Ubuntu symbol at the top, type Terminal and click on it

Now run the following command on that terminal screen: sudo apt-get install build-essential virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms

Once you type the command on the terminal screen, you have to provide your user's password and hit 'Y' in order to install the packages

Once you see that all packages are installed, reboot Ubuntu.

Now Ubuntu will set the resolution automatically (depends to the actual the Oracle VirtualBox screen). If you resize your vm window, Ubuntu will adjust itself

Take a look, the resolution is far better now

 

Now you have a virtual machine with Ubuntu, you can now use as you please and perform other virtualization tasks like:

  1. Increase/Decrease the resources of the VM.
  2. Share the VM with your teammates.
  3. Take snapshots of your VM. A snapshot is like moment in time of your virtual machine, like a Windows Restoration Point (but functional), it does store the complete VM structure and setting in that period of time, if you make your vm, so unstable you can go back in time with this snapshot.
  4. Add more virtual machine and create your own network. (You may need a powerful host machine for this)

 

Follow me

Carlos Alberto Umanzor Arguedas

Web Developer at carlosumanzor.com
Web Developer, QA Engineer and Gamer Enthusiast, Developer of Linkcrawler and Father of a future computer ninja.
Follow me

 

Pin It on Pinterest

Shares
Share This
Optimization WordPress Plugins & Solutions by W3 EDGE