1

I have a dev machine running on VM ware workstation.It is on my local host machine and running windows server 2012 with SP 2013 single server farm.

I want to be able to automatically create backups of the full VMware file on an external hard drive every couple days. But need help with how to do it.

Should I need to turn off the server before copying, or can I do it while its on? Is there a code I can run to interact with VM ware workstation to turn off and turn off?

Thanks

0

Should I need to turn off the server before copying, or can I do it while its on ?

Yes you should ensure that your virtual machine is in a powered off or suspended state,

To back up the virtual machine manually:

  • Ensure your virtual machine is in a powered off state.
  • Locate the virtual machine folder.
  • Right-click the virtual machine folder and click Copy.
  • Navigate to the folder in which you want to store the backup, right-click anywhere within the folder, and click Paste.

Is there a code I can run to interact with VM ware workstation to turn off and turn off?

To do it automatically via script : you should use VMRUN command that located as shown below

enter image description here

Steps : (you should replace the paths based on your environment)

  • Creating a backup script windows cmd file, for example, create a VMBackup.cmd file and enter: (Note : we consider that the VM is Running)
:: Suspend VM 
"C:\Program Files\VMware\VMware Workstation\vmrun" suspend   "F:\YourVMs\YourVMInstance\Windows Server 2012 Standard Edition.vmx"

:: ROBOCOPY (or xcopy) the files somewhere, pref a different box or network drive, for example         
Robocopy.exe F:\YourVMs\YourVMInstance\G:\externaldrive\backuparea\VMBackups\ /e /np /eta /r:1 /w:1/log:F:\VMScheduledBackups\Logs\YourVMInstance-BackupLog.txt

:: restart the VM  
"C:\Program Files\VMware\VMware Workstation\vmrun" start "F:\YourVMs\YourVMInstance\Windows Server 2012 Standard Edition.vmx"

You can now schedule this cmd file to run as a windows scheduled task in the normal way.

Note :

we consider that the VM is Running if it's not running add the following command before suspending command

"C:\Program Files\VMware\VMware Workstation\vmrun" start "F:\YourVMs\YourVMInstance\Windows Server 2012 Standard Edition.vmx"

For more details check Backing up VMware Workstation VMs

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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