Hyper-V

Hyper-V Virtualization: Turning Hyper-V On and Off

I recently started using Hyper-V on my Windows 10 workstation to task advantage of using technologies such as Docker that leverages Hyper-V to run its container images.  I also run VMware Player for running virtual machines.

The following commands make it a simpler task to toggle Hyper-V on and off again.

To Turn Hyper-V off, run the following command then restart your computer:

bcdedit /set hypervisorlaunchtype off

To turn Hyper-V back on, run the following command then restart your computer:

bcdedit /set hypervisorlaunchtype on (or auto start)

 

Note:  Quick method to check the status of Hyper-V – Get-WindowsOptionalFeature -Online -FeatureName *hyper*

Change Screen Resolution for a Ubuntu Hyper-V Virtual Machine

Just finished installed Ubuntu as a Windows 10, Hyper-V guest.  I went to modify the video settings and noticed them to be locked in place.  After some searching; Thank you Google… Found the solution that worked for me.

Ref: Ben Armstrong’s Virtualization Blog

Steps to change screen resolution:

  1. Open Terminal
  2. Type: sudo nano /etc/default/grub
  3. Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT, and add video=hyperv_fb:[the resolution you want]. The resolution I want is 1280×720. So my line ends up looking like this: GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash video=hyperv_fb:1280×720″
  4. Write the changes (Ctrl X)
  5. Run: sudo update-grub
  6. Reboot the virtual machine

When you return from your restart you will have the resolution you applied in the grub config.

 

 

 

Enabling Hyper-V for use on Windows 10

You all know when it comes to virtualization I am VMware all the way.  However, it has recently to my attention that the use of VMware Player on a company issued computer may be a violation of the EULA as this type of activity would be considered commercial use of the software.

So the option is to purchase a license or use the native Virtualization built into my Windows 10.

Ref: Workstation Player FAQs

  • Here are some capabilities of Windows 10 virtualization:
  • Hot add & remove for memory and network adapters: Windows and Linux Guests
  • Windows PowerShell Direct: Issue commands inside a virtual machine from the host
  • Linux secure boot:  – Ubuntu and SUSE Linux Enterprise Server can use secure boot options
  • Hyper-V Manager: Hyper-V manager can manage computers running Hyper-V on Windows Server 2012, Windows Server 2012 R2 and Windows 8.1

 

Prerequisites

The following prerequisites are required to successfully run Hyper-V on Windows 10:

Windows 10 Pro or Enterprise 64 bit Operating System
64 bit processor with Second Level Address Translation (SLAT)
4GB system RAM at minimum
BIOS-level Hardware Virtualization support

 

Windows 10 Hyper-V Install Steps:

  1. Enable virtualization support in bios
  2. Access the Control Panel
  3. From Control Panel select Programs
  4. In Windows Features select Hyper-V
  5. After installation of Hyper-V has completed, restart computer

The installation of Hyper-V is now complete.  The next step is to setup the Virtual Switch Manager for networking and configure your first virtual machine. This is can be done by:

  1. Clicking the search icon on the task-bar and then typing Hyper-V Manager .
  2. Select Virtual Switch Manager in the Actions pane
  3. Choose External and then click on the Create Virtual Switch button
  4. Give the new Virtual Switch a name, and ensure the active NIC is selected

 

Creation of Virtual Machine Fails – StatusCode: 610–MandatorySysPrepEntryNotFound

Working with the team in creating new virtual machine templates I found that some of our Windows 7 templates when they are being deployed with the following error:

Virtual Machine Manager was unable to find a value for the required Sysprep parameter ProductKey. (StatusCode: 610–MandatorySysPrepEntryNotFound)

I attempted to do some google searching which gave me no information for this issue and I started thinking about the issue in detail. Perhaps the sysprep operation requires a key. Then again its right there in the error message which I overlooked at first glance

So I did just that.

I logged into my MSDN and obtained a MAC key, applying it to the template, saved my change and attempted the process again. This time my deployment worked.

I decided to use a KMS Client setup key for these images as our network supports KMS activation.

For a list of KMS Client Keys: https://technet.microsoft.com/en-us/library/JJ612867.aspx

 

Another error encountered was:

Virtual Machine Manager was unable to find a value for the required Sysprep parameter LocalAdminCredential. (StatusCode: 610–MandatorySysPrepEntryNotFound)

As we did above we needed to define a local admin account (user/password) to be added to our deployments.

 

I hope you enjoyed this post, thanks for visiting – jermal

Hyper-V: Compact Hyper-V Virtual Hard Disk

I am attempting to do some quick cleanup on a Hyper-V host used for testing.

To do this I compacted the Hyper-V Virtual Disks.

  1. Open the Hyper-V Management console
  2. Right click on VM Guest
  3. Select Settings
  4. Select the Hard Drive for the VM Guest
  5. Click the Edit button
  6. Select Compact
  7. Click Finish

*note* you want to do this on dynamically expanding disk types