Page 1 of 1

How do I run a clean win10 each time?

Posted: 17. Feb 2016, 12:16
by P a u l
I want to install win10 as guest, authenticate it, run windows update, and then somehow save this as a snapshot. I want to repeatedly run software install tests against a clean copy of win10. When exiting the virtual machine I want to discard all the changes I made during the session so that the next time I run the virtual machine it is restored to it's clean install state.

I am not interested in running multiple copies of win10 from one key. Just want to always start the single machine clean each time.

Re: How do I run a clean win10 each time?

Posted: 17. Feb 2016, 12:28
by jorgensen

Re: How do I run a clean win10 each time?

Posted: 17. Feb 2016, 13:12
by mpack
There's a couple of ways you could do it. One is immutable images as Jorgensen indicates. My problem with that is that you don't get much option about when the reset occurs: next time you start the VM you start from scratch, and maybe you might want your testing to include rebooting a VM a few times.

The other option: this might be one of the few good use cases for linked clones. Create your base VM to the state you want, then create a linked clone. When you no longer want the linked clone you can delete it. I.e. you get to choose when that happens. The problem with this is that the base VM is frozen the instant you create a linked clone from it, and you can't go back: it might seem like you can, but the base VM is really now a linked clone of itself. This will get complicated when you want to apply Windows Update to the base VM.

A final option, slower but far more robust: get the VM to the state you want, then make a full backup of the VM folder. Then you can do what you like to the VM, and to restore the old state you just copy the files back from the backup. Windows Updates are easy with this model. I would go for this (a) because the files aren't going to be that big on a fresh Windows install, and (b) I don't mind going for a coffee while the files are copying.

Re: How do I run a clean win10 each time?

Posted: 17. Feb 2016, 20:18
by jorgensen
mpack wrote:There's a couple of ways you could do it. One is immutable images as Jorgensen indicates. My problem with that is that you don't get much option about when the reset occurs: next time you start the VM you start from scratch, and maybe you might want your testing to include rebooting a VM a few times.
Actually there is way to prevent this as described, and properly 'multiattach mode' is was is requested.

Re: How do I run a clean win10 each time?

Posted: 17. Feb 2016, 21:04
by P a u l
Apologies for not reading the manual. I created a new VM install with win10 pro from an ISO and activate it with my old win8.1 key (no clue why the key worked.)
I don't understand multiattach. I will backup the VM, and then use snapshots. From what I can tell, snapshots work a lot like backups and I can have any number of them for restore.

Re: How do I run a clean win10 each time?

Posted: 17. Feb 2016, 21:17
by jorgensen
P a u l wrote:I will backup the VM, and then use snapshots. From what I can tell, snapshots work a lot like backups and I can have any number of them for restore.
Yes, snapshots are great until they fail, and you have to revert to the original vm, losing everything in the snapshots.

Re: How do I run a clean win10 each time?

Posted: 17. Feb 2016, 21:39
by P a u l
jorgensen wrote:
P a u l wrote:I will backup the VM, and then use snapshots. From what I can tell, snapshots work a lot like backups and I can have any number of them for restore.
Yes, snapshots are great until they fail, and you have to revert to the original vm, losing everything in the snapshots.
How often do they fail? If one snapshot fails do they all fail?

Re: How do I run a clean win10 each time?

Posted: 17. Feb 2016, 21:57
by jorgensen
P a u l wrote:How often do they fail? If one snapshot fails do they all fail?
Just search the forums about snapshots, and you will learn, e.g.
viewtopic.php?f=6&t=76218&hilit=snapshot
As said, as long as you are aware of you may loose information, snapshots are great.
Unfortunately Virtualbox does not have a recovery tool for these fails.
You may create a secondary writethrough storage, which is not affected by snapshots - check the manual for this.

Re: How do I run a clean win10 each time?

Posted: 17. Feb 2016, 21:59
by scottgus1
snapshots work a lot like backups
Snapshots work almost, but not quite, something almost entirely UNlike backups. (Hitchhiker's Guide semi-quote there)

Snapshots are very much like the System Restore points on a Windows OS. They also hold any new data stored in the guest since the snapshot was made. They are dependent on earlier snapshots and will kill the guest if a snapshot file dies or gets deleted outside of Virtualbox.

Snapshots make a guest more delicate and do not work as backups. They should only be used on guests you're experimenting with and with data you wouldn't mind losing. (The forums are replete with users destroying their important data because they did something wrong with a snapshot.)

A full backup along the lines of this tutorial Moving a VM is best. Re-interpret it as "Backing Up a VM".

Re: How do I run a clean win10 each time?

Posted: 18. Feb 2016, 01:04
by P a u l
mpack wrote: A final option, slower but far more robust: get the VM to the state you want, then make a full backup of the VM folder. Then you can do what you like to the VM, and to restore the old state you just copy the files back from the backup. Windows Updates are easy with this model. I would go for this (a) because the files aren't going to be that big on a fresh Windows install, and (b) I don't mind going for a coffee while the files are copying.
I guess I will go with backups for now. Didn't know snapshots were unstable.

BTW I tried a clone, but the clone lost it's windows activation. Is this typical?

Re: How do I run a clean win10 each time?

Posted: 18. Feb 2016, 01:41
by BillG
P a u l wrote:Apologies for not reading the manual. I created a new VM install with win10 pro from an ISO and activate it with my old win8.1 key (no clue why the key worked.)
It would not work with the original release of Windows 10 (build 10240), but since build 10586 (November 2015, also called version 1511) you can install and activate Windows 10 with a valid Win 7/8.1 product key. After it has activated, you can do a clean install without entering any product key and it will activate.

What does not work with Windows 10 is creating a new vm from an existing virtual hard drive of an activated Win 10 install (which used to work with provious Windows OS versions). It will not activate because the machine no longer matches the digital entitilement used for activation in Windows 10.

Re: How do I run a clean win10 each time?

Posted: 18. Feb 2016, 02:01
by P a u l
BillG wrote:
P a u l wrote:Apologies for not reading the manual. I created a new VM install with win10 pro from an ISO and activate it with my old win8.1 key (no clue why the key worked.)
It would not work with the original release of Windows 10 (build 10240), but since build 10586 (November 2015, also called version 1511) you can install and activate Windows 10 with a valid Win 7/8.1 product key. After it has activated, you can do a clean install without entering any product key and it will activate.

What does not work with Windows 10 is creating a new vm from an existing virtual hard drive of an activated Win 10 install (which used to work with provious Windows OS versions). It will not activate because the machine no longer matches the digital entitilement used for activation in Windows 10.
I am using a win10 ISO I downloaded this morning, it's 1511.
I am finding that the activation has been lost with some of my testing with virtualbox snapshots and clones. I am now experimenting with just using backup copies as per mpack above.

Re: How do I run a clean win10 each time?

Posted: 18. Feb 2016, 10:56
by mpack
I thought you only wanted the additional VMs for installation tests? In which case there was no need to activate the clones, unless Win10 makes the grace period much tighter.

Re: How do I run a clean win10 each time?

Posted: 18. Feb 2016, 20:13
by P a u l
mpack wrote:I thought you only wanted the additional VMs for installation tests? In which case there was no need to activate the clones, unless Win10 makes the grace period much tighter.
You are correct -- I tend to latch onto things that aren't that important. I was unsure of how long I had until win10 bricked up however.

Re: How do I run a clean win10 each time?

Posted: 18. Feb 2016, 20:23
by Martin
Do you want to run just this single machine or do you need different test versions at the same time?
If you just want to run your test installation for a few hours/days and then go back to the clean "pre-install" state, I would just use a snapshot.
Snapshots only get difficult/dangerous if you do several on top of each other and/or keep them active for a long time.
After taking a snapshot every change to the disk gets written to the snapshot file, the original disk file is "frozen".
Then when you are finished you restore the snapshot which brings you back to the clean pre-install state.