In an attempt to minimize the disk space used by a bunch of Windows VMs I'm about to work with, I've tried to create a base image in the hope of using differencing disks. I'm nearly there but OOBE keeps running every time I boot a VM and I have to configure the language and admin password. How can I stop OOBE running on boot?
Here's what I've done so far:
- Create a VirtualBox VM with a 60GB expanding disk. 2GB RAM, 1CPU.
- Install Windows Server 2008 R2 and patch the OS using Windows Update.
- Run
sysprep
ticking the generalize option and shutting down the OS. - Remove the VM from VirtualBox Manager but keep the files.
- Attach the virtual disk (a .vdi file) from the VM created in #1.
- Modify the disk in Virtual Media Manager setting it as Immutable.
- Create a new VM selecting the disk from #6 as the main hard disk.
- Boot the new VM from #7.
- OOBE runs. Set the language, password and other prefs.
- Shutdown the VM.
- Start the VM from VirtualBox Manager.
- OOBE runs again.
Each VM that uses the Immutable disk get's a .vid file in it's snapshots directory, and changes made to the VM are persisted between sessions, that is, programs I install are still installed after a reboot, but OOBE runs every time. How can I stop it?
(I looked at the Vbox docs, so maybe I cheated...)
Your differencing disks by default will always reset themselves, so you'll be back at the beginning on a reboot unless you change the flag for the differencing disks.
However, what you really want to do is use the multi-attach disk choice instead:
You should use an unattend file to pass your desired parameters to your newly cloned VMs. Sysprep will present the OOBE screens unless you explicitly provides answers to each of them.
For more info, see: http://technet.microsoft.com/en-us/library/dd744512(v=ws.10).aspx