Welcome to MSDN Blogs Sign in | Join | Help

Linux is now supported under Virtual Server

Hey hey! We are now 'supporting' Linux under Virtual Server (most of you will know that we have always been able to run Linux - but now we are officially supporting it, which means that we are testing Linux, fixing bugs and accepting customer support calls with Linux virtual machines).

Microsoft is officially supporting the following distributions:

 Red Hat Enterprise Linux 2.1 (update 6)
 Red Hat Enterprise Linux 3 (update 6)
 Red Hat Enterprise Linux 4
 Novell’s SuSE Linux Enterprise Server 9
 Red Hat Linux 7.3
 Red Hat Linux 9.0
 Novell’s SuSE Linux 9.2
 Novell’s SuSE Linux 9.3
 Novell’s SuSE Linux 10.0

Also - Virtual Machine Additions for Linux are now available for download from http://www.microsoft.com/virtualserver.  These additions provide support for:

  • Improved video
  • Integrated mouse pointer
  • Time synchronization
  • Shutdown integration
  • Heartbeat reporting
  • Accelerated SCSI driver

Note - it is possible to install these additions under Virtual PC - but that is neither officially tested nor supported (and that is all I can say about that :-).

Cheers,
Ben

Paratrooper under Virtual PC

Ah...  The one, the original Paratrooper.  There are many times when you fall in love with a game - only to find out that it is a clone of a more revered.  Thankfully - in the case of Paratrooper - this was the first version of this style of game that I came across.  Originally released in 1982 (in all of its four color, CGA glory) this game runs surprisingly well under Virtual PC:

Paratrooper under Virtual PC   Paratrooper under Virtual PC   Paratrooper under Virtual PC   Paratrooper under Virtual PC

In fact - it is preferable to run under Virtual PC - because (as I remembered) this game does not provide anyway to exit other than to reset your computer (or virtual machine).  You can download this game from: http://www.dosgames.com/files/ptrooper.zip

Cheers,
Ben

Converting Virtual Hard Disks programmatically

Normally when people ask me for a specific VBScript, I just do a web search and point them to the most promising looking result.  The other day I was asked for a script to convert a dynamic virtual hard disk to a fixed size virtual hard disk - and was surprised to find that no one had already published one.  So for the sake of posterity:

set vsApp = CreateObject("VirtualServer.Application","localhost")

TargetVHDpath =Inputbox("Enter path and name of VHD to convert:")
FixedVHDpath =Inputbox("Enter path and name of VHD to create")

set target = vsApp.GetHardDisk(TargetVHDpath)

set convertTask = target.convert(FixedVHDpath,1)

while not convertTask.isComplete
   wscript.echo "Conversion is " & convertTask.PercentCompleted & "% complete"
   WScript.Sleep 2000
wend

wscript.echo
wscript.echo "Conversion complete"

Two things to note:

  1. Like all of my VBScripts I am assuming that you use CSCRIPT.EXE to run your scripts.  If you use WSCRIPT you should pull out the line that shows percentage completion - as this will be just annoying.

  2. This script converts a dynamic disk to a fixed disk.  If you wanted to go the other way around - you just need to change the '1' to a '0' in the .convert() call.

Cheers,
Ben

Rescue Rover under Virtual PC

Rescue Rover is a simple little game - where you play the role of a boy who seems doomed to have his pet dog ('Rover') stolen by evil robots, over and over and over.  Indeed each level begins with the poor puppy being taken away - and then you need to explore the level and figure out how to foil the robots and retrieve your pet.  While the story is odd (to say the least) the game play is quite fun:

Rescue Rover under Virtual PC   Rescue Rover under Virtual PC   Rescue Rover under Virtual PC   Rescue Rover under Virtual PC

Rescue Rover is playable under Virtual PC - but there is an issue that causes vertical scrolling to be quite chunky (this is annoying - but it does not make the game unplayable).  If you want to try this game out for yourself you can download it from: http://www.dosgames.com/files/rrover.zip

Cheers,
Ben

Problems with virtual machines and domain membership

Every now and then some one will contact me for help, saying "I have a virtual machine that was working just fine - and now it refuses to log into the domain to which it is joined".  Assuming that networking is working fine (and sometimes this is caused by someone fiddling with their network settings and not realizing the consequences :-) this is usually caused by the fact that the domain controllers no longer trust your virtual machine.  There can be two reasons for this to happen:

  1. Your virtual machine has not logged into the domain in quite a while.

    All Active Directory domains have a 'time out' value - where if a computer is not seen on the network for a given period of time - its account is deleted (okay - tomb stoned - but I am not going to go into the details on that).  This usually happens after 90 days.  If this happens you will not be able to log into the domain.  Now - unlike with a physical computer - it is actually quite easy to go 90 days without logging into a virtual machine that you setup to test one specific thing.

  2. You 'undid' an account detail change.

    When a computer is joined to a domain - the domain controller creates and manages an account for that computer.  Now - for security purposes - details of this account are periodically updated by the domain controller and pushed down to the computer.  If this happens - and you then 'undo' the changes (by having undo disks enabled and choosing to delete them) then the domain controller will no longer trust your virtual machine.

In either situation the only solution is to login to your virtual machine using the local administrator account, leave the domain and then join it again.

Cheers,
Ben

Default virtual machine NumLock state

One of the problems that we faced when working on Virtual PC was whether to create virtual machines which had NumLock on by default, or off by default.  This may sound like a small issue - but people tend to have near religious preferences for the state of NumLock on their systems (e.g. I am a 'NumLock off' person - and my wife is a 'NumLock on' person.  We both get frustrated when we try to use the other persons computer and find that the NumLock state is not what we expected).

With Virtual PC - the way we handle this is we check the state of the NumLock key when you power on a virtual machine for the first time ever - and set that as the default for the virtual machine.  If you want to change this value for a given virtual machine - you should hit 'Del' to get into the virtual machine BIOS while booting, and then go to the 'Boot Settings Configuration' section of the 'Advanced' settings page.

Cheers,
Ben

Prince of Persia 2 under Virtual PC

Prince of Persia 2 - while similar to Prince of Persia the original - has some significant differences.  In the original Prince of Persia you had been thrown in prison - and as a result spent much of your time skulking around.  In Prince of Persia 2 you have come into the royal court - only to find a usurper pretending to be you.  This means that much more of Prince of Persia 2 is spent fighting people - and there is much more variety in backdrops (in the original Prince of Persia 99% of the game was spent in very dreary and familiar looking dungeons).  Just like the original game – you have unlimited lives – but a limited amount of time.

Prince of Persia 2 runs well under Virtual PC:

Prince of Persia 2 under Virtual PC   Prince of Persia 2 under Virtual PC   Prince of Persia 2 under Virtual PC   Prince of Persia 2 under Virtual PC

However there is a bug with digital sound that causes the entire game to freeze.  To avoid this you should configure the game to use Adlib or PC Speaker for the sound effects.  You can download a playable demo of Prince of Persia 2 from here: http://www.dosgames.com/files/pop2demo.zip

Note - this demo does not have a configuration option to disable digital effects, so you will need to delete or rename 'digi.drv' in order to play it.

Cheers,
Ben

Looking at Tasks under Virtual Server

Whenever Virtual Server has a task to complete (like merging a hard disk) that may take a while - it creates a task object.  You have probably seen these used in some of my scripts when I want to wait for a task to complete before moving onto the next step.  These task objects are really quite useful - and expose some interesting information.

The script below will retrieve all active task object from a Virtual Server instance - and then display the Task ID, description and percentage completion:

Set vs = CreateObject("VirtualServer.Application")

Set tasks = vs.Tasks
If tasks.Count = 0 Then
    Wscript.Echo "There are no tasks"
Else
    Wscript.Echo "Active tasks: "
    For Each task in tasks
        Wscript.Echo "    Task: " & task.ID & " : " & task.Description & " : " & task.PercentCompleted
    Next
End If

Cheers,
Ben

Prince of Persia under Virtual PC

Prince of Persia is one of those classic original games.  In Prince of Persia you find yourself (the Prince) unjustly thrown into prison - with only one hour to try and save the Princess.  The interesting thing about this game is that while you have unlimited lives - you only have one hour (wall time) to try and save the Princess.  Also - as you have been thrown into the dungeon with no weapons you will spend a lot of time skulking around trying to get out of prison without being noticed.

Prince of Persia runs perfectly under Virtual PC:

Prince of Persia under Virtual PC   Prince of Persia under Virtual PC   Prince of Persia under Virtual PC   Prince of Persia under Virtual PC

If you want to know more about Prince of Persia - I recommend that you checkout this: http://en.wikipedia.org/wiki/Prince_Of_Persia

Cheers,
Ben

Network Load Balancing (NLB) and virtual machines

There is a fair amount of confusion about the state of using Windows network load balancing (NLB) when it comes to Microsoft virtual machines.  Today I am (hopefully) going to set the record straight.  When using NLB with Microsoft virtual machines you need to be aware of the following issues:

  1. Virtual Server / Virtual PC will not utilize any NLB capabilities on the host operating system.  This is because Virtual Server / Virtual PC perform their network operations at a lower layer on the host network stack than NLB.  Note - Virtual Server and Virtual PC will function correctly when NLB is present on the host - they will just not benefit from it.

  2. Virtual Server / Virtual PC have some network optimizations that actually cause problems when running NLB systems inside of virtual machines.  These optimizations are simply that if we see a network packet that is going from the host to a virtual machine, or from a virtual machine to another virtual machine, we will send the packet directly to that virtual machine - without sending a copy of it on to the physical network connection.  Similarly if we see a network packet coming into the physical computer that is destined for the host operating system - we will not send it on to any of the virtual machines.

    Now - these optimizations cause problems with NLB because NLB creates its own virtual MAC address that is shared amongst all the NLB servers - which means that we cannot tell when a packet should go just to the host, a virtual machine or everyone.  Because of this we see the following results:

    1. NLB works with virtual machines - if everything (client and NLB servers) is on separate host systems.  It also works if some systems are physical computers, and some virtual machines - as long as each server / client is on a separate computer.

    2. NLB works when all the NLB servers are virtualized and placed on the same physical computer.  Obviously this is only useful for non-production environments.

    3. Any other configuration will fail (e.g. having a virtualized client hosted on a physical NLB server node, having a virtualized client and virtualized NLB server node on one box, with other NLB server nodes on remote systems)

Cheers,
Ben

Optimizing Windows Vista under Virtual PC

As I have been running builds of Windows Vista inside of virtual machines for a while now - I thought I would pass along some guidance I have for getting the best performance possible.  Below are a couple of steps I advise taking:

  1. The more memory you can assign to the virtual machine - the better.  Though make sure you leave enough memory for the host operating system.

  2. Install the Virtual Machine Additions that come with Virtual Server 2005 R2 - these make a world of difference.

  3. Turn off most of the advanced video animation.  You can do this by going to:
    1. 'Start menu'
    2. --> right click 'Computer'
    3. --> 'Properties'
    4. --> 'Advanced System Settings'
    5. --> hit the 'Settings' button under the 'Performance' section
    6. --> Uncheck everything except 'Smooth edges of screen fonts', 'Use drop shadows for icon labels on the desktop' and 'Use visual styles on windows and buttons' and then hit 'OK'

  4. While you have the Advanced System Settings open - go to the 'System Protection' tab and disable this feature (you can use undo disks to get the same level of protection)

  5. Stop explorer from searching the network at odd times by going to:
    1. 'Start menu'
    2. --> left click 'Computer'
    3. --> select the 'Tools' menu
    4. --> 'Folder Options'
    5. --> select the 'View' tab
    6. --> Uncheck 'Automatically search for network printers'

  6. Finally - if you are using Virtual Server - do not use a desktop background

With all of these changes I have found Vista to be quite snappy inside of a virtual machine.  In fact I have taken to running Visual Studio 2005 in a virtual machine to allow me to do quick UI mockups with the Vista 2D theme.

Cheers,
Ben

 

Carmageddon under Virtual PC

Ahh yes.  The infamous 'Carmageddon' - met by protests and legal challenges around the world.  This game places you in an urban car race, where you get awarded extra points for stunts, etc...  The real problem was that the game also rewards points for running over pedestrians (and even bonus points if you do so 'artistically').  I never actually played this game when it was released - but when I picked it up a few years later I did find it to be quite fun:

Carmageddon under Virtual PC   Carmageddon under Virtual PC   Carmageddon under Virtual PC   Carmageddon under Virtual PC

Some interesting things to know are that in the UK Carmageddon was changed subtly in order to appease the censors - they changed the blood from red to green and added a bit of text to the box saying that you were running over Zombies - which was just fine (apparently).  Also - this game is a regular test tool for Virtual PC - as it does some funky things with the FPU that are good to know are still working properly.

If you want to try it out for yourself you can grab the demo from here: http://www.3dgamers.com/dlselect/games/carmageddon/carma.zip.html

Cheers,
Ben

Scripting automatic startup for virtual machines under Virtual Server

Virtual Server allows you to configure virtual machines to startup automatically when the host system boots.  However in order to enable this feature you need to configure a user account to run the virtual machine under first (as when the host system boots there is no available user session to run the virtual machine under).  Below is a script that will configure a virtual machine to start automatically when the host system boots - if it was running when the host system shutdown:

Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("VM Name")
objVM.RunAsDefinedAccount = True
result = objVM.SetAccountNameAndPassword("DOMAIN\Username","Password")
objVM.AutoStartAtLaunch = 2

If you want the virtual machine to always start (whether it was running before or not) you should set AutoStartAtLaunch to 1.

Cheers,
Ben

Rise of the Triad under Virtual PC

Rise of the Triad was one of many 3D shooting games to come out soon after DOOM.  It has a number of nice features - including massive maps and a good range of weaponry.  Having said that - this game never really grabbed my attention too much - don't know why.  Rise of the Triad has the usual flimsy storyline background (you are the good guy, they are bad - so please kill them all) and uses photo-images of people for the bad guys (which reminds me of Mortal Kombat in many ways).  One interesting thing to know is that all the characters in the game are actually photo shots of Apogee employees - however this also means that there are a total of 11 people in the game (whom you kill over, and over, and over...)

The only problem with running Rise of the Triad under Virtual PC is that there appears to be a problem using our sound card for sound effects.  If you configure the Adlib or PC Speaker for sound effects instead it will work fine:

Rise of the Triad under Virtual PC   Rise of the Triad under Virtual PC   Rise of the Triad under Virtual PC   Rise of the Triad under Virtual PC

To tell the truth my one lasting memory of Rise of the Triad is from one day when I was death matching against a bunch of my friends in this game.  Most of the other guys were listening to the usual assortment of Metalica / Nine Inch Nails / etc...  Me - I was listening to 'The Greatest Hits of James Taylor' - and for some reason it really bugged them that I was listening to 'Gone to Carolina in my Mind' while shooting at them...

Anyway - if you want to try this out for yourself - you can grab a copy from here: http://www.3drealms.com/rott/index.html

Cheers,
Ben

Optimization levels under Virtual PC

On a running virtual machine (under Virtual PC) you can see the optimization level being used by selecting 'Properties' off of the 'Action' menu - and then going to the 'Advanced' tab.  There are three possible optimization levels:

  1. None: You should only ever see this if you are using the '-disableopt' command line option - and you would only ever want to do this for debugging purposes.

  2. User mode optimization enabled: This is the default mode of operation for virtual machines.  User mode code (or ring 3) is run directly on the processor - but kernel mode code (or ring 0) is handled inside of a binary translator.

  3. User and kernel mode optimizations: In this mode both user and kernel mode code is run directly on the processor.  This mode is only enabled on certain operating systems (windows NT, 2000, XP, 2003, Vista) once Virtual Machine Additions have been loaded.

Cheers,
Ben