Thursday, February 27, 2014

Windows Server 2012 R2 ESSENTIALS: Virtualization How-To, Physical Hyper-V Host and Virtual Server (VM)


This is intended to be a guide how to install Microsoft Windows Server 2012 R2 ESSENTIALS as a virtual server, i.e. inside a virtual machine (VM). This VM will run on a physical Hyper-V host which will be again Windows Server 2012 R2 ESSENTIALS itself. This type of installation is allowed by Microsoft but they have not included a tool to simplify the process. In order to achieve our aim, we need to modify the original ISO by removing the Essentials Role and Essentials Setup using Microsoft's own tools.

DISCLAIMER: To my best knowledge everything described here complies with the MS license terms. It worked for me but does not mean that it will work for you as is. So make sure that you have understood everything and check if each step applies to your system. There is no liability for damages.

Physical Hyper-V Host vs Virtual Server (Guest VM)

Windows Server 2012 R2 Essentials is a very interesting operating system for small businesses. What many people don't know: Microsoft now allows you to do one physical installation - let's call it Hyper-V Host Installation - plus one virtual installation - let's call it the actual Server Essentials inside a Virtual Machine (VM). This is explained here:
http://blogs.technet.com/b/sbs/archive/2013/09/03/understanding-licensing-for-windows-server-2012-r2-essentials-and-the-windows-server-essentials-experience-role.aspx

Virtualization Obstacles

Unfortunately, to make your life as complicated as possible, Microsoft has not made the virtualization straightforward. The problem is that the Essentials Role needs to be manually removed before doing the installation on the physical host: It is not only useless for the Hyper-V physical host but it will also interfere with the Server Essentials we want to install later as a virtual server in a VM. MS has not included an option to remove the Essentials role. They have decided to leave this option for OEMs only, so these have to decide for you if they want to include the virtualization for your server or not - stupid! At the time of this writing MS offers some explanations how the install image needs to be modified to remove the essentials role but these are complex and even include mistakes:
http://technet.microsoft.com/en-us/library/dn293253.aspx
or
http://social.technet.microsoft.com/Forums/en-US/341bd905-1d99-4e3d-af16-04aadf9e9ab9/installing-windows-server-2012-essentials-r2-hyperv-role?forum=2012R2EssentialsPreview

Why not just use the free Microsoft Hyper-V Server for the Host?

I also thought about using the free Hyper-V Server instead of Server 2012 R2 Essentials on the physical host. Free Hyper-V Server even gives you unlimited VMs, but it is "command line only" (no GUI!) and is hard to use for entry level admins. Also it probably does not include Windows Server Backup which is very handy to backup the Server Essentials VM from the host. Graphical tools for RAID monitoring etc. will not be usable without full GUI.

The Idea

So I decided to write a step-by-step guide. But first I thank for the help I received from Moodjbow's blog:
http://moodjbow.wordpress.com/2013/07/02/server-2012-r2-essentials-hyper-v-how-to/

So my basic idea was the following:

1. It should be possible to cleanly modify the original ISO according to the MS guides to get a Hyper-V “Physical-Host-Only” ISO to install, without Active Directory, etc. IMHO there is no need to auto-include the guest VM (as MS does in its guides) which just makes things more complex and inflexible!

2. The Server Essentials can then be just installed inside that physical host from the original unmodified ISO as a Guest VM. This way we can also configure the VM as we like before installing. Clean and easy!

Let's get to work!

Step-by-Step: Creating the ISO for the Hyper-V-Host Installation


Preparation: Install the Windows 8.1 ADK (Assessment and Deployment Kit)

First you need to download and install the free Win 8.1 ADK on your PC where you will prepare the modified ISO. You should be able to do this on Windows 8.0, Windows 8.1 and probably on Server 2012 R2 but I have not tested them all. I have actually installed it on Windows 7 as it is also compatible with the Windows 8.1 ADK.

After having installed the ADK to its default directory open a Windows COMMAND PROMPT AS ADMINISTRATOR.

IMPORTANT !!! From now on every executable must be started by first changing to the correct ADK directory, otherwise Windows will execute the .exe from your OS path!!!


### CREATE TWO WORKING DIRS: Create the following directories:

md c:\essentials-host-image
md c:\essentials-host-mount

### COPY ISO CONTENTS: Insert your Windows Server 2012 R2 ESSENTIALS CD and copy all files and folders (including subfolders) to c:\essentials-host-image



## CHANGE TO ADK DIR (one line):

cd "C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\DISM"

### MOUNT IMAGE: Mounts the image into a temp directory - takes a while (one line)

dism /Mount-Image /ImageFile:"C:\essentials-host-image\sources\install.wim" /Index:1 /MountDir:"C:\essentials-host-mount"

### FOR MY INFO ONLY (you don't have to execute the two lines below):
[ dism /Image:C:\essentials-host-mount /Get-Features > myfeatures.txt ]   
    --> print all features to file
[ dism /Image:C:\essentials-host-mount /Get-Packages > mypackages.txt]   
    --> print all packages to file

### THE MOST IMPORTANT: DEACTIVATE ESSENTIALS FEATURES (two lines):

dism /Image:C:\essentials-host-mount /Disable-Feature:"WSS-Product-Package"
dism /Image:C:\essentials-host-mount /Disable-Feature:"Microsoft-Windows-ServerEssentials-ServerSetup"

### COMMIT AND UNMOUNT IMAGE:

dism /unmount-Wim /MountDir:C:\essentials-host-mount /commit
### INFO ONLY: /discard instead of /commit discards

### CREATE ISO (change dir first, then create the ISO as C:\OEMEssentialsHost.iso (two lines below) :

cd "C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg"

oscdimg -m -o -u2 -udfver102 -bootdata:2#p0,e,bc:\essentials-host-image\boot\etfsboot.com#pEF,e,bc:\essentials-host-image\efi\microsoft\boot\efisys.bin C:\essentials-host-image C:\OEMEssentialsHost.iso

### BURN ISO TO CD
Burn your C:\OEMEssentialsHost.iso to a CD!

Congratulations! You should now have a Host-Only installer CD without the Essentials stuff. Don't forget to thank Microsoft for making your life so complicated.

Installation of the physical host OS from the modified ISO

Install the physical host OS form the ISO. After installation, if needed, you can remove some more features and add-ons you don't need through the normal server manager GUI - the aim is to have a cleaned up host OS.

Don't forget to install your Hyper-V role!

Then create your Hyper-V VM and install your virtual Windows Server 2012 R2 Essentials inside, this time from the original MS ISO, not from your modified host image!


Hope this helps!

Regards,

Anguel

5 comments:

  1. Anguel,

    thanx for this nice and clear procedure. It all worked just fine except for one little but cucial step. In the first step "### CREATE TWO WORKING DIRS" you say " COPY ISO CONTENTS: .... to c:\essentials-host-mount"
    This should be: " COPY ISO CONTENTS: .... to c:\essentials-host-image"

    Thanx again for the nice procedure!!

    Jan Schepers

    ReplyDelete
    Replies
    1. Jan, thank you for the comment! I have corrected it. Sorry for the stupid mistake.

      Delete
  2. Thx for the great walktrough!
    The ADK is working on server2012R2

    ReplyDelete
    Replies
    1. You are welcome. Thanks for the update.

      Delete
  3. we need more help like this for small businesses running WSE on minimal setups vitualized.

    I'm running WSE 2012 r2 DC vitualized. Is it OK or necessary to remove AD role from the host, i only need the host to be a local workgroup.

    Any tips on DNS setup with this situation of WSE virtualized, host not domain joined, and DHCP from my router?

    Thanks, larry

    ReplyDelete