Alexander’s Blog

January 9, 2012

How to Enable Audio Support in Hyper-V Guest VMs on WS08R2

by @ 7:06 am. Filed under Tips & Tricks, Virtualization, Windows 2008

I work with Hyper-V a lot. Recently I have been doing some work that required audio support inside the virtual machines (VMs) on my Windows Server 2008 R2 computers. Here’s the procedure you can use to enable audio support inside the VMs.

1. Login to the virtual machine.

2. Run the Services Console (Start, Run, services.msc).

3. Configure the Windows Audio service to start automatically and then start the service.

4. Go to Start, Administrative Tools, Remote Desktop Services, Remote Desktop Session Host Configuration.

5. Double-click RDP-Tcp in the Connections section.

    6. Click Client Settings tab.

    7. Clear the boxes Audio and video playback and Audio recording and then click OK.

    8. Your audio should now work in the VM.

      January 5, 2012

      Can’t Start a VM on Windows Server 2008 R2? Could Be Due to Lack of AVX Support.

      by @ 2:06 pm. Filed under Tips & Tricks, Virtualization, Windows 2008

      I recently ran into a situation where I wasn’t able to start virtual machines on a newly installed Windows Server 2008 R2 computer. After a little research I ran into the following Microsoft Knowledge Base article 2517374:

      You cannot start virtual machines on a computer that is running Windows Server 2008 R2 and on which a CPU is installed that supports the AVX feature

      Here’s the scenario. I installed Windows Server 2008 R2 on a computer with an Intel CPU that supported the Advanced Vector Extensions (AVX) feature. I installed the Hyper-V server role and then imported a virtual machine. However, when I tried to start the virtual machine I received an error indicating that the virtual machine failed to initialize. I enabled hardware assisted virtualization in the BIOS but that didn’t help. I then found the KB251374 article and discovered that Windows Server 2008 R2 doesn’t support the AVX feature. Luckily, Windows Server 2008 R2 SP1 adds the support for AVX. Because my server was a brand new installation, I hadn’t installed SP1. As soon as I installed SP1 I was able to start the virtual machine.

      The KB article also documents a workaround where you can force compatible CPU flags by setting a WMI property. However, the workaround has two issues that make it a pain in the neck. I recommend you install SP1 rather than messing with a problematic workaround.

      October 11, 2011

      Difference Between Hyper-V Saved State and a Snapshot

      by @ 10:54 am. Filed under Virtualization, Windows 2008

      When working with Microsoft Hyper-V, it is helpful to understand the difference between the Saved State and a Snapshot. Here is a brief explanation of both.

      Snapshot

      A snapshot can be taken whether the virtual machine (VM) is running or not. It is a point in time of the state of a VM. You can revert back to a previous point in time whenever there is a need. For example, if you plan to install a service pack, you can take a snapshot before you install the service pack and if things go wrong, you can revert to the point in time before you installed the service pack. It is similar to the System Restore concept in Microsoft operating systems. A snapshot consists of three components:

      1. A single xml file for the VM configuration. This includes all the settings that you configured for the VM, such as memory, number of processors, description of the VM, etc.
      2. A memory save state file.
      3. A difference disk, which is a file that ends with the extension .avhd. There will be a separate .avhd file for each snapshot.

      Saved State

      A Saved state is a point in time of a running VM, however, unlike a Snapshot, a Saved state can only take place on a VM that is running. Also, a Saved state can be restored only once (as long as you have not applied a Snapshot since the system state was saved). This is different than Snapshot because a Snapshot can be restored multiple times. In fact, you can go back and forth between different Snapshots to the exact point in time when the Snapshots were taken.

      Taking a Snapshot

      To take a Snapshot, simply right-click a VM in the Hyper-V console and select Snapshot. The VM may be running or shutdown. You may also delete a Snapshot, whether the VM is running or not.

      Saving the State

      To save the system state, right-click the VM while it is running and select Save. Your VM will appear to be shutdown. To resume, you simply right-click the Saved VM and select Start.

      As great as Snapshots are, keep in mind that according to Microsoft if you have more than three Snapshots for a VM, you may experience performance degradation. However, the degradation will depend on the amount of RAM and processors that are available and how you have configured the system resources.


      Copyright ©2011 Zubair Alexander. All rights reserved.

      October 5, 2011

      Free Windows Server 2008 R2 Evaluation Virtual Images for Hyper-V

      by @ 7:31 am. Filed under Virtualization, Windows 2008

      A lot of my students ask me if they can get a copy of the Hyper-V virtual image that they use in class to do labs. The answer to that question is no. Microsoft does not allow training centers to distribute those images because of licensing requirements. However, Microsoft was kind enough to allow people to download a free 180-day evaluation version of Windows Server 2008 R2 Enterprise as well as Windows Server 2008 Server Core edition.

      The evaluation period is 180-days (6 months), which is a long time to evaluate and experiment with the product. This is perfect for developers, testers, trainers, and students.

      You can download the images here.

      July 5, 2011

      How to Increase Virtual Machine Disk Space in VMware ESXi 4.1

      by @ 8:48 am. Filed under Articles, Tips & Tricks, Virtualization, Windows 2008

      If you are running VMware ESXi 4.1 you can increase the size of the virtual machine (VM) relatively easily once you know how. But if you have any snapshots, it can be a pain. Keep in mind that increasing the size of the VM is different than increasing the size of the disk partition on the host computer.

      Let’s use the following scenario as an example. Your ESXi server’s hard disk is 1TB in size and you have a VM running a Windows Server 2008 R2 guest operating system that has two drives, a 30GB drive C and a 20GB drive D. After a few months you realize that you have installed a lot of programs and your VM hard disk is running out of space. Over the last few months you have taken a dozen snapshots. You go to the vSphere Client utility and select the VM. You select Edit Settings and select the hard disk that is running out of disk space but the option to expand the disk is grayed out. This is likely if the VM has snapshots. You must power off the VM and then delete the snapshots before you can expand the disks.

      Once that is take care of, you need to edit the VM’s settings. Here are the steps.

      NOTE: The option to Edit Settings will be grayed out if you are in the middle of deleting a snapshot.

      1. Make sure your ESXi 4.1 server has been backed up.
      2. Start the vSphere Client utility.
      3. Select the VM that’s running out of disk space.
      4. Right click the VM and select Edit Settings.
      5. On the Hardware tab select the virtual hard disk (e.g. Hard disk 1).
      6. On the right hand side, under Disk Provisioning increase the Provisioned Size then click OK. For example, if you have two disks and you want to increase the size for drive C from 30 to 50GB and drive D from 20 to 25GB, increase the size using the up arrow and then click OK.
      7. Restart the VM.
      8. At this point you have increased the size of the disk in VMware but you need to do the same in the operating system. In Windows Server 2008 R2 go to Server Manager, Storage, Disk Management. You will notice unallocated space at the end of the disks.
      9. Right-click drive C and select Extend Volume. Follow the wizard to extend the volume. It should take only a few seconds to run through the wizard. Repeat the steps for drive D.
      10. Your drive size will increase right away and there is no need to reboot the computer.

      Troubleshooting VMware Snapshots Issues

      If in step 6 you are unable to increase the size of the disk because the provisioning option is grayed out, you need to make sure that you delete all the existing snapshots. VMware snapshots are very different than Hyper-V snapshots. Frankly, they are much more complicated and are meant to be used only temporarily. You heard me right. Unlike Hyper-V snapshots which can be actually useful in the long term because you can keep a bunch of snapshots indefinitely and go back and forth between them without any problem, VMware is not designed to use snapshot for similar purposes. It is meant to be used for 24-28 hours after which you should delete them. If you don’t, you can run into some serious problems. First of all, deleting snapshots takes seconds or a couple of minutes in Hyper-V. In VMware it can take hours. If you have a 30GB VM disk and you have old snapshots that you didn’t delete within a couple of days, it can take anywhere from an hour to several hours to delete each snapshot. And that’s not the bad news. What’s worse is that VMware is infamous for hanging at 95% (or sometimes at 99%) when you delete a snapshot. On my ESXi server it always hangs at 99%. Sometimes if you wait a few hours it may finish the process. Other times you can wait over 12 hours and it will still be stuck at 95% (or 99%). This is a known issue with VMware for some time now. Do an Internet search for “VMware stuck at 95%” and see how many hits you get.

      VMware can get stuck not just when you delete the snapshots (a common occurrence) but also when you shutdown or power off the VM. Although this problem is relatively uncommon. To work around this problem, you can either use SSH to connect to your server and restart the Management Agents, or you can go to your VMware server’s console and restart the services. Here are the steps as documented by VMware in this KB article.

      Restart Management Agents Using SSH

      1. Logon to the ESXi host as root.
      2. Type service mgmt-vmware restart and press Enter.
      3. Type service vmware-vpxa restart and press Enter.
      4. Type logout and press Enter to disconnect from the ESX host.

      Restart Management Agents Using the Console

      1. Connect to the console of your ESXi host.
      2. Press F2 to customize the system.
      3. Login as root.
      4. Using the Up/Down arrows navigate to Restart Management Agents.
      5. Press F11 to restart the services.
      6. When the service has been restarted, press Enter to exit.
      7. Press ESC to logout of the system.

      If you are deleting one snapshot at a time you may have to repeat the above step for restarting the Management Agents each time when the snapshot hangs at 95%.

      The quicker way to delete the snapshots is to use the Delete All option. Depending on how old the snapshots are, the size of the snapshots can be large and it can take considerable time. If you notice that you have deleted all the snapshots and the provisioning option is still grayed out, this is because the snapshots are not actually deleted, even though there is nothing in the Snapshot Manager. You can browse the Datastore and see all the snapshots. If you run into this issue, try the following tips.

      Tip #1

      Create a snapshot and then delete it right away. This may delete all the existing snapshots and you will be able to provision the disks.

      Tip #2

      Power down the VM, create a snapshot and the delete it right away. I have experienced that when the first technique doesn’t work, the second one does.

      Moral of the Story

      Do not use snapshot in VMware ESXi 4.1 for more than 1-2 days. Use snapshots temporarily, not as a method to backup or to go back and forth between snapshots. If you are a developer, trainer or a tester that needs to use snapshots on a consistent basis then consider switching to Microsoft Hyper-V as a solution. While Hyper-V’s snapshots have their own issues, they are not quite as problematic as in VMware.


      Copyright ©2011 Zubair Alexander. All rights reserved.

      Contact E-mail | Terms of Use | Privacy Policy

      Copyright ©2010 Zubair Alexander. All rights reserved.

      Internal Links

      Search Blog

      Categories

      Archives

      February 2012
      M T W T F S S
      « Jan    
       12345
      6789101112
      13141516171819
      20212223242526
      272829  

      RSS Feeds

      TechGalaxy Visitors

      25 queries. 0.414 seconds