Virtual PC Guy's Blog

-- Ben Armstrong, Hyper-V Program Manager

Talking about Virtual PC and Hyper-V at Microsoft

  • Virtual PC Guy's Blog

    Hyper-V on Windows Server 2012 RC information

    • 1 Comments


    With the availability of the Windows Server 2012 Release Candidate – we have a bunch of information available online right now.

    Over on the Microsoft Server and Cloud Platform site we have:

    Meanwhile – on our TechNet Library we have:

    Cheers,
    Ben

  • Virtual PC Guy's Blog

    Windows 8 Release Preview Available

    • 0 Comments


    Today we announced the availability of the Windows 8 Release Preview / Windows Server 2012 Release Candidate.

    You can get all the details you need from:

    Cheers,
    Ben

  • Virtual PC Guy's Blog

    The v2 WMI namespace in Hyper-V on Windows 8

    • 4 Comments


    Hyper-V’s primary management interface is based on WMI.  More than that, it is based on an industry standard API profile that is defined by the DMTF (Distributed Management Task Force - http://dmtf.org/). The DMTF profiles that we use are developed by a number of industry members (Microsoft included) and are constantly growing and evolving.

    When we started working on Windows 8, we decided that we needed to update our WMI interfaces to take advantage of newer profiles that have been defined since the initial release of Hyper-V.  Some of these newer profiles were needed to support new features in Windows 8, while other profiles had been improved to be easier to use and develop against.

    There was one problem with this decision.  In some key areas – the newest profiles were not 100% compatible with the existing Hyper-V WMI interfaces.  This meant that adopting them would break any scripts / programs that people had written against Hyper-V in the past. 

    This is not something that we wanted to do.

    The solution that we came up with is what we call the “v2 namespace” for WMI.

    What we did was to create a new WMI namespace for Hyper-V.  This namespace has WMI APIs that are based off of the newer DMTF profiles and allows you to do everything that you need to with a Windows 8 / Windows Server 2012 installation of Hyper-V.  At the same time we also maintained the old WMI namespace and kept 100% compatibility with the APIs from Windows Server 2008 / Windows Server 2008 R2 – however, this namespace does not have any APIs for new Windows 8 / Windows Server 2012 features.

    This approach provides the best of all worlds.  We can provide access to new features, continue to adhere to industry standards and maintain backwards compatibility with existing programs / scripts.

    Selecting to use one WMI namespace or another is as simple as specifying the “root\virtualization” or “root\virtualization\v2” namespace on your WMI query.  In some cases – the difference between the two is nonexistent:

    image

    But in other areas there are big differences:

    image

    You can read about the new WMI details here: http://msdn.microsoft.com/en-us/library/hh850319(v=vs.85)

    Another interesting impact of the WMI changes is around our in-box management tools.  In order to support all of the new features in Windows 8 / Windows Server 2012 we had to move our management tools to using the new v2 WMI namespace.  Unfortunately, this means that you cannot use these tools to manage Hyper-V on Windows Server 2008 R2 / Windows Server 2008 (i.e. you cannot use Hyper-V Manager or Hyper-V PowerShell cmdlets on Windows 8 to connect to Windows Server 2008 R2).  However, you can use Hyper-V Manager on Windows Server 2008 R2 to manage a Windows Server 2012 installation (due to our work to maintain backwards compatibility of APIs) but then you will not have access to any of the new features.

    One final note here – for the curious – here are the DMTF profiles and versions that we are using in Windows 8 / Windows Server 2012:

    Registered Name                         Registered Version
    --------------                         -----------------
    Computer System                        1.0.1
    Generic Device Resource Virtualization 1.0.0
    Storage Resource Virtualization        1.0.0
    Processor Resource Virtualization      1.0.0
    Ethernet Port Resource Virtualization  1.0.0
    Virtual System                         1.0.0
    Allocation Capabilities                1.0.0
    System Virtualization                  1.0.0
    Resource Allocation                    1.1.0
    Memory Resource Virtualization         1.0.0
    Virtual Ethernet Switch                1.0.0
    Base Metrics                           1.0.1
    Virtual System Migration               0.7.3

    Cheers,
    Ben

  • Virtual PC Guy's Blog

    Installing the Remote Management Tools for Windows 8 Hyper-V

    • 2 Comments


    If you want to manage your Windows Server 2012 Hyper-V Server from a Windows 8 desktop computer – you may think that you need to install the Remote Server Administration Toolkit (which you can download here) but that is not what you need to do.

    Because Hyper-V is now part of the desktop version of Windows, the Hyper-V management tools are always available through the Windows Features dialog:

     RSAT

    Note, even if your computer cannot run Hyper-V (if your processor does not support hardware virtualization, or you are running the 32-bit version of Windows) you can still enable the Hyper-V Management Tools here.

    Cheers,
    Ben

  • Virtual PC Guy's Blog

    Pasting text to Hyper-V guests drops characters in Windows 8

    • 0 Comments


    I often use the feature of Hyper-V that allows you to “type clipboard text” into a virtual machine.  Unfortunately, in the Windows 8 / Windows Server 2012 beta release there is a known issue where doing this can result in missing or garbled characters being typed into the virtual machine.

    Luckily – Ned Pyle has posted the details of how to work around this here.

    My preferred option is to increase the keyboard buffer (the second option that he outlines).

    Cheers,
    Ben

  • Virtual PC Guy's Blog

    Why is my virtual machine “Off-Critical”?

    • 2 Comments


    In Windows 8 / Windows Server 2012 we have introduced a new state for a virtual machine to be in.  This is called “Off-Critical”.

    MissingVM

    What is happening here is that there is a virtual machine registered with Hyper-V – but we cannot find the XML configuration file for that virtual machine.  In the past, this would have just caused the virtual machine to disappear from Hyper-V Manager.  In Windows 8 / Windows Server 2012 we now show the virtual machine in Hyper-V Manager – but mark it as “Off-Critical”.

    The most common reason to have a virtual machine that is “Off-Critical” is because you had the virtual machine stored on a file server or removable disk (e.g. USB) that is not currently available. 

    When a virtual machine is in this state you have two options:

    • Delete the virtual machine.  This will simply tell Hyper-V to stop looking for this virtual machine.
    • Restore the missing storage (e.g. reconnect the USB disk)

    Note that in the beta build, after you have restored the missing storage you will need to stop and start the virtual machine management service for us to detect that the configuration file is back.  Once you have done this – everything should be good again:

    MissingVM Back

    Cheers,
    Ben

  • Virtual PC Guy's Blog

    Shrinking a VHD in Windows 8 - fast!

    • 5 Comments


    A couple of days ago I talked about how it was much easier to shrink a virtual hard disk in Windows 8.  But after writing that blog post – I spent some time playing around with PowerShell and found that there was an even better option.

    Instead of logging into a running virtual machine, doing some work, shutting it down and completing the operation.  You can do everything from PowerShell in Hyper-V if the virtual machine is shutdown first.

    The process that I figured out is as follows:

    • get-vm <vmname> | select ID | get-vhd | select path
      • This command will get you the virtual hard disk path and file name for each virtual hard disk in the virtual machine. Obviously you can skip this if you already know it.
    • mount-vhd <vhdname> –passthru | get-disk | get-partition | get-volume
      • This will mount the virtual hard disk in the management operating system, and let you know the drive letter that was assigned to it.
    • resize-partition –driveletter <driveletter> –size <newsize>
      • This will resize the partition inside the virtual hard disk
    • dismount-vhd <vhdname>
      • Dismount the virtual hard disk after shrinking the partition
    • resize-vhd <vhdname> –ToMinimumSize
      • Now shrink the virtual hard disk to match the new size

    Here is a screenshot of me resizing a virtual hard disk from 50GB to 30GB on a virtual machine:

    PowerShell resize

    This whole process took under a minute and was completed without needing to start the virtual machine.

    Cheers,
    Ben

  • Virtual PC Guy's Blog

    Shrinking a virtual hard disk in Windows 8

    • 6 Comments


    Late last year I posted about the process that I followed to reduce the disk size of my virtual machines, prior to converting them to using a fixed size virtual hard disk.  The process I used was quite complicated.

    If only I had waited for the beta availability of Windows Server 2012 – things could have been a lot simpler.  You see, one of the new features in Windows Server 2012 is the ability to shrink a virtual hard disk.  You need to free up space inside the virtual hard disk first – but then you can shrink the drive using a simple wizard.  This means that the process of shrinking an existing virtual machine now looks like this:

     

    1. Login to the virtual machine using an administrative account
    2. Open Server Manager and select the Disk Management node under the Storage node.
    3. Right click on the partition that you want to shrink and select Shrink
    4. Select how much you want to shrink the partition by
      1. In my case I want to shrink a 250GB partition to 70GB:
        Server Manager inside a virtual machine
    5. Once this is complete, shutdown the virtual machine.
    6. Open the virtual machine settings under Hyper-V and select the virtual hard disk that you want to shrink.
    7. Click on the Edit button.
    8. This will open the Edit Virtual Hard Disk Wizard where you can now select to Shrink the virtual hard disk:
      Edit Virtual Hard disk Wizard 
    9. Now hit Finish

    Hyper-V will automatically shrink the virtual hard disk to remove any free space from the end of the disk – so there is no need to enter how much you want to shrink the disk by.  Once this process is complete your can boot the virtual machine and start using the smaller virtual hard disks.

    Cheers,
    Ben

  • Virtual PC Guy's Blog

    Windows 8 key combinations inside of Hyper-V

    • 1 Comments


    Along with the new user experience in Windows 8, we have introduced a number of new Windows-Key shortcut combinations.  For example – Windows Key + C will bring up the charms bar, while Windows Key + Z brings up the application bar.  You can read about all of the various options on the Getting around in Windows 8 post on the Windows team blog.

    But how does this work for Windows 8 inside a Hyper-V virtual machine?

    With Hyper-V on Windows 8 – we have updated things so that, by default, all Windows key combinations go through to the virtual machine (except for Windows Key + L for locking the desktop).  This means that you can just use the keyboard shortcuts out-of-the-box.

    If, however, you are running Windows 8 on Hyper-V on Windows Server 2008 R2 – Windows key combinations will not go into the virtual machine by default.  But this can be easily remedied. All you need to do is to open the Hyper-V settings and go to the Keyboard setting:

    image

    There you can select Use on the virtual machine.  Then you will be able to use the new key combinations in virtual machines too.

    Cheers,
    Ben

  • Virtual PC Guy's Blog

    Ubuntu 12.04 under Hyper-V on Windows 8

    • 1 Comments


    Recently a number of the Hyper-V drivers for Linux made it into the main kernel branch.  This means that native support for Hyper-V is starting to turn up in a number of Linux distributions.  Ubuntu 12.04 LTS is an example of a new Linux release with Hyper-V support “out of the box”.  To try this out for myself – I grabbed the 32-bit desktop install media from Ubuntu.com and fired up a virtual machine:

    ubuntu-12-1

    After the initial splash screen, I was pleasantly surprised by the first indication of the improved Hyper-V support.  Before even install Ubuntu, on the first page of setup, I already had integrated mouse support.

    Ubuntu-12-2

    I chose to Install Ubuntu and was then presented with a page that confirmed that I had enough space, and I had a valid internet connection. This was also interesting to note, as I had not added a legacy network adapter to the virtual machine.  This meant that Ubuntu had already recognized and loaded drivers for the Hyper-V high-performance network adapter.

    ubuntu-12-3

    After this – the installation was fairly pedestrian…

    ubuntu-12-4ubuntu-12-5ubuntu-12-6ubuntu-12-7ubuntu-12-8ubuntu-12-9ubuntu-12-10

    The only quirk I encountered was that at the end of the initial installation phase – the virtual machine failed to reboot automatically.  It sat at this page for about a minute until I manually reset it:

    ubuntu-12-11

    But after that it booted perfectly:

    ubuntu-12-12

    And I confirmed that applications and network connectivity was working correctly:

    ubuntu-12-13

    My favorite part of this was seeing this message:

    ubuntu-12-14

    “No proprietary drivers are in use on this system”.  Correct! The Hyper-V drivers are now part of Linux, under GPL.

    Cheers,
    Ben

Page 1 of 114 (1,134 items) 12345»