Computers Inside Computers: A Virtual Playground

Sun VirtualBox

If you've never heard of VirtualBox, written by Sun Java, then you're in for a treat. It is an amazing program capable of setting up and running virtual computers inside your real computer. That's right! On my own computer I have several Virtual Boxes set up. I can run my choice of Windows 7, Ubuntu Linux, and several other operating systems from within the comfortable, safe environment of Windows XP. How is this possible, you ask? Read on to find out.

First of all, you'll need the program itself. It's completely free; go to Google or your favorite search engine, and type in "sun virtualbox" and click the first link that comes up. It should be Sun Java's website, with a link to download VirtualBox. If it's not, go back to your search page and try a few more links until you find it.

Once you have the program, you'll need enough physical space on your hard drive to set up an actual operating system. Don't worry! It's not going to actually install an OS. What it does instead is create a virtual disk that takes up a part of your hard drive. The operating system you're installing will think that this virtual disk is its entire hard drive; inside the virtual OS, the main hard drive that you see will be the part of that drive, also called a partition or virtual drive, that you allocated to the virtual box.

Don't have any idea how much space operating systems take up? Not a problem! You can view this handy table right here, or use the program's recommendation. Virtual box asks you which OS you want to set up, and automatically recommends an amount of hard drive space to use.

Windows 95/98/2000: ~2 GB

Windows XP: ~10 GB

Windows Vista/7: ~20 GB

Linux (any distribution): ~8 GB

Mac OS: ~9 GB

Now, once you've downloaded and installed VirtualBox, you still have a lot of work to do in order to set up a virtual computer. Don't worry, it is usually much faster to install an OS in a virtual box than it is on a real computer. From now on, I'm going to refer to the virtual computer as the "guest" and the real computer (the one with virtual box installed on it) as the "host."

To get started, run the program. When virtual box loads up, you see a list of virtual boxes you have set up on your computer, with a few buttons above it. When you first load the program, the list will be empty, obviously. Click the "New" button with the blue star icon to begin setup of a new virtual box.

A setup wizard will open and ask you to name the virtual box and select which OS you want to install (you'll need an actual copy of the OS and a disk with that OS on it, though). Then, it will ask you to set how much hard drive space you want to use for the partition (think of it as the hard drive that will be visible inside your virtual computer). This hard drive space will actually be totally used up on your hard drive in the host computer, even if that space is empty in the guest computer. This is because it has a special format called a virtual disk partition, and can't be used for anything else until you delete the virtual box and deallocate that space back to regular hard drive space. The "Discard" button at the top allows you to do this if you later decide you don't want the virtual box anymore.

Next, the wizard will create the partition, which should take no more than five minutes, depending on how big it is. Once this is done, you should see an entry appear in the list of virtual boxes you can use. Don't click "Start" just yet; you're not quite done setting up the virtual box and getting it ready to go. Click the new entry in the virtualbox list, then click the "Settings" button.

A large dialog will open that allows you to design your virtual computer. You can only design a computer as good as your host, and usually not quite as good as that, because whatever OS your host is running will still need its own memory and processing power, etc. You can give the guest computer as many CPU's as you have (i.e. if you have a dual-core processor, you can give the virtual box one or both of them to use). You can enable or disable 3D graphics acceleration (for high-end video cards) and you can specify how much RAM to allocate to the guest. It is important to give the virtual box enough memory to be able to run, but not so much that it chokes your host OS. The program will automatically recommend a value, but this will usually be way too low. I typically assign about half of my available RAM to the virtual box, unless it is an OS like Windows 7 that has high memory requirements. The program will also notify you if you have assigned potentially too much memory (and haven't left enough for your host OS) but you can override this and assign it anyway, so be careful how much you give it.

Make sure to assign the virtual box either a CD drive (so you can install an OS) or specify an image of a disk with an OS on it. Otherwise, you won't be able to install an operating system and will just have to shut down the guest right after it boots up.

Once you are satisfied with all these settings, click "OK" at the bottom to close the dialog. Now, you can finally click "Start" and get an operating system installed on the virtual box. You should install the exact same OS you specified in the setup wizard or the settings window. If you tell it you are going to install Linux, for instance, but you mount a Windows disk instead, the partition that was created on your hard drive is going to be the wrong format and most likely incompatible with the OS you're installing. Make sure that the OS you told it you wanted is the one you are installing, and make sure you picked the correct version of the OS as well. For instance, Windows XP as opposed to Windows Vista. Individual versions of an operating system often require different types of partitions. The exception to this is Linux; most of its distributions use a widely accepted linux partition format.

Luckily, if you do make a mistake at any point, you can just click "Discard" and the virtual box drive will be deallocated and freed up on your hard drive, so you can try again. No need to reformat anything! This really is the perfect playground for testing or trying out operating systems without having an extra computer to use.

Now, I'm not going to go over the steps for installing an operating system here. Just go to the respective website for that operating system to get help with installation. It should look exactly the same as if you were installing it on a real computer, only it's running in a window in the host computer (although it does have a full screen option, similar to a virtual private network login). Click "Start" in the virtual box program to "power on" the virtual computer, and then install the OS when the options come up on the DOS-like screen. If you didn't give the guest computer a CD or DVD drive, or mount a disk with an operating system on it, you won't be able to install one on your virtual computer. Again, you can do this in the "Settings" dialog once you power off the guest computer.

Once the operating system is finished installing, reboot your virtual computer. Most OS setup applications will do this automatically. Your new computer should be up and running in no time! To learn more about how to use the virtual box program itself, just read the included documentation or help files, or read them online at Sun Java's VirtualBox website. It has a lot of neat features that make using it a breeze.

More by this Author

Comments 2 comments

Confused 4 years ago

I'm assuming you wrote this article before Oracle bought out Sun Microsystems, which is why you refer to VirtualBox as belonging to Sun, but why on Earth do you call Sun Microsystems "Sun Java"?! Java is a programming language that (until the Oracle acquisition) was developed by Sun Microsystems, often known simply as "Sun". Sun as a company were never known as "Sun Java". This completely undermines any confidence that this article was written by a knowledgeable author.

Cybermouse profile image

Cybermouse 4 years ago from Bentonville, AR Author


The main logo on the website says "Sun Java" and that's as much research as I did on the subject of company names and branding. I am a programmer for Wal-Mart and am well aware that Java is a programming language. As the VirtualBox program is written in Java, calling it a product of "Sun Java" makes complete sense to me. As you mentioned, Sun developed Java. Java is therefore a Sun product. Calling it "Sun Java" makes just as much sense as using the brand name of any product as part of the name. It's like saying Wrigley's Spearmint gum. Correct, it is now Oracle Java, but as you said, at the time this article was written, that acquisition had not yet occurred. I don't feel overly pressured to correct the article since Sun remains the original source of the Java language.

There is a website called Sun Java. There is no company called Sun Java, nor did I ever assume there to be one. The Sun Java website is where I downloaded VirtualBox, therefore it is where I directed readers of my hub to download the same.

If you have a real criticism to make, I'll be happy to hear it, but I'm afraid I'm the one who is confused here.

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.

    Click to Rate This Article