Using Hyper-V to make a demo sandbox

I like to make my demos myself and to try and make them as near real world as possible however I have two problems:

  • There is always something new to show not just in SQL Server, but in Windows Server, SharePoint, Office etc. so I need a modular approach to fire up bits of infrastructure as needed.
  • I can’t rely on getting a connection back to the office so I have to take my demos with me.  This can still be problem, for example when I had a disk crash at SQL Bits which I later realised also had the system partition on it!  

I use a shuttle PC (called BINKY) with a quad core CPU, 8gb RAM and 3 x physical disks in it. This has Windows Server 2008 R2 installed with just the Hyper-V role on it.  From this I run all my virtual machines (VMs)…

image 

I typically run three VM’s at the same time; the Domain Controller (DC), a Windows 7 client and a SQL/SharePoint server. This setup means that all my service accounts are domain accounts as are any users who access reports, sites etc.

I could put the Domain Controller (DC) role on the physical machine but this can be restrictive, and anyway is not ‘real world’.  The key thing about this is the way I have setup networking and the virtual machine (VM) that is my DC ..

  • The physical server BINKY has a static ip of 10.10.10.10 which is easy to remember and connect to if i have to use a fixed ip address to get to it. 
  • I have five network connections setup..

image

Two of these are controlled by the Hyper-V Virtual Network Manager, the Internal Virtual Network, and the External Virtual Network (both highlighted). 

Hyper-V can’t use wireless networks but a lot of my demos need internet access so I have bridged (the bottom entry above) the wireless network to the Internal Virtual Network to achieve this.

The Local Area Connection is only set to have the Microsoft Virtual Network Switch Protocol enabled. Technically this is controlled by Hyper-V as well when you elect to use an external adapter and make it visible to the physical server..

image 

  • The last piece in the puzzle is that the VM running as a DC only connects to the External Virtual Network, and so the DNS and DHCP roles I have also setup on it are only available to a computer connected to BINKY via a hub and a cable.  This is how I connect my laptop to BINKY which enables me to remote desktop to any virtual machine (VM) running on BINKY, and thus means I can run my demos form one screen and use the power of my laptop to run any screen recording software (for which I use TechSmith Camtasia).  RemoteDesktop in windows 7/ Server 2008 R2 is very rich as you can see with a windows 7 remote desktop inside windows 7 …

image

 

Remote desktop also enables me to share local drives to get data and apps in and out the VMs 

With this setup all my VM’s have two adapters both of which have their ipv4 setting set to automatically detect, but can be resolved to the machine names as would happen in production.

My other tips for building demos with Hyper-V are:

  • To backup the VMs to another disk by using the export VM feature in Hyper-V, this picks up any snapshots etc. and allow that VM to be quickly deployed to another Hyper-V server, providing the names of the virtual networks (i.e. internal virtual network etc.)are the same.
  • Use snapshots  to roll back to the start of demos or if you are trying something like an install that you might want to rollback from and label them accordingly..

image 

  • Run the VMs on different disks to the physical OS if possible, or better yet get some solid state storage!
  • Some network adapters can run slowly when shared for virtual networking, if this happens disable the checksum offset features in the adapter properties (there are several of them (thanks to James for this).

image

  • Use virtual floppy disks. these can be mounted and un-mounted on virtual machines to enable you to quickly move scripts between virtual machines which can also be edited.
  • Don’t put other roles or applications on a Hyper-V server, unless you have to.

Hopefully this is useful for anyone wanting to make a demo or sandbox environment but just be clear there is quite different best practice if you’re using Hyper-V in production and there are numerous posts on that including my favourite  - Best practices for running SQL Server on Hyper-V