ArtinSoft's Blogs

Software Migration Experts
Welcome to ArtinSoft's Blogs Sign in | Join | Help
in Search

Stephen Murillo Blog

Provided by ArtinSoft, a lead company on the development of migration solutions; this blog is dedicated to information technologies in general. I joined this company on July 2006 as a contractor and I work as a professional trainer on information technologies, mostly for Microsoft's virtualization solutions and ArtinSoft's migration technologies.

September 2006 - Posts

  • SCVMM Guest OS Profiles

    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

    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

    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)

    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

    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

    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?

    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!

Powered by Community Server (Non-Commercial Edition), by Telligent Systems