Hi - i am trying to get the "revertToSnapshot" command working for vmrun (running it from inside a perl script).
I've been trawling through Google but there does not seem to be an answer i can find, hence why i am posting here as a last resort
The command line is in the format:
vmrun -h 127.0.0.1 -u nonrootuser -p nonrootpassword revertToSnapshot /full/path/to/image/vmxfile.vmx
The error message i get back is:
"Error: Command failed: The system returned an error. Communication with the virtual machine may have been interrupted"
Inside the /var/log/vmware/ vmware-serverd.log file, i see the following readouts:
"Oct 02 21:47:06: app| New connection on socket server-vmdb from host localhost (ip address: 127.0.0.1) , user: nonrootuser
Oct 02 21:47:06: app| SP: New user session for user: nonrootuser, pos: 1
Oct 02 21:47:06: app| The vm-list file has changed! Reloading the list of registered vms
Oct 02 21:47:06: app| SP: Rejecting command base on path: : 1
Oct 02 21:47:06: app| vmdbPipe_Streams Couldn't read: OVL_STATUS_EOF
Oct 02 21:47:06: app| SP: Deleting user session: 1 username: nonrootuser "
However, when i replace "revertToSnapshot" with "start" or "stop", vmrun allows the "nonrootuser" to start and stop the VM.
It is only giving me an error on "revertToSnapshot" - but i really need to use "revertToSnapshot" and not "start" or "stop".
I have tried vmrun with "revertToSnapshot" and passing the credentials "-u nonrootuser -p nonrootpassword" while being logged into a BASH terminal shell under both the "root" and "nonrootuser" accounts and the result is always the same: "start" or "stop" are allowed but not "revertToSnapshot".
FYI, I am using VMware-server 1.0.9 installed on Ubuntu 8.10 (Intrepid Ibex) and i've confirmed that the vmx file has read-execute permissions for the others group (chmod o+xr).
Changing all files inside the VM's directory to become read-execute for others (chmod o+xr) does not help, nor does changing the ownership of the files from root to nonrootuser, i.e. chown nonrootuser:nonrootuser <filenames> (in fact, the latter is a step backward because it causes vmrun to fail when run by root).
I have also tried adding "nonrootuser" to have no-password-required access to vmrun under /etc/sudoers and running vmrun using sudo but the problem is still there: "start" and "stop" work while "revertToSnapshot" returns the error message.
What i would greatly appreciate is if anyone can tell me:
(1) whether vmrun "revertToSnapshot" works when run with non-root credentials at all?
(2) If yes, how do we make it work with a non-root credential being passed using the -u and -p flags (bearing in mind that i have already done the checking as described above).
Thanks in advance!
MK