A tech post after a very loooooooooooooooooong time!!!!
I use vmware in my office. Will do all the unit testing in VMs. (I do UT my code..)
Advantages of VM (Quite a lot.. Main two are here):
- Powersaving
- Can take snapshots and revert to them any time.
I was doing ssh and doing my testing. Whether my test succeeds or not, I had to revert the snapshot. For doing so, I had to go to my base machine (that hosts the VMs) by pressing the SCROLL LOCK buttons twice + NUMBER + ENTER key. (We use KVM switches to connect multiple CPUs to a single monitor/mouse/keyboard. If NUMBER is 1, it will connect to the first machine and so on.. ) As I was lazy (as usual :D) to do these, searched for command line tool that does that. And found vmrun.
This will be available on the base machine.
Commands for some important/commonly used operations:
To take a snapshot:
vmrun snapshot <PATH TO VMX FILE> <SNAPSHOT_NAME>
To list all snapshots:
vmrun listSnapshots <PATH TO VMX FILE>
To revert to a snapshot:
vmrun revertToSnapshot <PATH TO VMX FILE> <SNAPSHOT_NAME>
To start a VM:
vmrun start <PATH TO VMX FILE>
To stop a VM:
vmrun stop <PATH TO VMX FILE>
For more Info:
- vmrun –help
- This one too