Virtual PC Step by Step

Update: April 10, 2008 – While the instructions below are still valid, I’ve created a new version of this post for Virtual PC 2007. And it’s in Video! Take a look at my post for
April 10, 2008 – Virtual PC 2007 Step by Step – The Video!

Update: April 22, 2008 – There’s a second video now showing the advanced settings. Some good info that adds to the scope of what’s here. Check out my post for
April 21, 2008 – Virtual PC 2007 Step by Step – The Advanced Settings Video!

OK, you’ve downloaded Microsoft Virtual PC (here after referred to as VPC) and installed it. The first time you run it, you see the display below. Now what? Let’s walk through it step by step.

Step 1: Create a new virtual computer

Start by clicking on the New button, and you’ll see this dialog:

Creating a virtual machine seems like the way to go, but let me mention the other two options briefly. Use default settings to create a virtual machine isn’t that useful, it creates a VPC but with minimal memory. I wouldn’t ever use this if I were you. Add an existing virtual machine on the other hand can be quite useful.

Virtual PC stores it’s data in two files, a VMC file that saves the various settings for your virtual computer, and a VHD which is your virtual hard drive. Copying these two files to another computer, launch VPC and pick this Add option, and you will open the VMC file. Away you go, you’re working in your VPC.

But let’s get back to the task at hand and create a brand new machine. Click Next to see this dialog:

It’s asking you what you wish to name your computer. You should make sure to read this carefully, if you don’t give a path then by default the vmc file will be placed in your My Documents\My Virtual Machines directory. The problem is this is your C drive, and if you are following directions you really want to run your VPCs off a different drive other than C.

I created a VPC directory on my D drive, I’d suggest you do something similar. That way you can store your VMC and VHD files in the same location. For a new machine name then, type in D:\VPC\My New Machine and click next. (By the way, in time you’ll want to use a better name, such as MyXP or MyUbuntu, but for now this will do.)

Step 2: Select your Operating System

On this screen it will ask you what operating system you’d like to install. As you can see, there’s lots of built in support for past Microsoft OS’s (and oddly OS/2). If you are installing anything else, such as a Linux distro (short for distribution), select Other, otherwise select the OS you will be installing and click Next.

On the next display you will be asked about the amount of RAM to use.

Step 3: Adjust your RAM

By default, VPC selects Using the recommended RAM, which is a measly 128 meg. Unless you are running DOS or some older OS, I would suggest bumping this up to at least 256 meg. You may want more, depending on what you’ll be doing. For doing Visual Studio development, I’d go 512 to 1024.

Click the Adjusting the Ram option and the slider bar will appear. Use it to move the RAM up or simply type a new value in the text box and click Next.

Step 4: Select or create your hard disk

On the screen above you are asked about the Virtual Hard Disk, or your VHD file. This is another of the screens that baffles me. I wonder what bizarre logic was being used that assumed you usually had an existing VHD when you were creating a brand new virtual computer? Unless for some reason you have to rebuild the VMC file, select the A new virtual hard disk option and click next.

On this screen you are asked what you want to name the VHD file. Be default, it uses the name you gave the VMC file and adds “ Hard Disk” to it. I usually just take this default and click next.

Step 5: Confirm your choices

We’re finally at the last screen in the Wizard. Here all you have to do is confirm your choices, and click finish. So what happens next?

Well, nothing spectacular. Your Virtual PC Console will now look like this:

Now it’s time to install an operating system.

Step 6: Install an operating sytem

First, make sure your OS boot / install disk is in your CD/DVD drive. Now make sure your machine is highlighted and click Start.

A window pops up, and looks just like a computer booting up. All of a sudden you’ll see the words “Reboot and Select proper Boot device or Insert Boot Media in selected Boot device”. Now what?

Well, all it’s telling you is that it can’t find anything to boot from. By default, Virtual PC will protect you by not automatically giving access to any of the devices (hard disks or CD/DVDs) on your host system. To fix this, simply click on the CD menu, then pick Use Physical Drive E: (or what ever drive letter your CD is). Now click in the window and hit ENTER.

If all is well, your CD should start up and you will begin the process of installing whatever operating system you’ve placed in your drive. Walk through all of the steps like you normally would, formatting your hard disk, setting up partitions, etc. Don’t be worried, you won’t be hosing your real drive, but installing to your virtual drive (your VHD file).

Step 7: Configure and protect your VPC

OK, your new machine is up, now what? Well, if you are running a Windows OS I would highly suggest the very first thing you do is install AntiVirus software and a decent firewall. I know, you’re thinking “Why? My host system has these installed, won’t they protect it?” To which my answer is, NO.

You see, to the network the VPC is a real computer, with it’s own IP address and everything. It’s just as vulnerable to attacks as any other computer. If not, you couldn’t use it for a Honeypot (see my previous posting). So protect your VPC!

You’ll then want to install any system updates, to patch any security holes. It doesn’t matter if you run Linux or Windows, there’s bound to be some patches for your system out there.

Some tips for running a virtual PC

Now that you are safe and secure, you can use your OS as you would any other OS. A few tips:

  • If you want to move your mouse out of the VPC window, hit the Right ALT key. (Note the left one won’t work, has to be the right one). This will let your mouse exit the VPC window.
  • Use Right ALT + ENTER to toggle between window and full screen mode.
  • Use Right ALT + Delete in place of CTRL+ALT+DELETE for your VPC.

Finally, when you are done you have several options to exit your VPC. First, you can shut down normally from within the OS. This is the least troublesome method, but as you are doing a shut down (then later a start up) it’s more time consuming.

You can also click the Red X (cancel button) on the window, or select Action, Close on the menu. A dialog appears asking if you want to Turn Off or Save State. Save State is similar to putting your system in to hibernate mode. It writes the system state to a file with a VSV extension (and the same file name as your VMC file). Later when you restart it restores your PC just like it was.

Well, usually. I’ve found that sometimes the network doesn’t always reconnect correctly after going into Save State mode, and sometimes I’ve had issues with Linux recovering. You’ll just have to experiment to see how it works for you.

Turn off dumps the PC, sort of like yanking the plug out of the wall. For this reason I suggest you only use this when the virtual environment is totally locked up and you have no other choice.

Wrap up

Well there you go, you’ve now got a spiffy new Virtual PC you can use and abuse. In the next post we’ll talk about tweaking your Virtual PC, and the various menu options for VPC.

Advertisements

Virtual Computer Software

So my last post got your appetite going. You’re ready to go setup some virtual computers, now all you need is the software to do it. Say no more! There are a lot of different packages on the market, but I’ll contrast a few of the most popular here.

Microsoft Virtual PC 2004

VPC (Virtual PC) is Microsoft’s offering to the virtual computer arena. Using it you can run not only other Windows systems but other operating systems such as Linux. For maximum usability, you’ll want to install the virtual machine additions. These additions will add some usability features, such as the ability to access the host OS’s hard drives.

Pros: Easy to configure and use. Small download, light on system resources. And it’s free!

Cons: No support for USB devices, can be a little slow especially if you have a borderline system. Only runs on Windows, no support for Linux as a host (although many Linux distros will work inside it). No support for SCSI drives.

Note that while USB support is not built in, your USB mouse and keyboard will work just fine as VPC will translate into something the virtual OS (Operating System) will understand. Also, if you have an external USB drive, if you share it through the virtual machine additions it will look like a network drive and work OK.

In addition to the resources below, there’s also a technical whitepaper available at http://www.microsoft.com/windows/virtualpc/evaluation/techoverview.mspx

Main page: http://www.microsoft.com/windows/virtualpc/default.mspx

Download site: http://www.microsoft.com/downloads/details.aspx?FamilyId=6D58729D-DFA8-40BF-AFAF-20BCB7F01CD1&displaylang=en

VMware Workstation

The VMware product is the granddaddy of virtualization. It is robust, and easily runs anything you throw at it. Similar to VPC it will run many types of desktop systems.

Pros: USB Support, easy to use. Has versions that will run under both Windows and Linux hosts.

Cons: Expensive, $189 US for the download version (a trial version is available). Must choose which host version (Linux vs Windows) you want when you buy.

Main page: http://www.VMware.com/

Download site: http://www.VMware.com/products/ws/

VMware Player

The VMware player is just what it says. It will run a virtual computer, but it cannot create one. So how would this be useful? Well, you could be in an environment where you local administrator has a copy of the VMware Workstation product, and creates your VM’s (Virtual Machines) for you. Then each developer just needs the player in order to be able to use it.

On the web, people have created images called “appliances”. These appliances are ready to run images for the VMware Player. Note that because of licensing issues, these appliances will all be based on open source OS’s such as Linux.

Finally, VMware Player will run images created by the Microsoft Virtual PC product. Thus you could create your image with VPC and run with the VM Player. Note though I’ve had mixed results with this. The Windows based appliances have worked OK, but the Linux Ubuntu appliance I created with VPC didn’t work correctly under VM Player.

Pros: Free, easy to use, get the robustness of VMware without the cost. Both Windows and Linux versions available.

Cons: Cannot create appliances (a.k.a. virtual computers), only run them

Main page: http://www.VMware.com/

Download site: http://www.VMware.com/products/player/

Virtual Appliances available at: http://www.vmware.com/vmtn/appliances/

Microsoft Virtual Server

While it’s sister product, VPC is optimized for running desktop environments, Microsoft Virtual Server is a product that is designed for running servers. While it can be used as a development environment, it can also be used in a production environment.

Enterprises are using Virtual Server to consolidate several physical servers onto a single large box. They are also using it to setup test environments when those test environments will be used for a limited amount of time.

While both VPC and Virtual Server will allow networking between virtual computers (and real ones), Virtual Servers will let you create an entire virtual network.

For more information on the differences between VPC and VServer, see the white paper on the Microsoft site at http://www.microsoft.com/windowsserversystem/virtualserver/techinfo/vsvsvpc.mspx

Pros: Free! Will run under XP or any Windows Server product. (Note that running on XP is only suggested for development, not production.)

Cons: No USB, No sound card support, limited graphics support. Can only run Windows Server products and Windows XP as virtual OS’s. Cannot run on Linux, only Windows.

Main page: http://www.microsoft.com/windowsserversystem/virtualserver/default.mspx

Download site: http://www.microsoft.com/windowsserversystem/virtualserver/software/default.mspx

VMware Server

VMware Server will let you create and run a variety of OS’s in a server environment. Has full support for USB, SCSI, and more. A very robust solution for the enterprise or for development.

Pros: Free, easy to use, all the robustness of VMware Workstation without the cost. Great support for Linux, both as host and guest.

Cons: Only runs on Windows Server or Linux hosts. Will not run with Windows XP as the host (although XP can run inside VMware Server as a guest).

Update: I have since learned the server version will run just fine on XP. Additionally, it will support USB and Audio, although not by default. You will need to click on the Add Hardware Drivers to add them to the Virtual OS. I’ve had issues though with Vista RC2 and USB crashing when you try to exit Vista, so I don’t suggest using USB with Vista RC2 at this time.

Main page: http://www.VMware.com/

Download site: http://www.vmware.com/products/server/

Licensing Issues

You should note that for each Virtual Machine you create, you will need a license for the operating system you install. For Linux it’s easy, since most distros are free. For Microsoft Windows however, you will need to purchase a license in some fashion.

Many of us work in enterprises that provide us with MSDN licenses. If so, your MDSN will give you licenses to each of the OS’s Microsoft has created. If not, you may wish to look into a Microsoft Action Pack subscription. The action pack gives you 10 XP licenses, 1 copy of most of their servers, plus 10 copies of Office. Check out https://partner.microsoft.com/global/40009735 for more info.

Danger Will Robinson…

I should warn you that running virtual computers can be very hardware intensive. 2 gig of ram is recommended, 1.5 gig is passable, 1 gig is a bare minimum.

In addition, you’ll need a lot of disk space. Remember each time you create a virtual computer you are duplicating an entire OS. The ideal situation is to have two physical hard disks. Place your host OS and software on one drive, all your virtual computers on the other drive.

Choices Choices Choices!

So you’ve read all of this, and all you really want to know is, which product should you use? Well, after experimenting with the various products above, here’s my humble take.

If you have some available funds, and are looking for a good environment to develop in, then the VMware Workstation is a good choice. It handles a lot of things like USB that it’s main competitor does not.

If you are looking to develop on a budget, or this is your first time in the virtual world, then I suggest Virtual PC. VPC is very easy to install, setup and use. Since it’s free, you have nothing to lose.

For the upcoming blog posts, I’ll be using Microsoft Virtual PC for my examples. Since it’s free, it will be easy for the vast majority of folks to follow along. So what are you waiting for? Go download it and let’s get going…