VirtualBox Virtual machine in Linux- Class 7

Virtualbox is today’s posts subject . We will talk about virtualization and how to virtualize a box using Virtualbox. To start we need to know what is virtualization and its advantages.

virtualbox logo

virtualbox logo

Virtualization, in computing, refers to the act of creating a virtual (rather than actual) version of something, including but not limited to a virtual computer hardware platform, operating system (OS), storage device, or computer network resources.

Taken from: http://en.wikipedia.org/wiki/Virtualization on 2014-04-22.

This post is part of a bigger Debian material that you can access here.

In the other hand talking specifically about the operating system is defined as:

Operating system virtualization refers to the use of software to allow system hardware to run multiple instances of different operating systems concurrently, allowing you to run different applications requiring different operating systems on one computer system. The operating systems do not interfere with each other or the various applications. Not to be confused with operating system-level virtualization, which is a type of server virtualization.

Taken from: http://www.webopedia.com/TERM/O/operating_system_virtualization.html on 2014-04-22.

For business this kind of technology brings a lot of advantages:

Virtualization is being used by a growing number of organizations to reduce power consumption and air conditioning needs and trim the building space and land requirements that have always been associated with server farm growth. Virtualization also provides high availability for critical applications, and streamlines application deployment and migrations. Virtualization can simplify IT operations and allow IT organizations to respond faster to changing business demands.

Taken from: https://software.intel.com/en-us/articles/the-advantages-of-using-virtualization-technology-in-the-enterprise

In practical ways this can be translated in:

  1. Less heat buildup as less machines means less heat.
  2. Reduced cost, less hardware, less electricity, less maintenance is less cost at the end.
  3. Faster redeploy, if you are taking snapshots if the servers. Using a virtual redeploy tool could take minutes to bring back a virtual machine (VM).
  4. Easier backups, you whole OS is only one file, you can save it in different ways like the snapshots or the conventional backups.
  5. Better testing environments, you do not use a real computer to do the tests, you are just writing in a file that simulates a computer.
  6. Abstraction between software and hardware, you do not need any specific driver or what ever software you might need to make and OS work in a computer. It does not care about the host OS.
  7. Possibility of specialized servers for every task in less hardware. You can have in 2 server the whole infrastructure that a big company needs with backups, DNS, DNCP, mail, etc… without shaving to have a different server for every machine, but every VM can host a different service.

Then Vietualbox is the software that we will use today.

is a virtualization software package for x86 and AMD64/Intel64-based computers from Oracle Corporation as part of its family of virtualization products. It was created by innotek GmbH, purchased in 2008 by Sun Microsystems, and now developed by Oracle. It is installed on an existing host operating system as an application; this host application allows additional guest operating systems, each known as a Guest OS, to be loaded and run, each with its own virtual environment.

Taken from: http://en.wikipedia.org/wiki/VirtualBox on 2014-04-22.

I think is the moment to stop talking and start doing. Let’s install the software.

root@khs91wxl07:/home/class# aptitude install virtualbox
The following NEW packages will be installed:
  dkms{a} libaudio2{a} libcurl3{a} libdirectfb-1.2-9{a} libgsoap4{a} libmng1{a} libqt4-network{a} libqt4-opengl{a} libqt4-xml{a} 
  libqtcore4{a} libqtdbus4{a} libqtgui4{a} libsdl1.2debian{a} libts-0.0-0{a} libvncserver0{a} linux-compiler-gcc-4.8-x86{a} 
  linux-headers-3.13-1-amd64{a} linux-headers-3.13-1-common{a} linux-headers-amd64{a} linux-kbuild-3.13{a} qtcore4-l10n{a} tsconf{a} 
  virtualbox virtualbox-dkms{a} virtualbox-qt{a} 
0 packages upgraded, 25 newly installed, 0 to remove and 47 not upgraded.
Need to get 35.9 MB of archives. After unpacking 150 MB will be used.
Do you want to continue? [Y/n/?] Y
Get: 1 http://http.us.debian.org/debian/ jessie/main libaudio2 amd64 1.9.4-1 [78.7 kB]
.
.
.
Processing triggers for menu (2.1.46) ...                                         
root@khs91wxl07:/home/class# 
Virtualbox graphic interface

Virtualbox graphic interface

After we install if we have a graphic interface. It will give us a very nice and easy to use graphic interface, to create our virtual machines. To start with virtualbox you can check the virtualbox manual here or here. If you want to learn how to do this from the command prompt you can follow this simple manual. I am not going to put any effort on creating a manual myself about this. Just to say that those manuals are very good and nice to read and understand. if you have any question you can post and I’ll try to answer it.

In the other hand I have to say that this procedure is used by me in production servers all the time and that it’s very stable. I have a few servers with no graphical interface and virtualbox running an they have been working for years now. The other good thing is the different OS support, you can have practically any thing.

now If you need to start that machine automatically once the host system has startes you can edit the file /etc/rc.local

# nano /etc/rc.local

and the file at the end you should declare your virtual machinesas follows:

su abel -c "VBoxHeadless -startvm LINUXD6401_1 &"
su abel -c "VBoxHeadless -startvm W2003SR203 &"

This two lines are two real life examples that run in every-time the server starts. The command examined is something like, change to the user abel and execute the command between “” and that command is the vietualbox command to start a virtual machine, where LINUXD6401_1 is the name of a virtual machine and W2003SR203 is the name of an other virtual machine.

And that is it thank you for your time.

2 thoughts on “VirtualBox Virtual machine in Linux- Class 7

  1. The subsequent time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I do know it was my choice to read, but I really thought youd have one thing fascinating to say. All I hear is a bunch of whining about one thing that you may fix in case you werent too busy on the lookout for attention.

    • Hi Timothytob,

      This is a very old port and I keep it online for historical consistency. Anyhow, I Removed all the adds you added to your original message and added it public is this is your opinion.
      The post was original done as an introduction to Virtualbox for some lectures I had to prepare once. Now, if you call someone a whiner you should probably cite it the part of the post. Not very thoughtful of you.

Leave a Reply

Your email address will not be published. Required fields are marked *