VHD Spec Available for Download

19. October 2006 12:24 by Jaguilar in General  //  Tags:   //   Comments (0)

The VHD format specification is now available for download. The specification contains all the technical details for reading/writing and modifying VHD images. This has a lot of potential, and can be used for things like backup, antivirus scans, image management, disk conversion, and others. The spec was released under Microsoft’s Open Specification Promise:

As of Tuesday, October 17th 2006, Microsoft is providing access to the VHD Image Format Specification Document as a part of the Open Specification Promise (OSP). The OSP provides broad use of Microsoft patented technology necessary to implement a list of covered specifications. The goal of the OSP is to provide our customers and partners with additional options for implementing interoperable solutions. Please reference the OSP Website for complete details.

Link to the Press Release: Microsoft Enhances Interoperability With Open Virtualization Format
Link to download page: Virtual Hard Disk Image Format Specification

Using vhdmount.exe under Windows 2003 Server R2

15. October 2006 11:18 by Jaguilar in General  //  Tags:   //   Comments (0)

When you try to mount a VHD using the vhdmount tool, you may get this error message:

C:\VMs>vhdmount.exe /m DISK.vhd

The VHD file is successfully plugged in as a virtual disk device. However, VHD mount was unable to mount all volumes on the disk. Use Disk Manager to mount the volumes.

The issue is that the drivers are not signed for WHQL, so you need to follow the same steps as detailed in this blog post to make it work (as in Windows XP). Another option, however, is to set the WHQL signing option is to Ignore. This can be done through Control Panel->System->Hardware->Driver Signing:

VHDMOUNT

Once you do this, you’ll be able to mount VHD files without any further errors.

HP and Intel Developer Workshops - Atlanta

12. October 2006 12:44 by Jaguilar in General  //  Tags:   //   Comments (0)

There’s going to be a new HP and Intel Developer Workshop in Atlanta in a couple of weeks, on Oct. 24–26. As with the previous workshops, we will do the classes for the 64–bit Windows track.

This is the last workshop for this year. That means that is the last oportunity this year to get this hands-on traning AND an Itanium machine!!

MSDN Webcast on moving from VB6 to VB.NET

11. October 2006 10:44 by Jaguilar in General  //  Tags: , ,   //   Comments (0)

My coworker Hendel Valverde will be presenting a webcast called Complete Methodology for Migrating Microsoft Visual Basic 6.0 to Visual Basic .NET, tomorrow at 1:00 PM Pacific. It covers all the steps necessary to prepare and perform migrations from VB to VB.NET, from what to look for during the analysis and planning stages to the final testing of the migrated application.

Link: MSDN Webcast: Complete Methodology for Migrating Microsoft Visual Basic 6.0 to Visual Basic .NET (Level 200)

And here’s the link to ArtinSoft’s press release: ArtinSoft and Microsoft Announce New Webcast on VB6 to .NET 2005 Migration Methodology.

 

Virtual PC 2007 Beta is out

11. October 2006 09:34 by Jaguilar in General  //  Tags:   //   Comments (0)

Virtual PC 2007 Beta is now available for download from http://connect.microsoft.com. As with other beta software, you need to register for the beta first.

This is a long overdue upgrade that finally supports hardware virtualization. It includes:

  • Hardware-assisted virtualization (both AMD and Intel)
  • Support for Vista both as host and guest OS
  • Support for 64–bit Hosts
  • Bug Fixes and Performance Enhacements

Multicore lab Thread Checker mystery error... solved!!

9. October 2006 04:08 by Jaguilar in General  //  Tags: ,   //   Comments (0)

Some of you may recall that on some events, we got an error message on Intel Thread Checker during the Multicore lab. No matter what we did, even if we solved all the concurrency issues related to our code, the Thread Checker would always log this message:

Write -> Read data-race Memory read at [PrimesInstrumented.exe, 0x2468] conflicts with a prior memory write at [PrimesInstrumented.exe, 0x16816] (flow dependence)

During the labs, we have said that we've been working out the solution with the Intel support people - and now we have an answer!!The thing is that you can work with Thread Checker in two ways:
  1. Use compiler based instrumentation. With this, you basically need to add the /Qtcheck flag to the compiler command line to instrument the binary. Once it is instrumented and you run it, it will create a file called "Threadchecker.thr", that you can then load in the VTune Thread Checker. To do this, you need to use the following command lines: (using the primes example from the lab)

    icl /c /Zi primes.cpp /Qopenmp /Qtcheck /Od
    link primes.obj /out:PrimesInstrumented.exe /fixed:no /DEBUG


  2. Use Thread Checker to intrument the application. In this scenario, you don't intrument the binary at compile time, but have Thread Checker intrument it when running the application. For this, you need to build the application with the following command lines:

    icl /c /Zi primes.cpp /Qopenmp /MD /Od
    link primes.obj /out:PrimesInstrumented.exe /fixed:no /DEBUG


    And then load it in Thread Checker.

The error we were doing on the lab is that we were using both compiler and "Thread Checker" instrumentation, and that caused Thread Checker to report conflicts that are outside of the program and in the runtime libraries. Now, using either option (BUT not both at the same time) the strange error is gone!

Thanks to Vasanth Tovinkere at Intel who really helped us out with this problem!!

BTW, this is repeating an old blog post I did for the 64–bit Advantage Blog. The post was deleted for some reason. Since I consider this information to be important, I am re-posting it here.

OpenMP on Visual Studio

5. October 2006 08:57 by Jaguilar in General  //  Tags: ,   //   Comments (0)

You can create C++ application in Visual Studio that use OpenMP. When you run an application created with OpenMP and VS.NET, however, you may get this annoying error message: “This application has failed to start because vcompd.dll was not found. Re-installing the application may fix this problem.”:

omp-error

When we tried this, we were puzzled by this error message, especially since it works with the Intel Compiler flawlessly. Well, it turns out that you need to include omp.h in your files ALWAYS when you use OpenMP from Visual Studio. This is not required on other compilers if you’re only using the OpenMP pragmas, but it is an issue with Visual Studio.

Thanks to Kang Su for pointing this out in his blog – I was going crazy trying to figure out what was wrong.

Also remember to enable OpenMP support in the C++ Project properties. This setting is in Configuration Properties->C/C++->Language->OpenMP Support.

OpenMP is your friend

4. October 2006 08:42 by Jaguilar in General  //  Tags: ,   //   Comments (0)

OpenMP is very easy-to use API that you can use to very rapidly add multi-threading to your C/C++ applications. OpenMP allows you to parallelize the execution of a region of code by just adding a few pragmas to the code. For example, take this code:

   for(int i = 0;i<=100;i++){
       a[i] = a[i]*10;
       ...
   }

The code above performs a for loop sequentially. Since each iteration could be executed independently, we can easily add multi-threading to the application by adding these simple pragmas:

#pragma omp parallel for
   for(int i = 0;i<=100;i++){
       a[i] = a[i]*10;
       ...
   }

The omp pragmas tell the compiler to generate code to parallelize the execution of the for loop. That means that if you run this code on a 4 core machine, it will create 4 threads, and each one will execute 25 iterations of the loop. Just by adding those pragmas, you now have a multi-threaded application that takes advantage of multi-core systems.

Yes, it's that simple.

Sysprep on Windows XP

26. September 2006 12:31 by Jaguilar in General  //  Tags: ,   //   Comments (0)

A while back I documented the process for doing a Sysprep on a Windows 2003 installation. Well, that same process works for a Windows XP installation. The sysprep GUI on Windows XP is slightly different, but you only need to make sure that the “MiniSetup” and “Pre-Activate” options are selected before pressing the Reseal button and shutting down the machine.

Here are the instructions to run Sysprep on Windows 2003.

Video demos

8. September 2006 15:28 by Jaguilar in General  //  Tags: , ,   //   Comments (0)
We just posted the last of three video demonstrations that I recorded. They are for the Informix 4GL to Java migration tool, JLCA Companion and the VB Upgrade Companion Enterprise Edition Demo. The videos outline the main points of each tool, how they work, and also contain a quick demonstration of a migration of a small application. You can check them on the Demos section of the downloads page.

Visual Studio unattended install

4. September 2006 14:55 by Jaguilar in General  //  Tags:   //   Comments (0)

If you ever do a Visual Studio .NET 2005 unattended install, you’ll notice that the installation reboots the machine several times and won’t continue until you log back in – defeating in part the purpose of the UNATTENDED install.

Well, this page over at Aaron Stebner's WebLog has some instructions that can help you make your installation REALLY unattended. It requires two things: first, remove some pre-requisites that end up on the vs_2005.ini files regardless of what you do (instructions here), and second, create a batch file that installs both the prerequisites and VS.NET. This is the code in the batch file for the unattended install on x64 boxes (run it from the VS dir):

wcu\msi31\WindowsInstaller-KB893803-v2-x86.exe /quiet /norestart
wcu\dotNetFramework\x64\netfx64.exe /q:a /c:"install.exe /q"
wcu\DExplore\DExplore.exe /q:a /c:"install.exe /q"
setup\setup.exe /unattendfile vs_2005.ini

For other machines, you may need to change the architecture of the .NET framework for the correct one (x86/x64). I made that batch file for an unattended install a few months ago at a 64–bit event where I had to install Visual Studio in around 30 machines, and it worked like a charm. YMMV

Excellent tip... Mounting a .VHD by double clicking on it

4. September 2006 04:29 by Jaguilar in General  //  Tags:   //   Comments (0)

Last Friday on the Virtual PC Guy's WebLog,  Ben Armstrong, Virtual Machine program manager at Microsoft, posted a registry code snippet to mount vhd files by double clicking on them, and dismount them by using the right-click menu. You can get the code from here. I also recommend that you check out VPC guy’s blog every once in a while – his posts are always useful and interesting.

Vista RC1 Completed

1. September 2006 13:09 by Jaguilar in General  //  Tags: ,   //   Comments (0)

Windows Vista RC1 was completed today. From the Windows Vista Team Blog:

It’s official — Windows Vista RC1 is done!
...
You’ll notice a lot of improvements since Beta 2. We’ve made some UI adjustments, added more device drivers, and enhanced performance. We’re not done yet, however — quality will continue to improve. We’ll keep plugging away on application compatibility, as well as fit and finish, until RTM. If you are an ISV, RC1 is the build you should use for certifying your application.

Right now it is only available for customers on the TAP program, but according to a post in the forum, they plan to make it available to MSDN and Technet subscribers.

Volume Shadow Copy Service and Virtual Server ... what's in it for me?

31. August 2006 12:01 by Jaguilar in General  //  Tags:   //   Comments (0)

One of the features available in the latest Beta of Virtual Server 2005 R2 SP1 is the support for the Volume Shadow Copy Service (VSS). VSS is a feature of Windows 2003 server that takes “snaphots” of files, and allows you to quickly create a backup copy of a volume.

For an application to support VSS, it needs to get to a consistent state, freeze, and the perform the shadow copy. Once the shadow copy is created, the application thaws and resumes operations. If an application does not have a VSS provider, VSS cannot guarantee that the resulting shadow copy will be consistent. That is one of the best features of this technology – the actual applications (called “Writers” in VSS-speak) are involved in the creation of the shadow copy, so they can verify that whatever goes into the copy can be later restored without any problems.

By supporting VSS, backup programs (“Requestors”) can now tell Virtual Server that a backup is going to take place. Virtual Server can then make sure that the Virtual Machines are in a consistent state (I”m not sure if it suspends the VMs – I’m currently in the process of finding out that information), and tell the requestor that it is ready for the copy. According to the documentation, creating a shadow copy is very fast – for large volumes I’ve heard numbers of around 30 seconds to 4 minutes. This can also work for quickly cloning a Virtual Server host to another server, so that VMs can resume operations very quickly even if the system goes down.

Virtual Server 2005 R2 SP1 BETA2 is out

30. August 2006 22:00 by Jaguilar in General  //  Tags:   //   Comments (0)

You can now download Virtual Server 2005 R2 SP1 BETA2 from http://connect.microsoft.com. As with other beta software, you need to register for the beta first.

This release is pretty significant because it is the first version to support both AMD-V and Intel-VT hardware virtualization. From the release notes, it includes:

  • AMD Virtualization (AMD-V) compatibility
  • Intel Virtualization Technology (IVT) compatibility
  • Volume Shadow Copy Service support
  • Offline VHD mounting
  • Active Directory integration using service connection points
  • Host Clustering technical white paper

The best part is that you can upgrade existing installations very easily:

VSUPGRADE

I just upgraded my 32–bit workstation, and everything is working like a charm.

Documentation on Best practices for Virtual Server

29. August 2006 11:48 by Jaguilar in General  //  Tags:   //   Comments (0)

When you make a Virtual Server deployment, make sure that you follow Microsoft’s recommended Best practices for Virtual Server. They can improve the performance of Virtual Server installations, and make your life as a system administrator easier.

One important thing that many people overlook when creating multiple VMs is the importance of using Sysprep. I wrote a quick walkthrough here, and you can find documentation on Microsoft’s website about it as well. Sysprep makes sure that each cloned virtual machine will be unique – not using it may introduce security and performance issues in your network.

Reading Virtual Server's performance counters from .NET

29. August 2006 01:55 by Jaguilar in General  //  Tags:   //   Comments (0)

This code allows you to retrieve the information for Virtual Server’s performance counters from C#. It reads both the Virtual Machines and Virtual Processors counters.

 

   1:  PerformanceCounterCategory vmCat =
new PerformanceCounterCategory("Virtual Machines");
   2:              PerformanceCounterCategory vpCat = 
new PerformanceCounterCategory("Virtual Processors");
   3:  string[] vmInstances = vmCat.GetInstanceNames();
   4:  string[] vpInstances = vpCat.GetInstanceNames();
   5:   
   6:  List<PerformanceCounter> countersList = 
new List<PerformanceCounter>();
   7:  
   8:  foreach (string instance in vmInstances){
   9:  PerformanceCounter[] counters =
vmCat.GetCounters(instance);
  10:  foreach (PerformanceCounter pc in counters)
  11:  {
  12:              countersList.Add(pc);
  13:  }
  14:  
  15:  foreach (string instance in vpInstances)
  16:  {
  17:              PerformanceCounter[] counters =
vpCat.GetCounters(instance);
  18:              foreach (PerformanceCounter pc in counters)
  19:              {
  20:                          countersList.Add(pc);
  21:              }
  22:  }
  23:   
  24:  while (true)
  25:  {
  26:              System.Threading.Thread.Sleep(1000);
  27:              foreach (PerformanceCounter pc in countersList)
  28:              {
  29:                          Console.WriteLine(
                                  "{0}:\"{1}\" Counter:{2} Value:{3}",
                                  pc.CategoryName, pc.InstanceName,
                                  pc.CounterName, pc.NextValue());
  30:              }
  31:  }

Paravirtualization and Xen

25. August 2006 03:57 by Jaguilar in General  //  Tags:   //   Comments (0)

Another virtual machine product that has been making a lot of noise lately is Xen, the open source project from Xensource. Xen uses a different  approach to virtualization than Virtual Server, called Paravirtualization. In this type of virtualization, the guest OS has to be modified to work with a software interface to the Virtual Machine Monitor, instead of thinking it is running on the hardware. The thing is that this actually enables better performance of the Guest OS, as it aware that is running on a virtual machine environment. Xen also supports running unmodified OSes, but for that it is mandatory to have hardware virtualization (VT-x on Intel or SVM on AMD CPUs).

The next releases of Windows Virtualization are implementing a similar approach. It will still be pure virtualization, but the Guest OS will also be enlightened. What this means is that the Guest OS will be aware that it is running on a VM, so it will be able to increase the performance using a modified kernel. The best part about all this is that Microsoft and Xensource are actually working together to make sure that the technology included with Windows Virtualization will be compatible with the technology used in Xen. So, at the end, we, the customers, win.

Live Writer sample post

15. August 2006 06:44 by Jaguilar in General  //  Tags: ,   //   Comments (0)

The Windows Live team recently launched the Live Writer tool for writing blog posts. This is a sample post made with the tool. So far, it looks nice, with most features already working.

One of the nicest features is Live Map integration:


San Jose, Costa Rica

I think I am going to stick with Blogjet for the time being (especially for the flickr integration). But it won't harm you to check out Live Writer as well.

Virtual Server, WMI and C#

11. August 2006 00:18 by Jaguilar in General  //  Tags:   //   Comments (0)

This code snippet allows you to connect to a remote instance of Virtual Server 2005 R2, via WMI, and retrieve all the Virtual Machine WMI objects.

   1:   
   2:  System.Management.ConnectionOptions co = 
   3:      new System.Management.ConnectionOptions();
   4:  co.Username = user;
   5:  co.Password = password;
   6:   
   7:  ManagementScope scope = new ManagementScope(
   8:      new ManagementPath(@"\\"+computer+
            @"\root\vm\virtualserver"),co);
   9:   
  10:  scope.Connect();
  11:  SelectQuery oq = 
  12:      new SelectQuery("SELECT * FROM VirtualMachine");
  13:   
  14:  ManagementObjectSearcher searcher =
  15:      new ManagementObjectSearcher(scope, oq);
  16:   
  17:  foreach (ManagementObject queryObj in searcher.Get())
  18:  {
  19:       //Do something
  20:  }
 

You need to provide a user and password with enough credentials to query the Virtual Server instance.
BTW, if you ever need to format your code for display on the web, check out this website.

Categories