Skip to main content

VirtualBox and CentOS - a technical success story

Most of my readers are probably firmly in the Microsoft Windows world when it comes to using a computer. What is Microsoft (MS) Windows (in any one of its many incarnations, whose most common and recent members are Windows XP, Windows Vista and Windows 7)? It's the operating system (OS) of the computer - for most people computers aren't very usable without an operating system. The operating system sits on top of the hardware and provides the complete logic for everything you see when running a computer - it connects to and registers various hardware devices while booting, like graphics card, sound card, mouse and monitor, and provides functions like user management, a graphical user interface (GUI), process management, and much more. The operating system does not include things like web browsers, mail programs or office suite programs (yes, there are alternatives to MS Office, see OpenOffice).

There are many other operating systems, some with restricted niche usage (RISC OS), some belonging to museum shelves (Amiga OS), and others are often used in the worlds of servers and computer programming. In recent years the many flavors of Linux have played an important and ever-growing role in this group. As a programmer I have long preferred working with Linux, and my work PCs always had Linux (usually SuSE) as their primary operating system. In particular the command shells in Linux are powerful tools for the programmer, making it easy to perform a variety of programming tasks.

For those (like me) who like or need to work with more than one OS on a single computer, there are couple of possibilities. One possibility (which I had always used on my private PCs) is to install the second OS parallel to the first, and offer a choice at booting which OS should be started. The advantage of this method is that the technology is fairly old and well understood, and the OS being run has access to the full hardware resources of the computer. The disadvantages include the fact that switching OS requires a new boot, and that the necessary change to the MBR (Master Boot Record) of the computer can render certain functions inoperative - for example, while my laptop was configured to dual boot Windows 7 or SuSE 11.2 I couldn't use the suspend to disk function, nor could I perform a full system backup (which gave me the incentive to try the following alternative).

Another possibility is using a so-called Virtual Machine (VM). A virtual machine makes it possible to run another operating system "in a box" within another OS. The programs that make this possible are getting better all the time. There are commercial programs available such as VMWare and there are also free alternatives (at least for private users), such as VirtualBox.

I already knew that my new employer (starting January 3rd) uses CentOS Linux, a variety of Red Hat Linux. Since I have plenty of time this month before starting my new job, I decided to try out CentOS on my laptop, and to circumvent the problems I'd had with my dual boot system by using VirtualBox on a Windows host.

When using a virtualization program we talk about the host system and the guest system. The host system is the system which runs the virtualization program. The guest system is the OS running inside the virtualization program. The guest system then runs inside a window of the host OS, and you can switch between programs operating in both systems with a click.

Finally it's time for a picture. After installing VirtualBox (I have 3.2.12) and starting the programm, you'll see a screen similar to this (click on this image and the following images to see a larger version):


On the left side you see my virtual CentOS, which is running. To establish a new virtual OS you need an installation medium for that OS, such as a CD, DVD or downloaded ISO image. A virtual hard drive for the guest sytem is created on the host hard drive in the form of a .vdi file - this file is not normally readable by the host OS.

I got CentOS 5.5 up and running within a few hours, which I found quite acceptable considering I hadn't done this that way before. This includes wireless networking, which works in a completely transparent way - my wireless card, up and running under Windows, is seen as a normal (virtual) network interface in the guest OS which doesn't need any additional configuration, not even the wireless password.

It's now possible to run the guest system in seamless mode - that means that windows of programs running in the guest OS float like normal windows in the host OS. Here's an example:


Here you can see the open browser window (in Windows 7) where I'm writing this blog post. Overlaying that partially is a command shell window from CentOS. I can click back and forth between the two windows without any other switching overhead. You might notice at the bottom of the screen that the KDE task bar is visible above the Windows task bar - I can choose any running program from either OS.

The alternate to seamless mode has the complete guest OS running within a self-contained window:


Here CentOS is running in the window on the right side of the screen, and all programs running under the CentOS VM are contained within that window. This certainly helps avoid getting confused when switching between the operating systems!

So far I've noticed no unpleasant side effects. I allocated 40 GB of my ample hard drive to CentOS; at the moment I'm giving it only 512 MB of RAM from my 4 GB - if I notice problems when doing heavy compiling I might up that a bit. I made one of my Windows partitions visible to CentOS, so I can open documents and other files if needed from the guest system. Networking was absolutely easy.

In summary - I imagine this post might be a bit boring to some of my regular readers, but I was just so excited about this technical success story I had to share it with you. And maybe expand my readership in the process.

Comments

Popular posts from this blog

How are you feeling? - national differences in the perception of personal health

" Wie geht es dir ?" "How are you feeling?" These questions are probably heard in every culture. The answers, and how mild illness is dealt with, varies between Germany and America. Mir geht es schlecht - I'm not feeling well. Really. Since Thursday I've been lying in bed with a low fever, racking cough, stuffed up nose and sneezing. A typical February complaint. What do I have? For an American, the answer is probably simple - either a cold or the flu, perhaps with a touch of bronchitis. For a German the answer is not quite so clear cut. The German is aware that real flu (influenza) is characterized by a sudden high fever, chills, and aches and pains - in addition to the typical upper respiratory symptoms. I don't think I have influenza - my fever, at around 100°, just isn't high enough. And I don't have any aches and pains. But a cold? Well, does a cold come with a fever? It might, I guess, in English. But the Germans have a special word fo
 Don't Be a Fafner Developer! I'm going to talk about a type of developer you should not want to be - a Fafner developer. What do I mean with this expression? First, I need to digress. Fafner is a character in Wagner's massive 4-opera "Ring of the Nibelungs" cycle. He and his brother build the gods' castle Valhalla. In payment they receive a vast treasure (the Rhinegold), which includes a magic helmet (the Tarnhelm) and a ring of power (the basic idea should be clear to you if you've ever read the Lord of the Rings). Fafner kills his brother, takes the treasure off to the woods, uses the Tarnhelm to turn himself into a dragon, and settles down on top of his hoard. Much time passes. Finally a hero emerges who is brave enough to take on Fafner (Siegfried). The evil dwarf Mime tries to warn Fafner of the approaching danger. Fafner's response? "Ich lieg und besitz…lass mich schlafen" (I lie here and possess…let me sleep). Of course we know what h

Vienna

Introduction Instead of a chronological account of our time in Vienna I'm going to organize this by themes, in the hope that it will be more interesting and more useful (should anyone happen to find this blog). We landed at the Vienna airport Friday morning, and flew back out Monday evening, so we had nearly four full days to enjoy. I had only been here for a one-day business trip a year ago; Anja auditioned for some artists' agencies a number of years ago, but was only here for a day or two, and mostly concerned with singing, not with sightseeing. Our previous impressions were thus very limited. Our hotel, the Hotel-Pension Shermin Apartments proved an excellent choice. The room was modern, clean and relatively spacious, and most important – extremely quiet. The personnel was friendly and helpful. It's located only a five-minute walk from the subway station Karlsplatz, and directly next to a tram stop. Before our trip we ordered a Vienna Card for each of us online.