Offline Virtual Floppy Disks

22. January 2007 13:04 by smurillo in General  //  Tags:   //   Comments (0)

Virtual Server 2005 R2 SP1 Beta 2 includes VHD offline mounting, which can be very useful to read the contents of a virtual hard drive from the host, without having to load a virtual machine to do the job.

It might be useful from time to time for some people to have the same feature for Virtual Floppy Disks (.vfd) files. Just to give you an example, some tools depend on floppy disks to create backups that you may be interested on accessing from a physical machine.

This feature is not available with Virtual Server and it probably won't be (I don't think Microsoft would consider this a priority). But if you ever happen to need this, Ken Kato has created a Virtual Floppy Driver that you can use. It lets you view, edit, rename, delete or create files on a virtual floppy disk.

If you browse around the site you will also find a lot of VMWare tools that you might find useful.

Virtual Server scripts inside virtual machines

16. January 2007 05:38 by smurillo in General  //  Tags:   //   Comments (0)

If you are familiar with Virtual Server you know that you can use it to run scripts on the Host OS by attaching them to events, such as: turning on or off the Virtual Server service, or turning on or off a virtual machine.

But these scripts run on the host. What if you want to launch an application inside the guest OS?

Suppose you have a VBScript file called MyVBScript.vbs, and you want to run it inside the guest operating system of a virtual machine, or a bunch of them. You can create an ISO image that will contain an Autorun configuration that will execute this script. Once that's done, you can simply attach the ISO file to the virtual machine(s) where you want your script to run.

We will use the unauthorized ISO Recorder Power Toy to create the ISO file. ISO Recorder v2.0 works on Windows XP and Windows 2003. After you install this application you will be able to create ISO files out of folders in your filesystem.

  1. Create a new folder. Let's call it VMScript.
  2. Copy MyVBScript.vbs to the VMScript folder.
  3. Create a new file in the folder called Autorun.inf.
  4. Edit the Autorun.inf file and add the following lines:
  5. [autorun]
    open=wscript MyVBScript.vbs

  6. You can replace the text after "open=" if you want to execute a different command line, you can even launch an application with a UI.
  7. Save the Autorun.inf file.
  8. Right clik on the VMScript folder and select Create ISO image file.

  9. Follow the wizard steps and a new file called RemoteScript.iso will be created. This is the CD/DVD image that you can attach to the virtual machine where you want the script to run. When you do, unless the Autorun feature has been disabled, your script will launch in the guest OS.

This is the same technique that Microsoft uses to launch the VM Additions and the precompactor. Now you can exploit this and even create interesting combinations. For instance you can attach a script to an event in Virtual Server that will attach your ISO file to a virtual machine.


  • ISO Recorder is meant to be used for personal use, but it is used by a number of companies around the world. I have found no problems with it. Make sure you read the license agreement and documentation for this application.
  • AutoRun is normally enabled by default on Windows operating systems. For more information on this read CD AutoRun basics.
  • If you are not that familiar with Virtual Server and you don't know how to attach ISO files, manage removable media or attach scripts to Virtual Server, read the Virtual Server Administrator's Guide included in the installation package.

Acronis P2V/V2P

20. November 2006 16:32 by smurillo in General  //  Tags:   //   Comments (0)

There are news from Acronis on their "introduction" to the P2V scenario, and the quotes only mean that this is definitely not unexplored territory for them. Acronis True Image is a tool that helps you create a full backup of your hard disks. It is intended to be used for backup and recovery of your systems, but for years now, lots of IT administrators out there have found an alternative use for it, P2V. Although it wasn't meant to be used with this purpose specifically, it can certainly help do the trick.

P2V stands for Physical To Virtual conversion and the idea is that in order to explode part of the benefits of virtual machines, you must not only be able to create new VMs from scratch but also take your existing workloads and move them into a virtualized environment and back.

In the past if Acronis True Image was the weapon of choice for you to complete this task, then there are good news for you. Acronis has announced that a new product called Full Circle will be released this year, and although it holds all of the benefits for image cloning that you know and like, this product is specifically intended to fit your P2V needs, and as its name hints it, your V2P (virtual to physical) requirements as well. It supports both 32-bit and 64-bit x86 hardware, virtualization software from VMware, Microsoft, Xen, Parallels and SWSoft, and Windows and Linux guests, which makes it a very complete and universal proposal.

This product will be made available in December, no word on pricing yet. Read more about Acronis Full Circle here.

Seamless Remote Windows

17. November 2006 09:52 by smurillo in General  //  Tags:   //   Comments (0)

Making a remote desktop connection to a server just to run a single application is a very common situation. It is true you can configure a connection to log on automatically and even launch the desired application. For example you could specify the username, password and Notepad as the application to launch.


But once you connect you get the same old Remote Desktop Connection window with just Notepad inside, which is still disruptive. Imagine if you could see a remote window as if it was running locally, resize it, move it and close it just like a regular window.

This feature is included in RDP 6.0, but if you want to try it without upgrading your system first, then you can access this article on the Code Project website. For developers out there this is a great introduction to the Remote Desktop Protocol, and for those who are not interested on getting to understand the protocol, you can just download the application from the author Martin Wickett on 2005.

Sysprep User Profiles

10. November 2006 12:42 by smurillo in General  //  Tags:   //   Comments (0)

There are times when you would want to Sysprep a Windows image and get it ready to join a domain and start creating user profiles. But what if you want to control the configurations and contents of those future profiles?

Windows offers a location for a Default User Profile. It is a hidden folder normally located in %SystemDrive%\Documents And Settings\Default User. To create a default profile all you need to do is log in to the machine, make all the changes you need and then log off. Once you are done copy all the contents of your profile folder to the Default User folder. You will need to do this offline or by using another account.

Profiles folders contain a file called NTUSER.DAT, this file contains all the configurations that are located in the HKEY_CURRENT_USER registry entry when the respective user logs on.

In general all of this works for future profiles even if you are not using Sysprep. But when you do use Sysprep there is a particular case that is not contemplated here. When you set the machine to log in the first time using a particular user account, the contents of that local profile will be copied to the Default User Profile that first time. In those cases you should set the defaults using that account.

SCVMM Guest OS Profiles

27. September 2006 06:33 by smurillo in General  //  Tags:   //   Comments (0)

As you may know already System Center Virtual Machine Manager can be used to create virtual machine templates. Templates have three main elements: a VHD file to use as a base for the template, a hardware profile and a guest OS profile. If you are familiar with Virtual Server you will have no problem understanding the first two, but the guest OS profile will be news to you.

The guest OS profile contains Sysprep information. When you create a virtual machine based on a template it will copy the selected VHD to it, use the hardware profile you select, and sysprep the virtual machine using the guest OS profile. Clive Watson makes an introduction to Templates and Profiles in his blog, but I just wanted to clarify a couple of things you need to have in mind before trying to make this work.

When you create a virtual machine based on a template the creation process includes a few additional steps:

On step 3 a Sysprep Virtual Floppy Disk is created, and then on steps 8, 9 and 10, that disk is attached, the VM is started and the disk is released. By then the VM should have been started and Sysprep'd, after which it is just shut down and ready to go.

Two important things you should consider for this to work are:

  1. When SCVMM starts the VM it doesn't just move on to step 10, it waits for a heart-beat. That means the image you use needs to have VM Additions installed first. Therefore a blank VHD will never work for this.
  2. SCVMM will not really Sysprep the machine, it will simply use the Virtual Floppy Disk to enter the guest OS profile as the Sysprep data. This means that the VHD will have to be Sysprep'd first by the Administrator, and that it should be ready to run fully automated, so that the OS can start and so that the VM Additions can send a heart-beat back to SCVMM. Jose Aguilar explains how to fully automate sysprep on his blog.

If your VHD is not pre-sysprep'd the virtual machine will still be created, but the guest OS profile will simply be ignored. The VM Additions are completely necessary, otherwise the creation process will fail.

Automating windows

25. September 2006 10:22 by smurillo in General  //  Tags:   //   Comments (0)

Do you ever find yourself doing repetitive tasks on your computer? When you are a developer and this happens to you, the tendency is to start thinking about how you can automate that task and if it's worth the effort. You could immediately start thinking about WMI or API's, but there could probably be a simpler and quicker solution, macros.

I remember using the discontinued Macro Recorder on Windows 3.1 and thinking how useful it was. Recently I found myself taking lots of screenshots and adding borders to them using Paint Brush (I know there are lots of image editing tools that could easily do that for me). When I had done it a few times I started remembering the old macro recorder and I thought it couldn't have helped me much on this.

I started looking for modern alternatives and found AutoHotkey and what a long way we've come. It's not just a recorder, you can automate all sorts of stuff, interact with windows and controls, wait for events and automate tasks through hotkeys and hotstrings. Best of all, you work with text scripts that you can edit manually and even compile them into executable files.

Since I have been working on the virtualization scenario for a while now I also think about the impact this can have in terms of virtual machines. For example, perhaps you could add startup scripts that will install applications that could not be included in the image for licensing reasons.

SCVMM on Domain Controllers

19. September 2006 09:34 by smurillo in General  //  Tags:   //   Comments (0)

While I was playing with System Center Virtual Machine Manager Beta 1 I bumped into a problem when I tried to add a second host. Since the Virtual Server service won't even start on a VM, you can't use a VM as a host; you depend on physical equipment to test SCVMM properly.

We are working with limited resources and the only x64 host available happens to be a domain controller. The other available host is a 32-bit computer, the one we are using to run SCVMM, which we are also using as a host. While trying to add the host we got the following error:

"Error (406) Access denied while contacting the virtual machine host x64svr0x.virtua"

At first we thought it would be a domain configuration problem, it wouldn't be terribly unusual. But everything else was working just fine so we started thinking about other theories. This is very normal for beta versions of a product.

After getting some help from the nice people at Microsoft, I can tell you that if you are having this problem and you are thinking of theories too, you should know that installing either SCVMM or host agent on a DC is not supported in beta1. Keep that in mind if you are testing SCVMM.

Expert's tips on SCVMM (Carmine)

11. September 2006 09:46 by smurillo in General  //  Tags:   //   Comments (0)

Clive Watson has been testing the new System Center Virtual Machine Manager Beta 1 and he has posted some articles about it on his Weblog. All of these parts together end up being a very nice user guide for this version of SCVMM:

Part 1: Introduction
Part 2: Host Groups and Self-Service policies
Part 3: Views for Hosts and Virtual Machines
Part 4: Adding a new Host
Part 5: Filtering views
Part 6: Host’s Managed Properties
Part 7: PowerShell
Part 8: PowerShell (cont’d)
Part 9: How to create a Virtual Machine
Extra: Can you help the help?
Part 10: Remote control
Extra: Summary and Diagram
Part 11: Template and Profiles

Extra: SCVMM Self-Service FAQ update

Since this is a Beta 1 version there is not a lot of documentation for you to start playing with it. Clive Watson has done a very good job on this, it’s really helpful and it can lead to a better testing of the product.

Detecting Virtual Machines

11. September 2006 05:09 by smurillo in General  //  Tags:   //   Comments (0)

I was a firm believer in the fact that an application could not for sure detect that it was running on a Virtual Machine. I had thought of things like checking if the VM Additions were installed, or checking if the hardware devices in the system matched those used by Microsoft's Virtualization products, but I still thought these techniques could not be conclusive enough, not beyond ALL reasonable doubt.

Then I decided to look for solid ways to detect if an application is running on a Virtual Machine. This could be helpful for example, if you want to release a time-limited trial version of an application you are developing and you want to restrict it from running on a VM.

Turns out if you check the motherboard on a Microsoft VM you are going to find that it was made by Microsoft. Since Microsoft doesn't really make motherboards (yet?), this is a clear indicator that you are in the presence of a VM. You can find a programmatic way to do this on Virtual PC Guy's Weblog. Of course if Microsoft decided in the future to start manufacturing motherboards your applications will refuse to work on some physical machines too :-)

I also found an interesting article on The Code Project website, that uses an exception method to detect a VM running on Virtual PC. And it also includes a technique for VMWare.

Turns out it is not impossible after all, there are plenty of ways you can find in the Web to detect when your application is running on a VM. Just be careful to choose one that is trust worthy and use it wisely.

Component Services and one of those weird small things

5. September 2006 04:46 by smurillo in General  //  Tags:   //   Comments (0)

While Jose was testing a Lab I have been working on, he found himself getting an error I wasn't expecting. The exercise requires for the user to change the Default Impersonation Level on the computer where an application will access COM object using the Impersonate level. So, it is kind of simple, the exercise described how to access Component Services, go to the Computer's Properties and change the Default Impersonation Level; after which it should be sufficient to click on the OK button and suppose Component Services has made the change by then. Think again!

Well, what I can tell you is that at least in a Windows XP Professional Edition running on a Virtual Machine using Virtual Server 2005 R2, you get one of these errors that you would probably never notice, but if it came up, it could drive you insane. Component Services doesn't register the change until you do something else inside the Component Services windows, after you click on the OK button; anything at all: click on an icon, navigate the tree, close the application, whatever you want, but you will need to do something that triggers an event. Once you do that, you are good to go.

What's good about VHD Mounting?

4. September 2006 03:48 by smurillo in General  //  Tags:   //   Comments (0)

Microsoft uses and supports their VHD (Virtual Hard Disk) format on their virtualization products: Virtual PC and Virtual Server. You can get full access to the detailed specification online by signing the Virtual Hard Disk Image Format Specification License Agreement.

As you may have heard, Virtual Server 2005 R2 SP1 BETA2 (quite a name) is out now (read Jose Aguilar's post on it for more details) and it includes Offline VHD mounting. This feature was already planned to be included in System Center Virtual Machine Manager, but it is sure nice to get it now with Virtual Server. So what is the big deal about this? What Offline Mounting does is, it lets you mount your VHD files as if they were real drives on your server and it lets you do all the reading and writing you want.

Before this very handy feature existed, if you wanted to copy some files from or to your VMs you would have had to create a virtual machine, link it to the VHD, run it, and use the Virtual Network to make the transaction between the server and the VM. With Offline Mounting this task becomes quite a lot easier and you can skip a few of those in between steps. You can access Brian A. Randell's blog for more details on how to do this.

In the end, Offline VHD Mounting is all very nice but some of you may have noticed it brings up a bigger possibility, Offline Patching. If you have a company and you want to cut expenses on your Disaster and Recovery Sites this is a topic that should really gain your attention. Microsoft is definitely using Offline VHD Mounting as a message that they are heading towards an Offline VM Patching solution (Microsoft has hinted about this on a few ocattions). Since Microsoft's Virtualization Licensing policies only charge for those VMs that are actually running, you can picture the economic impact this is going to have in the future, your Back-up sites will not even have to run unless a disaster does happen.

Offline VHD Mounting is not just a nice new feature that will help you speed things up, it is also Microsoft's announcement on what's to come!

Adding a duplicated computer to the domain

18. August 2006 11:47 by smurillo in General  //  Tags:   //   Comments (0)

We at the virtualization team, have been creating copies of a virtual machine to use them as workstations that will be grouped into a domain. The only problem is that the original virtual machine was not syspreped and apparently this is creating problems joining the domain; this can be seen when new users can not log in the new virtual machine.

One quick and easy way that we have found helpful to fix this is changing the name of the computer (to avoid the duplicated name) and moving it to a temporary workgroup at the same time (we couldn't get to rename otherwise). Then we just made the computer reboot, and then moved it back to the domain, and reboot again. After that, it worked just fine.

Let Your Script Choose It's Host

18. August 2006 06:50 by smurillo in General  //  Tags:   //   Comments (0)

When you are creating scripts to be executed by the Windows Scrip Host, you know there are two applications that could host your script: WScript which is a GUI host or CScript which is a console based host. By default Windows uses WScript, but you can change the default host with a simple command wscript //H:WScript will set WScript to be the default host, and wscript //H:CScript will set CScript to be the host.

But what happens if you don't want to get such an ultimatum for all of your scripts. Wouldn't it be nice if you could make your script choose it's own host? I asked my self that question and found this VBScript code online (I couldn't find the original source):

' Forces this script to be run under the desired scripting host.
' Valid sScriptEng arguments are "wscript" or "cscript".
' If you don't supply a valid name, Force will switch hosts.
Sub Force(sScriptEng)
 If Lcase(Right(Wscript.FullName, 12)) = "\wscript.exe" Then
  If Instr(1, Wscript.FullName, sScriptEng, 1) = 0 Then
   'Need to switch to CSCRIPT
   CreateObject("Wscript.Shell").Run "cscript.exe " & Chr(34) & Wscript.ScriptFullName & Chr(34)
  End If
  If Instr(1, Wscript.FullName, sScriptEng, 1) = 0 Then
   'Need to switch to WSCRIPT
   CreateObject("Wscript.Shell").Run "wscript.exe " & Wscript.ScriptFullName
  End If
 End If
End Sub

All you need to do is call this procedure at the beginning of your script and it will be ready to go. So, for example:

Force "cscript"

will force your script to run on the CScript host. A wrong parameter will just force the script to run on the opposite host.

Set your scripts free!

Remote Virtual Server Object

11. August 2006 05:53 by smurillo in General  //  Tags:   //   Comments (0)

We, here at the virtualization team, have been digging around and testing some of the development options you have for the automation of virtualized environments.

Developers might be waiting for that famous Microsoft Hypervisor that will be available with Windows Server "Longhorn". In the meantime, there are still tools you can use. The Virtual Server COM API is one of them.

You can instantiate this object on a local server where Virtual Server is up and running and you can then have access to its properties and procedures. But if you want to develop something a bit more dynamic you might be interested on creating a centralized management tool for a group of Virtual Servers. This can be accomplished by initializing the Virtual Server Object remotely. Learn more about this by accessing the Virtual Server Programmers Guide, included in your Virtual Server installation.

What I want to point out on this entry is that if you are planning to use the remote access, beware you are going to need your Virtual Server on the same domain where the application is running, or as a difficult alternative you can set up a trusted link. Also, the user executing the code must be added to the Administrator's group on the remote Virtual Server. Failing on doing this will lead to runtime security issues that will simply prevent the object from having access to the remote server.

Unlimited virtualization not only for Longhorn anymore

19. July 2006 09:55 by smurillo in General  //  Tags:   //   Comments (0)

Microsoft first announced on October 10, 2005 that Windows Server "Longhorn" Datacenter Edition would give customers the right to run an unlimited number of virtual instances on a physical server. At the same time they said that with a single license of Windows Server 2003 R2 Enterprise Edition, customers could now run up to four virtual instances. You can access the full press pass here.

That was a significantly good announcement for customers. Those who use Windows Server 2003 R2 Enterprise Edition would get to try the benefits of virtualization. If it became necessary to run more than four instances they could eventually give into temptation and look for an expansion by purchasing the Windows Server "Longhorn" Datacenter Edition. Good strategy!

On July 12, Microsoft decided to improve this offer and shock the customers a bit more, and then some more. Starting October 1, 2006, new servers licensed with Windows Server Datacenter Edition would be entitled to run an unlimited number of virtualized Windows Server instances, including Standard, Enterprise and Datacenter Editions. Multiply them and mix them up as you wish.

This is not the only change made by Microsoft in order to promote their Windows Server Datacenter Editions. Want to know what else they did? Read the full announcement here.