http://twolines.net/wp-content/themes/averin/images/top-banner.pnghttp://twolines.net/wp-content/themes/averin/images/ads72890.jpghttp://twolines.net/wp-content/themes/averin/images/top-banner.pnghttp://twolines.net/wp-content/themes/averin/images/ads72890.jpghttp://twolines.net/wp-content/themes/averin/images/top-banner.png

How to setup virtual Linux environment sandbox from within Windows OS

The Linux OS has many advantages over Windows, but at the same time it also has many disadvantages. Combining both worlds however, will provide you with a solid ground to perform any task you might need. This can be achieved (and very easily at that) by having one of the OS’s virtualized. Today’s computers are quite powerful and have enormous amounts of resources, which we aren’t using at 100%, which is the reason why virtualization developed quite a lot. Installing Linux on top of Windows is now very easy and this article will show you how to do it.

 

Summary

  1. About virtualization
  2. Downloading and Installing VirtualBox
  3. Downloading Linux (Ubuntu in our case)
  4. Creating a Virtual Machine
  5. Installing Ubuntu on the VM
  6. Final words

About Virtualization

Quoted from WikiPedia, “Virtualization, in computing, is the creation of a virtual (rather than actual) version of something, such as a hardware platform, operating system, a storage device or network resources.” or in other words, virtualization allows you, in this case, to run a second computer within your own computer. This comes at a cost however. The virtualized machine runs considerably slower than it would run if it was using the machine normally. This is why I have selected to run Windows as a host and Linux as guest OS (that is: Linux on top of Windows). The Windows OS is heavily utilizing GUI for all its tasks and as such tends to run much slower when it is ran as guest OS. Linux and all Unix systems are not dependent on their GUI and thus are usually performing better when virtualized.

In order to start with the virtualization, we will need to first download a special software which will do most of the work for us.

 

Downloading and Installing VirtualBox

VirtualBox, as the name suggests, is the software we will use to create the virtual machine. There are many other virtualization methods and softwares (such as VMWare for example), but VirtualBox seems to be the most user-friendly one and is my favorite.

To download Virtual Box, please open the following URL in your browser:

https://www.virtualbox.org/wiki/Downloads

and click on the link corresponding to your current OS (assuming Windows). The package is about 87MB big and should download fairly fast. Once downloaded, run the installer and click ‘Next -> Next -> Next ..’ until it has been installed. There aren’t really much configurable options and it should work right out of the box.

Upon successful installation, run the program and you should be greeted with a screen similar to the one below:

Startup screen of the virtual box software

Startup screen of the virtual box software

 

Downloading Linux Installation Disc

We will be installing Ubuntu in this article, since it is the easiest and most user-friendly Linux distribution. You might opt for a different one (Fedora/CentOS/etc.) if you would like to. The general installation routine should differ very little.

To download Ubuntu, go to the following page:

http://www.ubuntu.com/download/ubuntu/download

Click on the big orange button to start the file download and wait for it to complete. The size of the file should be about ~700MB thus it might take a little bit to complete.

Once downloaded, remember where you have saved it and proceed with creating the virtual machine inside VirtualBox.

 

Creating a Virtual Machine

Open VirtualBox window and click on the only active button on the screen – the “New” button. Upon clicking it, a popup window will show and greet you. Click next and the second window will show. It is here where you will define how this virtual machine will be called and what kind of OS will be installed on it. It is important (although not mandatory) for the software to know what kind of OS is to be virtualized as there are a few tricks and features which are enabled for certain OSs. I’ve used Sandbox as name and selected Linux -> Ubuntu as OS. The screenshot below shows the configuration:

VirtualBox machine OS Type selection

VirtualBox machine OS Type selection

The next several screens will ask you how big the hard drive for the machine would be and how much RAM should you spare for it. The default configurations are just fine, but since I do have some more RAM available on my Desktop machine, I’ve selected 1024MB for it. The drive is set to 8.6GB. Once ready, create the virtual machine. It will have an empty disc and standard configuration and you should be back at the welcome screen of VirtualBox.

The next step is perhaps the most “difficult” one in the whole process: selecting the downloaded CD to be loaded in the Virtual Machine. To do so, simply follow the steps below:

  1. Click on ‘Settings’ button.
  2. Select ‘Storage’ from the list on the left.
  3. Click on the CD icon (with a plus sign) next to the “IDE Controller”
  4. Click on ‘Choose Disk” and locate the Ubuntu file you have downloaded on your computer.

The screenshot might help you as well:

Disk Selection Settings

Disk Selection Settings

We are now ready to startup the virtual machine and install Ubuntu.

Installing Ubuntu on the VM

Once you have loaded the installation CD, go back to the main window of VirtualBox and click on the big green arrow button labeled ‘Start’. A new black window should appear somewhere on your monitor and will start loading the OS. You might (and probably will) be prompted with several sub-popup messages informing you that the guest OS color is lower than your current one and that the guest OS supports the mouse over and out functionality. Just agree with the messages and close them. It would take about half a minute for the first screen to show and when it does, it should look like this (ignoring the loading text messages of course):

Ubuntu welcome screen

Ubuntu welcome screen

There are two options available: “Try Ubuntu” and “Install Ubuntu”. The first one allows you to run Ubuntu from within the CD itself and the second one will install it on the HDD we have prepared. Since we would be installing more software and would like to actually be able to use it after we reboot/stop the computer, we will ‘Install Ubuntu’. Click on that button to continue.

Next, you will be asked which HDD to use, but we do have just a single one and click on ‘Next’ should be sufficient. The installer will create its partitions and will start copying the files. Meanwhile, you will be asked several more questions. The first one is to select your current location and the language. The second screen will ask you to create your user account on the system. You can use whatever you wish for values, except for the username itself (you should avoid system users and if you have selected one, the installer will complain and will ask you to choose a different username).

Ubuntu user creation screen

Ubuntu user creation screen

You might notice that the interface is a bit laggish. This is because while you are configuring the timezone/language/username and so on, the installer is copying the files from the CD to the HDD. The progress bar can be seen at the bottom of the window.

Finally, it will take a bit more time for the files to be copied. Once this is completed, the system installation will begin. No actions are required on your end and it should finish in a few minutes. The last tricky part is when it asks you to reboot the computer. Now, instead of rebooting your computer, you should reboot the virtual machine by clicking on the ‘Reboot’ button. You will eventually see a message to remove the CD from the computer and click ‘Enter’ to finilize the installation. To remove the CD, click on ‘Devices’ menu (at the very-very top of the window) -> CD/DVD Devices -> IDE Primary Master device -> and select ‘Host X:/’ where x is your actual letter for your CD. If you have no CDRom on your computer, select any other option to unmount the Ubuntu CD from the VirtualBox.

Remove installation Disk Screen

Remove installation Disk Screen

Hit Enter and the system will reboot and then load the installed OS. Congratulations! You now have an Ubuntu running from within your Windows OS!

 

Final words

You might be wondering, now that you have the system installed, what are you going to do with it? It has numerous usages. From a stable development environment, through a virtual playground (with no risk of breaking anything) and even to a secure location to stash your private data. After all, the virtual HDD is a single file and you have an option to encrypt it, thus making it much harder for someone to actually discover this data, let alone access and read it.

In the next few installments of the virtualization articles series, we will be installing a lot of software on the system we’ve just got installed, so stay tuned! :)

39 days ago by in Linux / Unix , Windows | You can follow any responses to this entry through the RSS feed. You can leave a response, or trackback from your own site.

Leave A Response

* Required