LAN on Hyper-V virtual machine not working on Windows 10

After an Windows 10 update, my Hyper-V virtual machines, did not have a working internet connection.

To fix this problem I had to:

– Shutdown all virtual machines

– Remove all network adapters of all virtual machines

– Remove all virtual switches in Hyper-V

– Reboot host

– Create new virtual switch

– Add network adapters that use the new virtual switch to all virtual machines

– Reboot the host

– Start virtual machines

 

After these steps my virtual machines were running with working internet connections.

Yes, Yes Remote Desktop to a virtual machine without locking existing user in Microsoft Windows Server 2012 R2 (session shadowing)

No more need for TeamViewer or LogMeIn Winking smile

 

http://technet.microsoft.com/en-us/library/dn283323.aspx

http://microsoftplatform.blogspot.nl/2013/07/detailed-walkthrough-on-remote-control.html

 

Session shadowing. We now allow administrators to be able to ‘shadow’ a session-based or virtual machine-based desktop or RemoteApp program. This is very useful for helpdesk and troubleshooting of an end user problem. It utilizes our standard Remote Desktop client and works with single and multiple monitors.

How to copy files from host to a Hyper-V virtual machine in Windows 8 by using the clipboard.

Often I hear people complain about the Microsoft Hyper-V manager, for instance: copying files from the host to virtual machine by using the clipboard is not possible, this is because the Hyper-V manager is not intended to be used like VMWare workstation or player.

 

Only use the Hyper-V manager to “manage” virtual machines eg start, stop, copy, clone, add or remove hardware etc.

Remote Desktop

When you want to connect to the desktop of the virtual machine, use Remote Desktop.With remote desktop it is possible to copy files from the host to the Hyper-V virtual machine by using CTRL-C and CTRL-V (using the clipboard). In windows 8 the remote desktop experience is really improved, so take a look at it.

 

TIP: You can still use free programs like Microsoft Remote Desktop Manager v2.2 to manage multiple rdp connections, but the “metro” windows 8 RDP app is pretty good.

Making the switch: VMWare Workstation 7 to Hyper-V server for performance reasons (PowerPivot on SharePoint 2010)

 

History

Back in 2002 I was working with a company which produced a CAD application written in VB6. The product was released in several languages. For each language we had a Microsoft Windows NT 4 workstation with the corresponding language package. I quickly realized that managing these workstations was difficult. So I started to look at virtualization, but it was not until 2003 with new hardware and an other company when I decided to take a look at VMware Workstation version 4.0. This was great I could run all Microsoft Windows languages and different versions on 1 system! Then in 2004 Microsoft released Microsoft Virtual Server 2005 I took a look at the product but soon realized that it could not compete with VMware Workstation and I kept on using VMware Workstation. This worked great for me, except for 2 things:

  1. Performance, if I installed a Windows operating system on a workstation en booted from it, it was much, much faster then when I used a Virtual Machine containing the same windows operation system on that same workstation.
  2. Snapshot – Backup host, if I installed a program or driver on the host and that corrupted the host, there was no out of the box recovery (yes there where al kinds of products that can do that, but not windows out of the box) possibility. One trick I used was to install an windows host OS and then only installed VMware Workstation on it. I would only use the VMware virtual machines and only used the host OS to take snapshots and backups of my virtual machines.

VMware Workstation 7 (paid product)

Part 2 worked fine for me, but then I shifted from being a C# developer to a self-service BI specialist and Microsoft introduced PowerPivot and SharePoint 2010. In late 2009 I started to work with PowerPivot (Gemini at the time) and SharePoint 2010, so I create a VMware 7 development virtual machine with Microsoft Windows 2008 R2, Microsoft SQL Server 2008 R2, Microsoft SharePoint 2010 and Microsoft Office 2010 on a 3 year old dell laptop with 4 GB memory. Well that really did not perform at all. I bought a 80 GB Intel Postville G2 M-25 SSD, but the VMware Workstation virtual machine would not perform well and I was waiting on the system all of the time. Then one time I installed Microsoft Windows 2008 R2 as host OS with Microsoft SharePoint 2010 and PowerPivot on it. Well I was really impressed by the speed of the system, I booted in 3 times as fast an all Office products would directly open when I clicked on a document, instead of waiting for the splash screen. I know 4GB of RAM is not enough for a Microsoft SharePoint 2010 PowerPivot development machine, but with the help of the SSD I could manage it. But then I could not take snapshots of my host.

As I said before, VMware Workstation 7 is to slow for me on my hardware for running Microsoft SharePoint 2010 with PowerPivot, that’s why I started to look at hypervisors.

Pros
– Don’t have to no anything about hypervisors, just install windows host OS and then install VMware Workstation 7.0, it’s only a program.
– Supports not only Windows guest operating systems

Cons
– Must be installed on a host operating system (host operating systems consumes cpu, memory and disk space
– Is not free
– “Bad” performance compared to native boot

 

VMware ESXi (freeware)

Then in begin 2010 I learned about hypervisors. VMware has a free product ESXi 4, that can be installed on a system with a (32MB foot print, maximizing the space on the 80GB OS for Virtual Machines) and then you can run different virtual machine containing not only Microsoft OS but also Linux etc without installing a Host OS and having the possibility to take snapshots and backups of the virtual machines . So I created a bootable USB ESXi drive but found out my NIC and SATA controller where not supported, damn! Yes I know, ESXi is not supposed to be installed on a laptop but it would have been nice.

Pros
– Freeware
– No host OS (so not need to snapshot or backup host, only snapshot and backup virtual machines)
– 32 MB footprint
– Supports not only Windows guest operating systems
– Can run Microsoft Windows XP virtual machines
– Can boot from USB without installing

Cons
– Can’t native boot from virtual machines (so a performance impact, but far better then VMware Workstation)
– Could not get it to work with my DELL laptop

 

Microsoft Hyper-V 2008 R2 (freeware)

In 2010 Microsoft released there hypervisor: Microsoft Hyper-V 2008 R2 and it’s free! What did you say, is Microsoft releasing a product that’s free of charge, the answer is; YES. It can be downloaded, here: http://www.microsoft.com/downloads/details.aspx?FamilyID=48359dd2-1c3d-4506-ae0a-232d0314ccf6&displaylang=en it’s a 1,5 GB ISO. Installed it and after installing I could boot from a VHD file created with Microsoft Windows 2008 R2

Pros
– Freeware
– Native boot from VHD, maximizing performance and hardware possibilities
– No host OS (so not need to snapshot or backup host, only snapshot and backup virtual machines)
– 6GB footprint (after installing)
– Can boot from USB without installing

Cons
– Supports only booting from Microsoft Windows 7 or Microsoft Windows Server 2008 R2
– Have to use a “workstation” virtualization product in a booted virtual machine to manage other virtual machines

 

What do I exactly use for developing Microsoft SharePoint 2010 PowerPivot applications

So today what do I exactly use for developing C# vs2008, C# vs2010 and SharePoint 2010 PowerPivot applications

  1. Laptop with Microsoft Hyper-V Server 2008 R2 (freeware) installed on a 2,5 inch 80GB SSD boot disk, a 500GB 7200 rpm 2,5 inch for data and virtual machines I don’t often use and 8GB of RAM.
  2. When I start the laptop I boot into a VHD containing Microsoft Windows 2008 R2, Microsoft SQL Server 2008 R2, Microsoft SharePoint 2010, Microsoft Office 2010 and the hyper visor role installed to manage other virtual machines. Because I primarily do self service BI work and VS2010 development this is the machine I want the best performance for. I use the hyper-v manager in the this virtual machine to start legacy virtual machines (VS2005 with SQL 2005 or VS2008 with SQL 2008)
  3. In the SharePoint 2010 virtual machine I keep 2 images up date date, a base Microsoft Windows 7 and a base Microsoft Windows Server 2008 R2 virtual machine. They serve as base for creating new virtual machines, see https://www.roelvanlisdonk.nl/?p=1530. They are updated every week and configured the way I want to, see https://www.roelvanlisdonk.nl/?p=1462
  4. In all I mange 6 virtual machines
    • Microsoft Windows 7 x64 – base for client virtual machines
    • Microsoft Windows Server 2008 R2 x64 – base for server virtual machines
    • Legacy 2005 development – clone of Microsoft Windows 7 x64 base containing VS2005, Office 2003, SQL Server 2005, SSIS 2005, SSRS 2005, SSAS 2005
    • Legacy 2008 development – clone of Microsoft Windows 7 x64 base containing VS2008, Office 2007, SQL Server 2008, SSIS 2008, SSRS 2008, SSAS 2008
    • SharePoint 2010 development (native boot), clone of Microsoft Windows Server 2008 R2 x64, containing VS2010, SharePoint 2010 with PowerPivot, Office 2010, SQL Server 2008 R2, SSIS 2008 R2, SSRS 2008 R2, SSAS 2008 R2
    • VPN – clone of Microsoft Windows 7 x64 base containing VPN connections and remote desktop shortcuts to customer machines (I use a virtual machine for this purpose, because, when connected to the VPN I don’t have access to the rest of the network)

 

Conclusion

Microsoft Hyper-V Server 2008 R2 rules:

  1. Creating new virtual machines in minutes, containing a fully patched windows host OS and configured the way I like it to be with the ability to boot from the virtual machines, maximizing performance
  2. Can use legacy development machines without rebooting (vs2005, vs2008 for legacy support)
  3. Install a full blown Microsoft SharePoint 2010 development server within 30 minutes on a new laptop or workstation and booting from it, maximizing performance

How to native boot Windows 7 from vhd (hyper-v) on an other machine with RAID, without getting the BSOD (blue screen of death)

I wanted to create one virtual machine and use (boot)  it on an other machine, but I was getting a Blue Screen Of Death (BSOD) every time I booted the virtual machine, even if I created the VHD in the Microsoft Windows 2008 R2 Hyper-V manager and tried to natively boot on that same machine from the virtual machine.

Cause

This was caused by the fact that I was using a RAID configuration on Machine A and also on Machine B and the RAID drivers where not supplied on the Windows 7 DVD. All drivers needed to boot Microsoft Windows 7 should be available on the virtual machine before you try to boot from the vhd.

 

Solution

Even if you are not using RAID configuration, best practice is to sysprep you’re virtual machine before you try to boot it on an other machine. If you’re using a RAID configuration, special graphics drivers or other drivers not on the Microsoft Windows 7 DVD, use dism.exe found in the “Windows Automated Installation Kit (AIK) for Windows® 7” to add drivers to you’re syspreped vhd.

These are the steps I used to boot from a VHD containing Microsoft Windows 2008 R2 or Microsoft Windows 7 on an other machine without getting the BSOD:

 

Creating the Virtual Machine

  • Machine A has Microsoft Windows 2008 R2 with hyper-v role installed
  • Create a Virtual Machine on Machine A, by using the hyper-v manager (Start > Administrative Tools > Server Manager > Roles > Hyper-V Manager. Make sure the disk is fixed to a maximum size (for example: 50GB). Machine B should have at least 50GB free disk space else the vhd won’t boot.
  • Create the virtual machine on C:\VHD\NotSysPreped, path to VHD should be C:\VHD\NotSysPreped\MyMachine.vhd
  • After installing Windows 7 or Windows Server 2008 R2 on it and after installing all you’re programs (except anti virus), shutdown the virtual machine
  • Install the Windows Automated Installation Kit (AIK) for Windows® 7 on Machine A, because we need the dism.exe tool. You could also use a tool like Virtual CloneDrive to copy the tool out of the downloaded *.iso file.
  • I will boot this virtual machine once a week to update it with the last Windows Updates (keeping this Virtual Machine up to date)

 

Pre-pair the Virtual Machine

Every time you want to use a copy of this virtual machine on other machine, execute the following steps:

  • Shutdown the Virtual Machine on Machine A
  • Copy the file C:\VHD\NotSysPreped\MyMachine.vhd to C:\VHD\SysPreped\MyMachine.vhd. We create a copy of the vhd, because we want the original virtual machine to keep working.
  • Create a new Virtual Machine based on the copied C:\VHD\SysPreped\MyMachine.vhd file
  • Boot this new Virtual Machine
  • In the Virtual Machine execute C:\Windows\System32\sysprep\sysprep.exe
  • image
  • Choose Enter System Out-of-Box Experience (OOBE)
  • Check “Generalize”
  • Choose “Shutdown”
  • Press OK

The following steps are only needed when you are using drivers on Machine B, that are not supplied on the Windows 7 DVD (for example: when you are using a RAID configuration).

  • After the virtual machine has shutdown, run CMD on Machine A
  • Attach the C:\VHD\SysPreped\MyMachine.vhd file, so it can be used by the dism.exe tool:
    • In the cmd dialog enter:
    • diskpart
    • select vdisk file=C:\VHD\SysPreped\MyMachine.vhd
    • attach vdisk
    • assign letter=v
    • exit
  • Copy you’re RAID drivers to Machine A on C:\Drivers
  • Add RAID drivers by using the dism.exe tool:
    • In the cmd dialog enter:
    • dism.exe /image:V:\ /Add-Driver /driver:C:\Drivers\mydriver.inf

 

Booting from the Virtual Machine on Machine B

  • Machine B must be running Windows Server 2008 R2 or Windows 7
  • Boot Machine B
  • Copy the C:\VHD\SysPreped\MyMachine.vhd from Machine A to Machine B C:\VHD\SysPreped\MyMachine.vhd
  • Edit the boot manager by using the bcdedit.exe tool:
    • bcdedit /copy {current} /d “MyMachine Description
    • The previous statement returns a GUID like: {aa2e3972-7a31-11df-987b-b52175dc348f}
    • bcdedit /set {aa2e3972-7a31-11df-987b-b52175dc348f} device vhd=[C:]\VHD\SysPreped\MyMachine.vhd
    • bcdedit /set {aa2e3972-7a31-11df-987b-b52175dc348f} osdevice vhd=[C:]\VHD\SysPreped\MyMachine.vhd
    • bcdedit /set {aa2e3972-7a31-11df-987b-b52175dc348f} detecthal on
    • bcdedit /set hypervisorlaunchtype auto
    • The previous statement is only needed when the virtual machine is running Microsoft Windows 2008 R2 with the hyper-v role enabled.
  • Reboot Machine B
  • After rebooting you should see two entries one with the description “Windows 7” and an other with the description “MyMachine Description
  • You should now be able to boot the virtual machine on Machine B without getting the BSOD!