Sign in with
Sign up | Sign in

Creating A Virtual Machine

How To: Windows XP Mode In...Ubuntu Linux?
By

When you get back to the Ubuntu desktop you can now open VirtualBox via Applications/SystemTools/SunVirtualBox. Since we are using the free version of Sun VirtualBox, and not the free and open-source version, we need to agree to the license agreement. To do this, scroll all the way down and then click I Agree.

Next, the VirtualBox Registration Dialog window should open. If you already have a Sun Online account, enter your email and password and click Register. If not, you can enter your information and click Register. Alternatively, you can also just click Cancel to continue. Once VirtualBox opens, click on the New button in the navigation bar. This opens the Create New Virtual Machine wizard. Click Next.

In the Name field, enter a name for your new virtual machine. If you plan on having several VMs, name each VM descriptively to avoid confusion (such as “Windows XP SP3 32-bit”). You could also name the VM for its intended purpose, such as “Gaming,” “MS Office,” or “Compatibility Testing.” Under OS Type, you can choose the operating system and version. Since VirtualBox defaults to Microsoft Windows in the Operating System field and Windows XP in the Version field, we can leave it alone and click Next.

Now we must decide how much system memory we want to allocate to the virtual machine. In this respect, the VM is much like a real system; the more memory, the better. You can allocate up to half of your system's RAM to the VM. My test system has 4GB, so I'm going to give 1GB to the Windows XP VM. This will leave the host OS (Ubuntu) with 3GB when XP is running. After you have decided how much RAM to give to your VM, click Next.

Since this is the first time you're running VirtualBox, there won't be any virtual hard disks to chose from. Therefore, we must select Create new hard disk, and then click Next. This opens the Create New Virtual Disk wizard. Click Next again.

On this screen, we are presented with the choice between Dynamically expanding storage and Fixed-size storage. The difference is that Dynamically expanding storage will only take up the amount of space used by data in the VM. Fixed-size storage immediately takes up the entire size of the virtual disk. With either option, you will need to specify the size of the virtual disk after clicking Next.

The Location field on this page should already be indicating the name that you gave the VM earlier. Using either the text box or the slider, you can specify the size that you want your virtual hard disk to be. Remember, if you chose Fixed-size storage, your real hard disk will lose whatever amount you decide here. If you chose Dynamically expanding storage, this is the maximum amount of space your virtual hard disk will be allowed to consume. I'm happy with the default size of 10.00GB, but you can specify any size that works for you. Click Next.

The Summary Screen will display the type and size of your virtual hard disk as well as it's location on your real hard drive. Verify that the options are correct, and perhaps make note of the virtual disk's location. This is a good idea in case you want to backup, or even take your virtual hard disks with you. When satisfied, click Finish. The more space you've given to Fixed-size storage, the longer this will take. After your virtual hard disk is created, that wizard will close and another summary screen will display the Name, OS Type, Base Memory, and Boot Hard Disk that you selected for your new virtual machine. Verify the information and then click Finish.

Display all 124 comments.
This thread is closed for comments
Top Comments
  • 23 Hide
    cmmcnamara , October 7, 2009 6:14 AM
    I applaud the promotion of Linux, but this can be done in Windows too....Virtualbox is multiplatform.
  • 23 Hide
    void5 , October 7, 2009 6:26 AM
    You can't run Windows in virtual machine on Linux "all for free" - you still have to buy license to use Windows copy legally.
  • 20 Hide
    johnbilicki , October 7, 2009 6:24 AM
    How about some articles in regards to getting popular games to run on Linux distros? I finally got around to trying Wine and I was amazed as how insanely easy it was. A good article could convince many to migrate...and I'd love to see major releases start taking Linux as a serious gaming OS.
Other Comments
  • 23 Hide
    cmmcnamara , October 7, 2009 6:14 AM
    I applaud the promotion of Linux, but this can be done in Windows too....Virtualbox is multiplatform.
  • 2 Hide
    jsloan , October 7, 2009 6:22 AM
    xpm is nothing but an integrated microsoft virtual pc 2007, which microsoft makes available for free.

    i've been running w7 since day one and i have not found a reason to use xpm. windows 7 runs everything i've thrown at it.

    also, virtual box runs fine on w7, so there is no need for linux...
  • 20 Hide
    johnbilicki , October 7, 2009 6:24 AM
    How about some articles in regards to getting popular games to run on Linux distros? I finally got around to trying Wine and I was amazed as how insanely easy it was. A good article could convince many to migrate...and I'd love to see major releases start taking Linux as a serious gaming OS.
  • 23 Hide
    void5 , October 7, 2009 6:26 AM
    You can't run Windows in virtual machine on Linux "all for free" - you still have to buy license to use Windows copy legally.
  • 1 Hide
    lifelesspoet , October 7, 2009 6:30 AM
    So far I tried 3 games that didn't run in windows 7 but ran in wine. It seems from my example, the older the program is the more likely it will run in linux and less likely it will run in the latest version of windows.
    Also, virtual box doesn't support directx, so graphically intense programs will not run properly or at all.
  • 2 Hide
    JonathanDeane , October 7, 2009 7:03 AM
    I like my main machine (the one with the most oomph) to run Windows what ever flavor is the latest. Then I like to run Linux on older hardware since Windows tends to bloat over time and not work so well. The OS is just a tool. XP is almost to that Windows 98 stage where it lacks security and is getting slower with each patch and lacks the new shiny. RIP XP you where the best of the best in your day! Being OS agnostic gives you more tools to work with in your life learn to use them all properly and you will find you can do things you thought where too hard or too complex before. Maybe one day people will learn to love all OS's equally lol
  • 0 Hide
    bujcri , October 7, 2009 8:15 AM
    Very nice article, still, it doesn't mention anything about possibility of running 64 bit software or how many cpu cores virtual box can use (I saw from the picture that it could be more than one)
  • 8 Hide
    danny69t , October 7, 2009 8:22 AM
    Good article. Keep it up with Ubuntu "stuff" like this. How about making a short article about installing software from tar.gz ? I didn't manage to use them darn tarballs.

    "all the ways to customize your GUI, from panels to widgets and everything in-between. Don't worry, there will be a ton of transparency effects for those interested in cloning the Windows 7 GUI. There will even be some effects, like expo for Compiz Fusion, never before seen on a Windows machine."

    Can't wait for that article, Adam.
  • 8 Hide
    mitch074 , October 7, 2009 8:55 AM
    Please note:

    - the article does state that you need a valid XP install media - meaning, that you should have a Windows XP license with it. Say, the one that came with the computer you converted to Linux... Moreover, if you happen to install an 'update' version of Windows, you lose the right to install both the older and newer OS on the machine (check EULA) - so you'd need to spring for a 'full' version of either. Linux has no EULA (only the GPL, which essentially says 'use at will') so you can use the former OEM OS (presumably Win XP - lower-end Vista have EULA limitations) in a VM, IF KEPT ON THAT 'REAL' MACHINE.

    - DirectX acceleration is available in VirtualBox (this is not the case with VirtualPC), but it is experimental. Essentially, it creates an OpenGL context on the host OS (Linux or Windows), a virtual 3D device on the guest OS, provides a DirectX to OpenGL translator and a WGL to XGL passthrough (think Wine) - giving the guest OS accelerated OpenGL and DirectX capabilities. Note that currently, the OpenGL option is considered more stable than DirectX, because like Wine's WGL to XGL passthrough driver, there's (almost) no code translation required. As far as I know, there is no passthrough option available for DirectX (thus Windows on Windows has no advantage over windows on Linux - it's even worse, due to Windows on Linux making use of Linux's much faster I/O capabilities - my test results, not mine).

    - The vbox 'CPU cores' options defines how many cores are emulated on the host; as far as I know, vbox ain't multithreaded yet. Think SMP emulation for the host. You should also enable IO APIC emulation with it, and this may be unstable in WinXP.

    About .tar.gz packages: they can contain both binaries and source code; thing is, in Linux, it's often more practical to ship source code and make the user compile it, but the user has to know which is what. If we take Skype's example, there are two .tar.gz available: the 'dynamic' one will make use of local libraries already installed on your machine (mainly Qt), the 'static' is a complete package that doesn't require any extra install (but is a much bigger download). On Xvid's page though, the .tar.gz package only contains source code; you have to enter the directory that contains the UNIX-like source, and do 'magic':

    ./configure --help ## that parses the 'configure' script and recaps default compilation and install settings. Read it thoroughly. Don't forget the './', required to run the local version; otherwise, Linux will default to 'configure' located in /usr/bin, which is NOT the same.

    ./configure ## that checks for dependencies on the system and prepares the build; if it can't find a compiler or any other required dependency it'll abort: install GCC and whatever library is missing (you may need the -dev or -devel package). If it can't find NASM, an assembly optimizer, it'll revert to slow 'pure C' implementation - and say so. Thus, read ./configure's output. Install optional dependencies for those features you need. You may need to pass options defined in the --help.

    make ## that will actually start the compile job, according to the last ./configure run (some will actually run configure with default settings first; it is also possible that there is no ./configure script). It should take a few minutes depending on how fast your processor is.

    make install ## to be run as root. Will add libraries and binaries in default paths on your system, overwriting existing files. If run as user, will probably fail. You may run into dependency hell if you overwrite existing critical files.

    For actual, package-dependent instructions, read the README files that are found inside the package. Most will sum up the above, others may give different instructions.

    Some packages (mainly daily builds) will actually require tools like 'automake' that parse the current source files, create a ./configure script and run it.
  • -8 Hide
    Thanatopsis , October 7, 2009 9:04 AM
    "In order to follow this guide, you need an installed Linux distribution (I use Ubuntu), a legitimate copy of Windows XP, familiarity with the XP installation, and Sun's VirtualBox virtualization software (free). "

    You don't NEED a legitimate copy of XP. There's no reason this wouldn't work with any copy of it.
  • -5 Hide
    anamaniac , October 7, 2009 9:04 AM
    $100 for somethng you use everyday and is the base of everything you do is too expensive?
    Hell, I pay $100 for my shoes (I like having comfortable shoes that don't fall apart), and I replace them once a year, so once every 3-4 years for a new OS isn't bad. I use my computer more than my shoes...
  • 0 Hide
    anamaniac , October 7, 2009 9:08 AM
    On a side note, if I remember correctly, Win7 Home is $100 OEM and $250 OEM.
    These come with no support, but really, not like you'd use microsoft support anyways, especially if your a user using a linux distribution.
  • 7 Hide
    Anonymous , October 7, 2009 10:29 AM
    Really liked your article.
    VBox is improving really fast, is free, and can do everything VmWare does.
  • 2 Hide
    evongugg , October 7, 2009 11:58 AM
    Finally you can do your taxes in Ubuntu with the Virtual machine.

    You can install just about any version of Windows you want with a Virtual machine and more operating systems. See here for all the operating system supported.

    http://www.virtualbox.org/wiki/Guest_OSes
  • 8 Hide
    randomizer , October 7, 2009 12:37 PM
    Thanatopsis"In order to follow this guide, you need an installed Linux distribution (I use Ubuntu), a legitimate copy of Windows XP, familiarity with the XP installation, and Sun's VirtualBox virtualization software (free). "You don't NEED a legitimate copy of XP. There's no reason this wouldn't work with any copy of it.

    Are you suggesting that they actively promote piracy on a front page article? You must be joking.
  • 1 Hide
    bunz_of_steel , October 7, 2009 12:52 PM
    jsloan There is no need for your DA comments either! Gr8 article Adam!! Looking forward to pt2 maybe w/64bit multi-core difference comparisons with different memory allocations.
  • 0 Hide
    climber , October 7, 2009 12:59 PM
    I wonder if someone could switch their computer to linux, install the virtual box environment then install XP and get all the updates and everything to bring windows up to date, then install Ghost. Could one do a Ghost restore to that virtual PC to restore your drive to the virtual drive?
  • -2 Hide
    caamsa , October 7, 2009 1:40 PM
    Wouldn't it be easier to just dual boot windows and Ubuntu on the same disk? Then at start up you can just pick one or the other without all the hassles of using the virtual box.
  • 1 Hide
    adamovera , October 7, 2009 1:45 PM
    johnbilickiHow about some articles in regards to getting popular games to run on Linux distros? I finally got around to trying Wine and I was amazed as how insanely easy it was. A good article could convince many to migrate...and I'd love to see major releases start taking Linux as a serious gaming OS.

    Working on it, probably gonna be a series, hopefully starting by X-Mas.
Display more comments