Welcome to MSDN Blogs Sign in | Join | Help

Virtual Machines Rock...

In case that wasn't obvious!  So why is Ben saying this today?  Well I have been setting up a personal domain environment for playing around in - and to be honest it is getting quite complex.  By now I have a domain controller, a file server, an iSCSI server, a SQL server (with SQL reporting), a MOM 2005 server and two desktop virtual machines.

Now if that wasn't good enough - all of these virtual machines are stored on my USB 2.0 disk and I have been able to move the entire environment between work and home. Even better than that - I have put the virtual network file (.VNC) on the USB disk as well and configured my home and work computers with loopback adapters configured the same way - so there is no reconfiguration.  I just shutdown the virtual machines, take my USB disk home, and start the virtual machines up again where I was.

Cool...

Cheers,
Ben

Running Virtual Server scripts on a computer without Virtual Server

A while ago I talked about how to run VBScripts that control Virtual Server on a remote computer.  Well recently I was asked how to do this if the computer running the scripts does not have Virtual Server installed either.  Normally this would fail – as the Virtual Server COM object will not be available on the computer running the scripts.

You can, however, work around this.  On the computer without Virtual Server – copy VSSRVC.EXE from the computer with Virtual Server (out of the Program Files\Microsoft Virtual Server directory) and run ‘VSSRVC.EXE –REGSERVER’.  After you have done this you can delete the copy of VSSRVC.EXE.  You know have the Virtual Server COM object registered on your computer and should be able to run VBScripts with no problems.

Cheers,
Ben

Repeating keys under Fedora and Red Hat Enterprise Linux

I recently ran into a case where I was seeing rapidly repeating keys under a Red Hat Enterprise Linux virtual machine.  I was also contact by one of the virtual machine MVPs who was seeing the same problem under Fedora.

After a bit of poking around it turned out that this was an extreme case of KB918461 (http://support.microsoft.com/?kbid=918461) "The system time runs too fast on a Linux-based virtual machine that is hosted in Virtual Server 2005 R2".

What is happening here is that the 2.6 kernel is using the TSC (time stamp counter) to provide a higher level of accuracy for time over just using the PIT (programmable interrupt timer).  The problem is that the TSC is highly unreliable inside of a virtual machine - and this results in all sorts of timing oddities.

The resolution proposed by this KB is to configure Linux to just use the PIT for timing - which solved my problem nicely.

Cheers,
Ben

System Center Virtual Machine Manager Beta 1 now available for download

A while ago I posted that the SCVMM Beta was accepting nominations - but now there are bits available to download!

To download the beta (if you are already registered):

  1. Go to http://connect.microsoft.com/vmm/downloads  
  2. Sign in with your Passport or Windows Live ID that you used to register for the Beta
  3. Download “VMM Beta 1”
  4. Please make sure you read the Getting Started with Virtual Machine Manager and Requirements for Deploying Virtual Machine Manager  before attempting to install VMM Beta 1, these documents include important information regarding your setup and can save you time.

Cheers,
Ben

Mortal Kombat II under Virtual PC

Ah the joys of computer game sequels.  Like most sequels, Mortal Kombat II was basically like Mortal Kombat - with a few tweaks and enhancements.  Mortal Kombat II has Shang Tsung, the bad guy mastermind from Mortal Kombat as one of the fighters - which is kind of fun.

The technical differences in Mortal Kombat II include a lot of graphical cleanup (the characters no longer look like cardboard cut outs on a computer generated background) and the addition of 'babalities' (where you turn your opponent into a baby) and 'friendships' (where rather than killing your opponent you spare their life).  Frankly I prefer the fatalities over these two.

Mortal Kombat II also added a number of arenas which you could interact with, and uppercut your opponent off the stage, or push them into spikes / acid / etc...

Mortal Kombat II under Virtual PC   Mortal Kombat II under Virtual PC   Mortal Kombat II under Virtual PC

All in all a lot of fun.  For more details checkout: http://en.wikipedia.org/wiki/Mortal_Kombat_II

Cheers,
Ben

Handy little VBScript to inspect virtual hard disks

I recently threw together this short script to allow me to see what size a virtual hard disk was created as, and how much space it is currently using:

'Connect to Virtual Server
Set virtualServer = CreateObject("VirtualServer.Application")

'Create a VHD object with the .VHD file specified on the command line
Set aVirtualHardDisk = virtualServer.GetHardDisk(WScript.Arguments(0))

GuestSize = clng(cdbl(aVirtualHardDisk.SizeInGuest) / 1048576)
HostSize = clng(cdbl(aVirtualHardDisk.SizeOnHost) / 1048576)

'Display information about the disk size
wscript.echo "The virtual hard disk, " & WScript.Arguments(0) & " is "&_
      GuestSize & " MB to the virtual machine.  It is using " & _
      HostSize & " MB space on the host operating system"

Note that the values returned by SizeInGuest and SizeOnHost are the size in bytes.  As such they need to be handled as doubles - and divided by 1048576 in order to get the size in megabytes.

Cheers,
Ben

Mortal Kombat under Virtual PC

This is a great game.  Mortal Kombat was one of the first arcade games where the best consumer port was to the PC (IMHO).  Mortal Kombat is one of the classic fighting games and introduced a number of new features.  First - Mortal Kombat used photographic images of real actors for their graphics (this added a level of realism, but it also looked a bit odd as it often looks like a badly cut out photograph laid on top of a computer generated background).  Mortal Kombat was also one of the first games to introduce the concept of 'juggling' - where you could score repeated blows to an opponent due to the fact that they would be momentarily stunned by the previous blow.

Mortal Kombat under Virtual PC   Mortal Kombat under Virtual PC   Mortal Kombat under Virtual PC

And of course - the thing that bought Mortal Kombat the greatest amount of attention was the concept of 'fatalities'.  This was a method where by - when your opponent was almost defeated, you could enter a special key combination and have your player gruesomely kill them (rather than just knocking them out).

Mortal Kombat had a great selection of characters with different moves, strengths and weaknesses (I loved this game).  It runs really well under Virtual PC - though the music is a bit off.  To read more about Mortal Kombat - checkout: http://en.wikipedia.org/wiki/Mortal_Kombat_%28arcade_game%29

Cheers,
Ben

Configuring DCOM for use with an external firewall

When Virtual Server is installed - the installer creates the following exceptions:

  • Port 135 for RPC
  • The port for the Virtual Server website (usually 1024)
  • Any ports opened by the Virtual Server service

When configuring Virtual Server behind an external firewall (software or hardware) you do not have the luxury of just opening ports 'used by the virtual Server service' - you need to know which ones to open.  The first one is fairly obvious - you will need to open port 5900 for VMRC.

In most situations this will be sufficient.  If, however, you are running remote scripts / programs that access the Virtual Server COM interfaces you will also need to open a port for DCOM.  Now, normally DCOM uses a random port above 1024.  Obviously this is a problem for an external firewall - but it is one that can be easily addressed.  This article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndcom/html/msdn_dcomfirewall.asp explains how to configure DCOM to be restricted to a defined range of ports - which you will then need to open on your firewall.

Cheers,
Ben

Hexen under Virtual PC

Okay, unlike my lackluster review of Heretic - Hexen (ala Heretic II) is a game that I quite like.  ID got the atmosphere spot on in this one - and added a number of cool features.  A couple of features that come to mind are: the ability (and requirement) to destroy parts of the scenery (you can't get more than 5 minutes into this game without having to smash some windows), a really nice inventory system and 3 different characters to choose from.

The characters provide a nice balance - you get to choose between strong and dumb, magically endowed and week or average strength and magic talent.  And the choice of character really does heavily influence your game strategy.

One of the things I find interesting about Hexen is that unlike earlier DOOM-like games - it has a very heavy focus on hand to hand combat (especially in the earlier levels) and this forces you to learn how to weave to dodge opponents blows and makes you think more about the battle (indeed - when, on occasion you find yourself behind an opponent who is looking the other way it is great to think 'Yes! I can take this guy out without getting any damage').  The game also makes good use of interesting inventory items - for example - you can get various vials of poisonous gas to drop in the path of oncoming enemies.

Hexen under Virtual PC   Hexen under Virtual PC   Hexen under Virtual PC

Hexen runs okay under Virtual PC - though the frame rate does drop in some complex areas.  You can find out more about Hexen here: http://www.idsoftware.com/games/vintage/hexen/

Cheers,
Ben

Setting the VMUndoAction under Virtual Server

To be honest, I did not know about this attribute until I stumbled across it just the other day.  Under Virtual PC, if the guest operating system shuts down and we have undo disks enabled - the user will get prompted as to whether they want to keep, commit or discard the undo disks.  Unfortunately with Virtual Server we cannot assume that the user will be present to answer a prompt - so we have to choose a default action.  Normally under Virtual Server we will always keep the undo disks - however - you can change this behavior if you want.

Each Virtual Server virtual machine has an attribute called 'UndoAction'.  This is normally set to '1' for 'keep', but it can also be set to '0' for 'discard' or '2' for 'commit'.

Below is a simple script that checks and sets a virtual machines UndoAction attribute.

Set objVS = CreateObject("VirtualServer.Application")
Set objVM = objVS.FindVirtualMachine("The name of the virtual machine")

WScript.Echo "VM Name: " & objVM.Name
WScript.Echo "Undo action: " & objVM.UndoAction

'Set the undo action to discard
objVM.UndoAction = 0

'Confirm that the settings change stuck
WScript.Echo "New Undo action: " & objVM.UndoAction

Cheers,
Ben

DOOM II under Virtual PC

DOOM II was released soon after the release of Heretic - and frankly I love this game.  DOOM II places you as the DOOM marine, having returned from your victory in the original DOOM only to find Earth overrun by demons.  DOOM II used the same engine as the original DOOM and had a relatively small number of changes:

  1. Completely new maps (obviously)
  2. Instead of having sections that you progress through there is just one long set of levels to fight through
  3. There are a whole bunch of new bad guys (lots of fun here)
  4. You have one new weapon, the double barreled shotgun

Now on the surface this does not seem like much - but DOOM was such a great game that the small amount of changes in DOOM II doesn't really matter - it is still a great game.  And I personally *love* the double barreled shotgun.  Sure it is just a standard shotgun with half the refire rate and double the damage - but it is so much fun to use.

DOOM II under Virtual PC   DOOM II under Virtual PC   DOOM II under Virtual PC

DOOM II runs great under Virtual PC.  You can find out more about DOOM II here: http://www.idsoftware.com/games/doom/doom2/ and here: http://en.wikipedia.org/wiki/Doom_II

Cheers,
Ben

New Virtual Machine Additions available for Windows Vista CTP releases

Yay! - We have new Virtual Machine Additions up for the Windows Vista CTP releases.  These new Additions (13.709) have performance optimizations for Windows Vista Beta 2 (Build 5384), Windows Vista Beta 2 June Refresh (Build 5465) and Windows Vista Beta 2 July Refresh (Build 5472).

You can download the Additions from the Virtual Server 2005 R2 SP1 Beta program at http://connect.microsoft.com.  And for Virtual PC users - do not worry - the Additions are available as a separate download on the beta program, so once you have signed up you can download just the Additions and use them with Virtual PC.

Cheers,
Ben

Virtual Server Vista Tip

In an earlier post about using Virtual Server on top of Vista - I mentioned that you needed to run Internet Explorer 'As Administrator' in order for the Virtual Server website to work.  The problem that you will hit is that the .URL that is used in the Virtual Server start menu cannot be started 'As Administrator'.  I have found that if I make a shortcut with the following command (one line):

"C:\Program Files\Internet Explorer\iexplore.exe" "http://localhost/VirtualServer/vswebapp.exe?view=1" 

It will work as a Virtual Server webpage shortcut and it can be started 'As Administrator'.  You can configure this shortcut to always run as administrator by selecting the advanced button under the shortcut tab and checking the option to 'Run as administrator'.

Cheers,
Ben

Heretic under Virtual PC

Released in 1994, Heretic took the DOOM engine, added a few new features and gave it a fantasy theme... And, well...  Frankly I never got into this game.  Cough...  I don't know why, I mean it seems nice enough and all - but just never excited me that much.

Heretic under Virtual PC   Heretic under Virtual PC   Heretic under Virtual PC

There are sooooo many things I just don't like about this game.  It is no where near as scary / immersive as DOOM.  The weapons frankly seem weak compared to the ones in DOOM.  It feels kind of cartoony (I mean the flying red guys look cute to me, not scary). Umm yeah...

Apparently a lot of people out there did like this game - and if you are one of them you will no doubt be glad to hear that Heretic runs quite well under Virtual PC.  You can read more (by people who clearly like this game) here: http://doom.wikia.com/wiki/Heretic

Cheers,
Ben

Changing VM screen resolution under Virtual Server

The other day I was asked (by a fellow Microsoft employee) how to change the resolution on a Virtual Server virtual machine.  The reason why he wanted to do this was so that he could put the stand alone VMRC client into full screen mode on his laptop (which runs at 1400 x 1050) and not have to deal with bad pixel scaling due to mismatched resolutions.

So I came up with this handy little script:

vmname = InputBox("Enter the virtual machine name to resize", _
   
      "Virtual machine name")
vmresx = InputBox("Enter the width of the display desired" + _
         " (must be between 640 and 1600 and divisible by 8)", _
         "Virtual display width")
vmresy = InputBox("Enter the height of the display desired" + _
         " (must be between 480 and 1200 and divisible by 8)", _
         "Virtual display height")

Set objVS = CreateObject("VirtualServer.Application")
set objVM = objVS.FindVirtualMachine(vmname)

objVM.Display.SetDimensions vmresx,vmresy

This will only work while the virtual machine is running, and if you are running a Windows virtual machine with Virtual Machine Additions installed - but it is quite handy for setting a custom, non-standard resolution (I have a couple of virtual machines configured to run at 800 x 800 now - just for giggles).

Cheers,
Ben

More Posts Next page »