• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1468
  • Last Modified:

How to suspend and resume a virtual machine from the command line in Vmware 7 Workstation on XP Pro?

I need to be able to suspend a VM, do a backup and restart the VM on an XP Pro box using Vmware Workstation 7 from the command line.

Anybody done this?
0
cerksees
Asked:
cerksees
2 Solutions
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
The vmrun command is responsible for command line control of VMs in workstation.

yes it's possible

this is the suspend command usage

vmrun suspend "C:\Documents and Settings\<user>\My Documents\My Virtual Machines\WinXP\WinXP.vmx"

You may want to complete the operation when the virtual mnachine is live, so you would create a snapshot with the follwowing command

vmrun -T ws snapshot /path/to/vm/Ubuntu/Ubuntu.vmx mySnapshot

and then copy the vmdk as before, and then delete the snapshot afterwards, this is how many third party backups operate.


Here's the PDF manual for reference to other commands.

http://www.vmware.com/pdf/vix160_vmrun_command.pdf
0
 
cerkseesAuthor Commented:
To be clear, here are the two commands that I used exactly as I used them.

To SUSPEND Vmware Workstation's running virtual machine on Windows XP Pro...
vmrun -T ws suspend "C:\Documents and Settings\User\My Documents\My Virtual Machines\Windows Server 2003 Enterprise Edition\Windows Server 2003 Enterprise Edition.vmx"

Open in new window


To RESTART the same vm after my backup ran on Windows XP Pro...
vmrun -T ws start "C:\Documents and Settings\User\My Documents\My Virtual Machines\Windows Server 2003 Enterprise Edition\Windows Server 2003 Enterprise Edition.vmx"

Open in new window


Enjoy.
0
 
NVITCommented:
I'm confused... The OP didn't mention doing the suggested snapshot in his post of the steps he took.

1. What is the purpose of the snapshot step http://www.experts-exchange.com/Software/Virtualization/Q_27025853.html#a35719102 above?

2. Do you do both the SUSPEND command before that and then the SNAPSHOT command?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now