Get a virtual Linux box on your Windows PC

Some colleagues were asking, so I figured more people might want to know: how to get a working Linux box without breaking your Windows PC. To play with, to run some software you can only get on Linux or maybe even to run some virtual server programs.

Here’s how, using Ubuntu as a distribution (it’ll work for others too):

  • Get Linux
    Download disk image with your favourite Linux bootable distribution. Right now, for Ubuntu, getting the Ubuntu 8.10 stable edition .iso file worked for me, the 9.04 is about to be released as a stable version too.
  • Get VirtualBox
    Download the latest binary of VirtualBox. The VirtualBox 2.2.2 setup for Windows works fine for me.
  • Install VirtualBox
    Using default options, install VirtualBox. You can install it in the default location, since you will be able to put the virtual machines in any folder you like.
  • Create the virtual machine
    In VirtualBox, create a new virtual server. Default settings work fine, but you can tweak the amount of memory and diskspace to your liking. It does need a virtual hard disk, to install Linux on. Create the virtual hard disk where you have sufficient space to contain all the files you want to put on the virtual server.
  • Attach the Linux disk image
    In VirtualBox, point the virtual CD-rom drive to the .iso file with your Linux distro. Once you start the virtual machine, its cd-drive will have this disk loaded and will attempt to boot from it.
  • Start the virtual machine
    The virtual machine will boot using the CD-rom image. If you have the Ubuntu distribution, it will ask you what language you want to use and then offer you the option of booting Ubuntu without installing it. Instead, you can tell it to install Ubuntu, which will install it to the disk image you created.
  • Install Linux
    Follow the instructions of the installer for your Linux distribution. Most of the choices will be straightforward, Google is your friend if they are not.
    Note: if your mouse gets ‘stuck’ in the VirtualBox window, you can free it by hitting the right control button.
  • Install Guest Additions
    VirtualBox offers a set of tools for Windows and Linux guest operating systems. Note: the guest operating system is the OS in the virtual machine. The host OS is the OS of the PC you installed VirtualBox on. To install the guest additions, shutdown the virtual server, download the guest additions for your version of VirtualBox and attach that .iso image file to the virtual CD-drive. Then start your virtual machine and start the appropriate installer from the CD-drive.
    Alternatively, select ‘Devices – Install Guest Additions’ when your virtual machine is running, to do it automatically. But if this doesn’t work, you will be able to do it yourself.
  • Reboot and you’re done!
    Just reboot the virtual machine once more and you’re done! With the most recent guest additions, you’ll be able to seamlessly use the virtual Linux box, running in a window on your desktop. It will even support reading from your real CD-rom drive, floppy drives and USB devices and it will use whatever network connection is available in the host OS.

Of course, if all you wanted to do is run Linux applications on the Windows desktop and you already have a Linux server running somewhere, you could go the way of installing Cygwin and using its X-Server to show applications that run on the remote Linx server. But that’s another blog post ;-).

Published by

Jaap van der Velde

I live and breathe software, love games and spent many a vacation touring Europe on my motorcycle. Currently diving, riding, hopefully flying and gaining perspective around Oz.

Leave a Reply

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