Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

How to start a windows and run dedicated programs then revert to original status

I wonder know if there is a way,

Can let me start up a Windows (which including my custom environment: Ruby, Ruby on Rails ready )

And execute the dedicated process,(some environment could be dirty/changed)

So after that, shut down the Windows and revert it to original status.

Next time when I can do the same thing within a clean environment.

I prefer the above job can be done in Ubuntu OS, and virtual machine (Vmware, virtualbox, ...)

Any ideas, Thanks in advance.

share|improve this question

2 Answers 2

They invented Vagrant for this, you can defined a base image, boot the image, run scripts and install software from its configuration to make sure you and everyone else in your team always has the same machine. Bring it down, bring it back and ask for a clean machine all from the command line.

Vagrant supports both Linux and Windows guests.

It uses VirtualBox and supports Puppet or Chef scripts for easy maintenance.

You can use Vagrant to setup a new clean test environment before each test run. If the developer use the same setup with Vagrant you will never hear it works on my machine again :)

share|improve this answer
    
So I can use the Vagrant on my host os (Ubuntu) and run a M$ Windows, right ? Thank you so much –  poc Jun 12 at 15:28
    
@poc Yes, I havent tried it my self, but here is a blog post about running Windows server under Ubuntu: jongalentine.com/2012/12/22/… more info in this question: serverfault.com/questions/331953/… –  Niels van Reijmersdal Jun 12 at 16:54

VMWare ESX/Workstation and VirtualBox both have robust CLI's provided by the integration of their respective guest plugins. These CLI's allow you to configure everything from system hardware to power status and snapshot management. You would basically have a script that passes the startup command the respective CLI, call the test, pass the shutdown command to the respective CLI, and the pass the snapshot revert command to the CLI.

The VirtualBox commands you want are snapshot, startvm, and controlvm. These commands are detailed here:

https://www.virtualbox.org/manual/ch08.html

The VMWare CLI commands you want are vmware-cmd start, vmware-cmd stop, and vmware-cmd revertsnapshot. You can find their extensive documentation here:

http://pubs.vmware.com/vsphere-55/index.jsp?topic=%2Fcom.vmware.vcli.ref.doc%2Fvcli-right.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.