1
I do a lot of software development as a hobby, and in order to test changes, reproduce bugs, etc, I find that I frequently need a clean Windows environment to run my tests.
I can fire up a VM in order to do this, but this typically requires finding the Windows 8.1 ISO, creating a new VM, booting it up, doing the full install (off to look up my "throwaway VM" MSDN key), install all my software, etc. Frankly it's too much work for any but the most significant issues.
I can't just retain a clean snapshot of my VM because I tend to leave the VM un-activated (that's what happens by default anyway, and it's Microsoft's advice for managing throwaway test VMs on MSDN keys) and by the time I next use it, the activation grace period is expired.
What I've thought of doing is creating an automated script to build a new VM, including all my key software, on demand. But most of the deployment automation tutorials I've found (using MDT or sysprep) seem to be targeted at larger-scale deployments. I've tried MDT, but it seems pretty hard to install custom software into the image (for example, the Virtualbox Guest Additions). I've also tried sysprep, but whatever I've done, I still end up needing to manually do some of the install steps.
What is a good way of setting up (and maintaining) a custom install disk and scripts that will let me run an unattended deployment of test VMs reasonably quickly?
(I currently use VirtualBox as my software - I have access to Hyper-V and have been thinking of giving it a try, but I'm not sure if it'll help. The problems I have seem to be more about the unattended install side of things than about creating the VM).
Update A year on, I never really got any closer to a solution. I tried sysprep, but couldn't find a way to manage keeping the image up to date with Windows update, etc (you can only rerun sysprep a certain number of times, AIUI). I tried MDT, but it's way too complicated for my needs.
One alternative option, which I didn't really mention in the original question: I could use one of my MSDN keys to activate my base image, and then clone as needed. Does that work? Specifically, can I clone copies of my base machine "on demand" without invalidating my activation? If I can, then just maintaining an activated base machine for each Windows version I want to use may be a better approach. Are there any pitfalls with this approach that I've not considered? I'd hate to end up invalidating my keys by trying this.
You create unattended virtual machines the same way you create unattended install for physical machines. What step do you need help with specifically? – Ramhound – 2015-06-02T16:11:39.143
Well, basically, how to start. The MDT documents I've found talk about having 3 or 4 machines involved in the process, and don't really discuss including non-MS software (specifically, VirtualBox guest additions and Python). I tried a simple MDT install on my laptop, and got a cmd prompt, but no task sequence running (I suspect Virtualbox networking not letting the VM see the share on my PC). So how do I run MDT on a single machine, not in a domain, deploying to a Virtualbox VM? – Paul Moore – 2015-06-02T17:20:32.143
Alternatively, is there a better approach for this scenario than MDT? Sysprep seems like an alternative, but I've not used it for some time (and never got a completely unattended install that way, from what I recall). – Paul Moore – 2015-06-02T17:24:06.810
If you are willing to use Hyper-V you can mount the virtual hdd, apply a .wim image to it ( after creating the partition ), then start the virtual machine, with a little work he can make this process nearly automated. – Ramhound – 2015-06-02T17:33:26.650