Today I decided to get to a long overdue task – looking at Microsoft latest all up BI demo VM containing SharePoint 2010 and SQL 2012 RC0 which includes Power View. Now we know SQL 2012 went GA last week, but this demo was released a couple of months ago so has RC0 which was close to the RTM version anyway. On mssalesdemos.com you will find the download, its called “New SQL Server 2012-RC0 fully integrated Demo”.
Before you download from there beware that the download is split into many rar files and if you prefer a single download I suggest you go here instead. Be warned, the file is about 28.4Gb, so you will need a stable internet connection and are advised to use software that can resume downloads just in case the connection breaks. This will extract to about 65Gb, so have enough disk space on hand. You will need even more to get to the final result we are looking for.
Now, one problem you may face is that the demo is a Hyper-V image, which means unless you have a Windows Server 2008 environment available, you cant run it. I use VMWare Workstation for all my VM work for the demos and presentations I do. So I needed a way to convert this. Warning: converting it will cause Windows and Office on the image to be non-activated. I used my own TechNet keys to re-activate after conversion.
There are many resources online telling you how to perform the conversion. However I found I had to hunt around and collate information from a few sources to get it right. There are also a few traps that are not so fun. So, my aim was to save others trouble and have it all in one place. Warning: Back up your extracted VM first before following any steps below!
There are 2 ways I found to convert the image over to VMWare, kindly blogged by Jim Holmes (Twitter: @aJimHolmes)
- Create a Windows Virtual PC and then convert using VMWare VCenter Converter
- Convert the .vhd disk to a VMware compatible .vmdk and then create a native VMWare image attaching that disk instead
Option 2 needs the Professional version of WinImage, so I opted to go with Option 1 instead, which I admit is longer, but a good learning experience and will save you having to buy WinImage or similar. If anyone knows of a free tool to do this a comment would be great!
Step 1 – Try to create a Virtual PC
So, following option 1, I tried to create the VPC using the downloaded VHD but I got an error.
Some research led me to discover that this is because the VHD is too big – the limit for Virtual PC appears to be 127Gb, but the disk size in the demo is 250Gb. I found this out by simply mounting in in Windows 7 use the Disk Management are of the Computer Management console
And here it is:
I’d like to clear up potential confusion here – the “SQL2012-RC0-ImageX.vhd” file is 75Gb, but it’s a Dynamic Disk so this represents its physical size whereas the 250Gb is its logical size. Dynamic Disks are useful as they don’t pre-allocate space beforehand. On the other hand performance is affected a little.
So I needed a way to shrink this disk.
Step 2 – Shrink the VHD so that it is not too big for Windows Virtual PC
This can be done easily using VHD Resizer. However the problem is you cant shrink this disk because the partitions within it are occupying the whole disk. So first we need to shrink the partition represented by drive letter J in the above diagram. Any partition management tool will do the job, but you are need to defragment it first so you can get to the smallest possible size. This is because you cant make partition smaller than the furthest bit of data stored on it. I used O&O Defrag to do both at once, and chose to shrink the partition to 90Gb to leave some free space (15Gb). Heres the result:
Once this was done I was able to use VHD Resizer to shrink the disk. I detached it form the Computer Management console first. Note in the image below I picked a separate drive as the destination copy on purpose. This will be significantly faster than creating the new vhd on the same physical drive on your PC. On my system I achieved about 90Mb/s which still meant waiting 15 minutes.
Step 3 – Create VPC, then convert to a VMWare workstation image
Now that the vhd is resized we can create the Virtual PC and it wont give us the error we got in Step 1. Windows virtual PC will create 2 files for the new VM. Firstly, a .vmcx file which sits by default in C:\Users\<your_windows_user_name>\Virtual Machines. However, when you specify the location of the VM during creation it actually also creates a .vmc file in that location and this is the file that we will work with.
The comment at the end of the blog post guided me as to what was wrong, and it took me a while to find that post in the first place. There are a lot of irrelevant links on the Web for that Vcenter Converter error that can lead you on a wild goose chase. The fix for this is to open the .vmc file in a text editor (I use NotePad++) and change the <relative> node details to be a full physical path to the vhd.
Now VCenter converter will have no problems reading the file and will happily convert to your chosen VMWare format, including converting the disk to a .vmdk.
I converted it to a VMWare workstation 7 image and it worked fine! That’s it!