One of the nicest features of using Dynamic VHDs on Virtual Server 2005 is that they grow as needed, so system administrators can optimize the disk space usage between several VMs. Dynamic VHDs grow automatically, but they don’t shrink automatically. In order to shrink them, you need to run several tools both inside and outside of the virtual machine.
Recently, I installed Windows Vista Beta 2 on a virtual machine on Virtual Server. Right after the installation, this are the disk usage stats:
Inside the virtual machine, however, the total disk space usage was smaller:
In order to compact the VHD image to only use the ~9GB allocated, we need to follow this procedure:
The first step is to defragment the VHD you are going to compact. You do this from within the Virtual Machine. Once the defragmentation is completed, you need to run Virtual Server’s Precompactor. To do this, mount the image on the virtual machine from the Virtual Server console:
The precompactor will then execute and leave the VHD ready for compaction:
If you are running the precompactor under Vista, remember to do a “Run as administrator”. Otherwise it won’t work.
This process may (will) take a long time, so be patient.
Once it completes, you need to shut down the virtual machine, and compact the VHD from the Virtual Server web console. This can be done from the option Virtual Disks->Inspect, then select the correct VHD on the Known virtual hard disks drop-down box, and click on the Inspect button. Then select the link to Compact Virtual Hard Disk:
You need to click on the Compact button on the next screen, and the process will then start. This will also take a while, but once it finished, you will reclaim all the hard drive space from your VHD file!
Yes, it is sad but true. You cannot install the Virtual Server 2005 Migration Toolkit on an x64 server:
What this means is that you need to have an intermediate 32–bit Windows 2003 installation running Virtual Server in order to convert a physical server to a virtual one. Hopefully x64 server will be soported in the near future.
Here is a post that talks about this: ADS 1.1 and VSMT on 64-bit hosts
Virtual PC 2004 Service Pack 1 is now offered as a free download. From the webpage:
Whether Microsoft virtualization technology is an important component of your existing infrastructure or you're just a Virtual PC enthusiast, you can now download Virtual PC 2004 Service Pack 1 absolutely free. Microsoft is also offering the free download of Virtual PC 2007, with support for Windows Vista in 2007.
Hopefully this will further increase the adoption of virtualization technology. I can’t wait for VPC2007 for it to support for hardware virtualization, like Virtual Server 2005.
Most you I guess have heard about Sysprep, Microsoft’s System Preparation Tool. This tool removes certain information from a system, including the Security Identifier, IP address, computer name, etc. This is recommended when you are cloning a machine, and, by removing this information, you also remove any potential conflicts when starting up the cloned image for the first time.
When working with Virtual Machines, Sysprep is a real timesaver. You can, on a virtual machine, install several configurations of servers (Win2003EE/SQLServer2005, Win2003EE/IIS6.0, etc), sysprep the images, and then have these pre-configured images ready to deploy to a Virtual Server 2005 installation when needed, by just copying the appropriate VHD file over and associating it with a new VM.
In order to run Sysprep, you first need to install it. You can get a hold of Sysprep in two ways: it is on the \Support\Tools\Deploy.cab file on the Windows Server installation media, or you can download it from here. Once you get a hold of the Deploy.cab file, you should extract the contents to a directory on your HD, for example c:\Deploy.
This directory contains several useful tools, and you should definitely read the deploy.chm file for instructions and details on the process. There are two files that are of particular importance to the process: sysprep.exe and setupmgr.exe.
For sysprep to work completely automated, it requires an answer file, called sysprep.inf. This answer file contains the “answers” to all the questions asked by the Windows installer during the setup process. The answer file can be created manually with any text editor, but fortunately there is a nice wizard-like tool that can help you generate this file. This tool is the setupmgr.exe program:
This program allows you to generate the sysprep.inf file by presenting you the options and letting you enter the default answer. In order to fully automate an installation, follow these steps on the Setup Manager:
- Click Next on the Welcome screen
- Select “Create new” and click “Next”
- Select “Sysprep setup” and click “Next”:
- Select the type of system you’re going to sysprep, and click “Next”
- Select “Yes, fully automate the installation” and click “Next”
- Now you need to fill in all the information required to complete the process:
Once you complete the execution of the Setup Manager, it creates a new directory in the root of the system drive called sysprep. This directory contains all the information necessary for the Sysprep tool to execute.
Now you need to execute the Sysprep tool, sysprep.exe:
In this tool:
- Click “OK” on the warning dialog that appears when running the tool.
- Select “Don’t reset grace period for activation”
- Set the “Shutdown mode” to “Shut down”
- Click on Reseal. That will leave the image ready for copying.
Once the image is copied, you can just configure a new virtual machine with the new image, and start it up. The last portion of the Windows setup process will execute:
After a little while (<10min), the machine will reboot, and the process will be completed. You now have a brand new sysprep’d and cloned server up and running!!
I just had my first “issue” with Virtual Server 2005 R2. I was trying to create a virtual network with access to the outside world, but I couldn’t get the physical NICs to appear under the "Network adapter on physical computer:" option on the "Network Properties" screen. I could only get the “None (Guests Only) option, as shown here:
Now, before anyone says anything, I know that in order to have them appear here, I first need to enable the "Virtual Machine Networking Service" on the NICs that I want to share. The service, however, was not showing up on the network properties on the NIC connected to the network:
On the Virtual Server Event log, I was getting the following error logged:
"Virtual Server could not open its emulated Ethernet switch driver. To fix this problem, re-enable the Virtual Server Emulated Ethernet Switch service on one or more Ethernet adapters or reinstall Virtual Server."
Before going for the obvious, I first did a quick scan of the net for that log message and for the error in general, and the recommendation I found on several forums was to re-enable the service (not possible, wasn’t appearing), or to reinstall the server. Well, it turns out that the solution was VERY, VERY easy: just re-installing the service on the adapter did the trick. To do this, follow these steps:
- Open the network connection properties page
- Click on the “Install…” button
- Select the “Service” option under the “Select Network Component Type” window, and click “Add…”
- Now you need to select the "Virtual Machine Networking Service" from the selection window:
- In case you don’t see this service on the window, you need to reinstall it. To do this, click no “Have Disk…”, then “Browse…”, and browse to the Virtual Server Installation directory\Drivers and select either the x86 OR x64 directory (depending on your installation):
- Then select the file “VMNetSrv.inf” to install the server:
- The service should now show up under the Network Connection properties:
For some reason, the service is not installed on the adapters by deafult. With this process, however, the error messages go away, and you should be able to select the adapter on the “Network Properties" screen without having to re-install Virtual Server.
… On Virtual Server 2005 R2.
I installed FreeDOS in a new VM in about 5 minutes to test out the installation and the management tools.
From now on, we are going to be working on several interesting projects related to virtualization, specifically to Virtual Server 2005 and the virtualization features coming up in Longhorn Server. I added a new category, Virtualization, where I’ll post any interesting bits of info I come accross. Make sure to check it out every once in a while.
We’ve been working during the past two years on 64–bit awareness and helping customers move to the platform. I posted some time ago, on the 64–bit Advantage blog, about the migration of MySpace to 64–bit Windows Servers. Well, I just noticed that there is another story out (has been out for a few months, actually) about the migration of microsoft.com to x64 servers. Pretty interesting read. Take a look at the performance improvements they saw – they were impressive, especially the improvement in the response time.
You can read check it out here.
During the Visual Basic webcasts we get several questions, not all of them related to VB migrations. Following the 64–bit webcast’s lead, I think it would be a good idea to share them with you (they were originally asked in spanish, this is my rough translation):
Question: What happens with VB6 applications that use Spread?
Answer: FarPoint's Spread is a widely-used spreadsheet component used in VB6 applications. The current version of the Upgrade Wizard does not support the automated conversion of this component to the .NET equivalent. If you wish to continue using it, you’ll need to use COM interop. There’s a chance that a future version of the VB Upgrade Companion Edition will be able to convert this component.
Question: Does the Upgrade Wizard work for upgrading ASP applications?
Answer: No, it doesn’t. For ASP applications, there is the ASP to ASP.NET Migration Assistant. You can also check out the ASP to ASP.NET v1.x Migration Guide. It is slightly outdated and doesn’t deal with the 2.0 Framework, but should work as a good starting point.
Artinsoft also offers complete migration services for upgrading your ASP application to ASP.NET.
Question: Is there a solution for migration from Visual Foxpro to .NET?
Answer: Unfortunately there is no tool for migrating Visual Foxpro applicationsto the .NET Framework.
Question: Is there a document with and outline of the testing process for migration projects?
Answer: The testing process depends on the type of application. There is no “magic bullet” that will describe this. There is, however, a migration guide, developed between ArtinSoft and Microsoft, that has a chapter on testing the applications. This can be found at Upgrading Visual Basic 6.0 Applications to Visual Basic .NET and Visual Basic 2005.
ArtinSoft also recomends using a slightly modified version of the original application’s test cases.
Question: What version of the .NET Framework is required for the migration tool?
Answer: The Upgrade Wizard is available for version 1.0, 1.1 and 2.0 of the .NET Framework. We are currently using the version bundled with Visual Studio .NET 2005, that uses version 2.0 of the Framework, because it is the most recent version.
Remember to check out all the VB to VB.NET presentations, that can be found at the CEM website.
Here are some pictures of the event last week in Santiago.
BTW, this is my first post with BlogJet. Nice tool.
Tomorrow I'll be doing the final Webcast in a series about migrating from Visual Basic 6.0 to Visual Basic .NET. This one will be about tecniques on how to migrate common objects in Visual Basic (some controls, database access, forms, etc), and about recommendations on how to test a migrated application.
All in all, there were seven webcasts in the series. They were: (names in spanish...)
I suggest you check them out. :-)