VMware Communities
tis
Contributor
Contributor

Not Able to start program in background using runProgramInGuest

Hi I am trying to start a program in the  background in a remote Vmplayer using vmrun.

I am using option runProgramInGuest. But when vmrun returns, the process started in remote vmplyaer is getting terminated.

Any suggestion ?

0 Kudos
4 Replies
vmroyale
Immortal
Immortal

Hello.

What is the exact syntax you are using, and what host and guest OS are you using?

Good Luck!

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com
0 Kudos
tis
Contributor
Contributor

Hi,

My  Host OS is Suse Linux 10 SP2. Guest OS is Suse 11.

I have a script in the Guest System which will start a binary. This binary will run continuously and communicate with another programme running in host system. After logging to guest system, if I run the script in background ( sh <myScript [arguments]> & ), the binary is running fine.

Now I tried to use runScriptInGuest first with following syntax ( from host system )

vmrun -T player  -gu <user id > -gp <password> runScriptInGuest <path to .vmx file>  "/bin/bash" "myScript with full path name [arguments] &"

This command is starting the binary in the guest and start communicating with binary in host, But after few seconds, the binary is getting killed. My observation is that, when vmrun returns, the binary is getting killed.

I tried to use runProgramInGuest with following synatx ( from host system )

vmrun -T player -gu <user id> -gp <password> runProgramInGuest <path to .vmx file> "/bin/bash" "myScript with fill path name [ arguments ] &"

With this also same problem observed. program started in guest but killed when vmrun returns.

0 Kudos
admin
Immortal
Immortal

I would not include "&" in the command line for the application. The way the application is started in the guest can already be in the background, since a new process is forked for it.

If you do not want vmrun to wait until an application exits in the guest, pass the -noWait option to vmrun.

0 Kudos
tis
Contributor
Contributor

Hi,

Thanks for the response . But still the problem is not solved. I removed the "&" but still the program starts and terminates in Guest OS when

vmrun returns. No luch with option "-noWait" also.

0 Kudos