VMware Communities
alijens
Contributor
Contributor

vmrun guest oeprating system commands failing

I cannot get the vmrun command to work on an XP VM when logged into the VM as an admin.

The error when running the command line from the host is:

"Error: Command failed: Guest operations are not allowed for the anonymous user on this virtual machine".

What am I not doing to get this to work (I was just doing a vmrun fileExistsInGuest.. command)?

vmrun commands operating on the guest system (i.e. start, stop etc.) have worked fine - just not ones which operate within the system.

Thanks

0 Kudos
9 Replies
RDPetruska
Leadership
Leadership

I believe you need to first use the vmrun -u and -p parameters to log in to the guest along with those commands. It might be easier to build a script using the Vix API - then you only need to login once.

0 Kudos
admin
Immortal
Immortal

Actually, you will need to use the -gu and -gp parameters to specify a username and password for the guest operating system. The two parameters that Rob mentioned are for logging into remote hosts and should only be used when using vmrun with VMware Server*.

An example of how to these parameter is:

vmrun -gu user -gp password listProcessesInGuest C:\VMs\winxp.vmx

\* The version of vmrun that ships with Workstation 6.0 isn't compatible with Server 1.0. To use vmrun against Server, please use the version that comes with Server.

0 Kudos
RDPetruska
Leadership
Leadership

Ahh, thanks for the correction, Matt. I just ran the vmrun with no parameters to display the help, and saw those options... haven't actually used them myself yet.

0 Kudos
eroberer4u
Contributor
Contributor

mattrich, or anybody, can you tell me if the command that you listed as an example has to be run from within the guest OS, or just on the host OS?

I'm actually looking for an easy way to get the IP Address of a Guest VM that I've just started. This would be primarily with Linux host and guest OSes, is I was thinking of a way to run "ifconfig" on the guest OS.

0 Kudos
admin
Immortal
Immortal

The command should be run from the host OS. vmrun does not run in the guest.

vmrun will let you get the IP address from ifconfig. You can write a shell script that calls vmrun three times, one with the command runProgramInGuest to run ifconfig and redirect its output to a file, then copyFileFromGuestToHost to copy the file with the output, and then deleteFileInGuest to clean up.

0 Kudos
eroberer4u
Contributor
Contributor

That's awesome. I hadn't thought of doing that, and unfortunately I don't have time to do it right now. Can you tell me, do any of those three commands require that VM tools be installed on the guest OS?

I'm asking because I kept repeatedly trying to do "vmrum listProcessesInGuest" with various options, and I never could get a list of processes to show up on my host system somehow. I'm not exactly sure how this command is supposed to work, but something gave me the impression that VM tools had to be installed on the guest OS, and unfortunately that is not really an option.

Any examples using "listProcessesInGuest"? 😃

0 Kudos
admin
Immortal
Immortal

Yes, all guest operations in vmrun require that VMware Tools be installed on the guest.

Having a program running inside the guest (that is to say the Tools) is the only real way of interacting with the guest at this high level.

Why do you say that installing tools is not an option for you?

0 Kudos
eroberer4u
Contributor
Contributor

Thanks for the explanation. I actually couldn't find any explanation for how to install and configure the VMWare tools without a GUI. There are parts that can be done from the command line, but configuring them looked like it required a GUI. I haven't really gotten a chance to play around with these much, though.

0 Kudos
figologin
Contributor
Contributor

another problem is when my guest OS has an account "administrator" but no password.

when i try to use this command:

vmrun -gu administrator -gp runProgramInGuest C:\VMs\winxp.vmx xxx.bat.

it failed:

Error: Command failed: Guest operations are not allowed for the anonymous user o

n this virtual machine

i also have tried this which also failed:

vmrun -gu administrator -gp "" runProgramInGuest C:\VMs\winxp.vmx xxx.bat.

logs are:

Error: Command failed: Authentication failure or insufficient permissions in gue

st operating system

what the problem is it? thanks

0 Kudos