Running Linux on a Virtual Machine in Windows
Safely Install Linux in a VM Without Giving Up Windows (Yet)
Choosing Virtual Software
There are a number of virtualization products with free versions available. VirtualBox from Sun is one of the easiest to use. It also supports a large number of guest operating systems, including most Linux distributions, FreeBSD, and various versions of Windows itself. Other options include Virtual Server from VMWare, and Xen (xen.org). One option that does not support Linux is VirtualPC from Microsoft. This article focuses on using VirtualBox.
VirtualBox can be downloaded from virtualbox.org. "VirtualBox for Windows hosts x86/amd64" is the correct choice (version 3.0.8 at the time of this writing). The file should be saved on the hard drive for installation later, because configuration is easier if the Linux distribution is downloaded first.
Download Ubuntu Linux
Ubuntu offers a powerful Linux desktop installation, which comes complete with a web browser, office productivity software, games, email, etc.- pretty much everything computer operators use most. Also, Ubuntu is known to be an easy Linux distribution for people making the switch from Windows. The software can be downloaded from ubuntu.com. Any mirror site can be chosen, but the download will complete sooner if a close mirror is selected.
Installing VirtualBox
The VirtualBox installation program will prompt the user to accept the license agreement. It will also warn that it will temporarily disconnect the local network connection. Beyond that, installation can be easily completed simply by accepting the defaults offered by the program. VirutalBox is free, but Sun does require users to register the product the first time it is run (see attached screenshot).
Shortly after registration, VirtualBox launches a wizard to facilitate the creation of a Virtual Machine. To create VM with Ubuntu Linux, enter the following responses to the appropriate prompts:
- Name: Ubuntu
- Operating System: Linux
- Version: Ubuntu
- Memory: The recommended minimum size is 384 Megabytes. On a system with at least one Gigabyte, give 512 Megabytes to the new VM for better performance.
- Boot Hard Disk (Primary Master): Selected
- Create New Hard Disk: Selected
- Storage Type: Fixed-size storage
- Virtual Disk Location: Ubuntu
- Virtual Disk Size: 10.0 GB
Installing Ubuntu on the New VM
Once these options are selected and the user presses [Finish], the new VM will be created, but there will as yet be no operating system installed. One of the nice features of VirtualBox is it's ability to mount an iso image as a virtual CD/DVD drive. So the VM will see the Ubuntu download as if it were an attached CD.
At this point, the VirtualBox screen should list the new Ubuntu VM (Powered Off). To set up the Ubuntu installation, click the Settings icon on the menu. With CD/DVD-ROM selected, Click the 'Mount CD/DVD Drive' checkbox, click the 'ISO Image File' radio button, and use the folder icon to navigate to the Ubuntu iso file previously downloaded (see screenshot 2) and click [OK].
Back on the main VirtualBox screen, with the Ubuntu VM highlighted, click the 'Start' icon on the tool-bar to "Power Up" the new Virtual Machine. A couple of message boxes will appear. The first one concerns the "host key", which toggles the user's mouse control between the host system and the VM (right ctrl key by default). The second message warns that a higher screen resolution is available. This will be fixed later.
The Ubuntu installation script will then run, prompting for the default language first, then presenting a menu. Using the arrow keys (the mouse won't be active yet), select "Install Ubuntu" and hit . The program will prompt for the following items, listed here with suggested responses:
- Language: English
- Time Zone: Select a nearby city
- Keyboard layout: USA
- Prepare disk space: Use the entire disk (it won't really use the entire disk, just the 10 Gigabytes set aside for the VM).
- Name: User's name
- Password: Choose a password
- Computer Name: Choose a name for the virtual computer
- Require Password or Log in Automatically: Require Password
After the information is confirmed, Ubuntu will complete the installation, then prompt to be restarted. As the VM starts back up, it will instruct the user to remove the CD. Since it isn't a real CD, one has to hit the right cntrl key (to enable mouse control outside the VM), click on the "Devices" menu item at the top of the VM window, and select "Mount DC/DVD ROM-Drive -> Host Drive."
To get the new CD/DVD settings to take effect, the VM has to be stopped and re-started. The easiest way to stop it is to simply close the VM window. Then, in the VirtualBox control window, click the 'Start' icon again. When the VM starts up again, it will prompt the user for a name and password, after which a running Ubuntu system should appear.
VirtualBox Guest Additions
VirtualBox provides some optimizations for the guest operating systems. These optional components increase performance and usability of the VMs on which they're installed. To add Guest Additions to a running Ubuntu VM, simply click on the 'Devices' menu and select "Install Guest Additions." Stop and restart the VM again. A new CD icon will appear on the desktop.
Double-clicking on the CD icon will display a list of files on the CD (which again is not a "real" CD, but a virtual image). Double-click on "autorun.sh" to install the additions. The installer will ask for the user's password, and whether to run or display the file. Click [Run], and the additions will be installed.
One last time, the VM has to be stopped and restarted, but from now on it should be stopped the proper way, by clicking on the "stop" icon in the upper right-hand corner of the window, next to the user's name. This will give the user the option of shutting down or re-starting (among others). "Restart..." is the option to choose here.
After this, the user will not have to hit the host key (right cntrl) to toggle the mouse / keyboard controls between the VM and the host system. Also, better screen resolutions are possible. Screenshot 3 shows a Windows desktop with a running Ubuntu virtual machine running in a high-resolution window.
Using Ubuntu
Making sure that Ubuntu is updated with the latest versions of installed software is easy. In a running Ubuntu system, available updates can be listed and installed right from the main menu by selecting System -> Administration -> Update Manager. Most users are safe leaving all available updates selected and clicking [Install]. Note that the Guest Additions may have to be re-installed after an update.
VirtualBox allows users to take a "snapshot" of a VM, which is just an exact copy of then entire virtual system. This can be done from the menu with Machine -> Take Snapshot. This lets Ubuntu users experiment with the menus and applications, knowing that no matter what they do to their system, they can always revert to an existing snapshot.
This is a great way for Windows users to explore the Ubuntu Linux system without leaving their comfort zone until they're ready. In fact, they don't have to leave Windows at all while enjoying the benefits of a great, free operating system, until the existing Windows system needs to be replaced. Then, they can choose to upgrade to a newer version of Windows, or switch to Linux with completely with confidence.
For other options on easing the transition from Windows to Linux, see Adopting Open Source Before Switching to Linux.
Published by Joe Poniatowski
A full time IT consultant with over 20 years experience. Clients have included 2 of the big 3, financial institutions, and state and local governments. View profile
VMWare - Run Virtual Computers Inside Your PC VMWare is a piece of software that allows computer users to install and run many different operating systems, including Linux, Windows, BSD and Solaris, inside a "virtual machin...
Ubuntu Storms Linux CommunityA relatively new distribution to enter the scene is called Ubuntu, and it's quickly become the most widely downloaded flavor of Linux. Great features and a seemless user experie...- Automate Ubuntu Backups with Cron and TARDetailed howto article to setup automated backups using built-in features of Ubuntu (TAR and cron).
- How to Install Virtual Box on Your Hardy HeronThere are many Virtual Machine can be used. Like VMWare, Qemu, Bochs, VirtualBox, etc. But i choose VirtualBox because it's free and simply to use. These are steps to install it on my Ubuntu Hardy Heron.
- Virtual Machine Software for Beginners
- How to Create and Run a Virtual Machine for Free
- How to Create a Virtual Desktop on Windows Using Free Software
- How to Create a Virtual Desktop on a Mac Using Free Software
- How to Run Your Favorite Windows Application in Linux
- How to Try Windows 7 Without a Spare Computer
- Linux and Windows: The Best of Both Worlds
- Run Linux in a Virtual Machine on Windows
- Easy VirtualBox installation instructions
- Explore Ubuntu Linux





2 Comments
Post a Commentsuch a foreign world.
It sounds complicated, but I will give it a try!