VMware Communities
Olivia
Contributor
Contributor

network access with vmrun

Has anyone ever had problems with network access when running a script on guest OS using vmrun?

I have a batch script that copies some files from a mapped network drive on my vm. It runs fine when called locally from the vm. When i run the script from the host, the script runs but it complains that "the system cannot find the drive specified".

My host is a linux machine, guest is winXP.

vmrun -gu test.bat

Any ideas?

0 Kudos
5 Replies
KevinG
Immortal
Immortal

Try with the full path to test.bat

Example:

vmrun -gu "c:\mydirectory\test.bat"

0 Kudos
Olivia
Contributor
Contributor

Thanks for your quick reply but the full path didn't help. The batch file actually runs, albeit with complaints.

It seems that the mapped network drive is not available when the batch file is run through vmrun. Any way to work around this?

0 Kudos
KevinG
Immortal
Immortal

I don't believe there is a workaround for this, the mapped drives are login specific and the process that it running the batch file is most likely not aware of the drive mapping. I believe this is the case and I will double check this for you.

0 Kudos
admin
Immortal
Immortal

Is the mapped network drive in the VM already authenticated? For example, I map z:\ to a network drive, but when I reboot and then try to access it, Windows Explorer asks me to authenticate with a dialog box. If you didn't already do this in the VM before running the script, that's likely the problem.

0 Kudos
admin
Immortal
Immortal

I think you might be able to use the "net use" command at the beginning of your batch script to map the network drive.

Just add a line like:

net use N:
computername\sharename password /USER:username

and then N: will be mapped to the network drive.

0 Kudos