3

Answer using Delphi preferred but any solution would be helpful.

What I'd like to do is to create an app that when run from within VMPlayer will create a shared folder to a known location on the host.

The VMPlayer will be running Windows XP 32bit, the host running a Windows OS as well probably Windows 7 x64.

TheSteven
  • 900
  • 8
  • 23
  • From within VMPlayer you can manually create a host/client shared folder by going under Settings/Options/Shared Folders. I am hoping to be able to create an application (something that could be run from within the client OS) that could create such a shared linkage as opposed to setting up manually. Because this is VMWare Player and I won't have (or want) access to the enduser systems host systems so I cannot use solutions that require VMWare Server or the like. – TheSteven May 08 '11 at 23:20
  • @TheSeven, when talking about VmWare virtualization, you should use the accepted vocabulary: You've got an HOST operating system running VmPlayer; VmPlayer is emulating hardware and on the emulated hardware you're running an GUEST operating system. You can run your own programs on either the HOST or the GUEST operating system. I'm not sure what "within VMPlayer" means: if you're pushing buttons on the VMPlayer itself you're basically using a program that's running on the HOST operating system. [...] – Cosmin Prund May 09 '11 at 07:07
  • [...] since you can only run your programs on GUEST or HOST, and you're saying you want your program to run "within VMPLayer" I'll assume you want it to run within the GUEST operating system. You can't create shared folders from within the GUEST operating system, it would render VmWare products unusable for "security testing". People often run unknown software on VmWare because they know doing so will *not* affect the host OS. But if malicious software could create shared folders from within the GUEST at will, it could infect the HOST! – Cosmin Prund May 09 '11 at 07:11
  • Cosmin - I sure you are right about the Guest system not being able to create a share on the host. It would be a major security violation. My bad, I wasn't thinking it through. If there is way to create a share programmatically (or possibly by using the command line?) it would have to be done from the Host side. Thank you for clarifying things. – TheSteven May 09 '11 at 22:52

2 Answers2

2

There is vmrun.exe utility that can be used to control VM. Look at:

http://www.vmware.com/support/developer/vix-api/vix110_vmrun_command.pdf

dmajkic
  • 3,448
  • 1
  • 18
  • 24
  • Thank you for the information, but I don't think it will be applicable to VMWare Player. I also will not have access to the end user's systems. – TheSteven May 08 '11 at 23:23
  • @TheSeven, first of all it *is* applicable to VmPlayer. Not all functionality is available, and I can't test rather shared folder creation is available on VmPlayer or not (I use Workstation), but it probably is because it's not listed as "not available". Second, how are you going to deploy VmPlayer and your VM image without accessing the user's system? VmPlayer is massively intrusive, it installs multiple drivers, might require a reboot: if you can do that, you can surely run a script to create a shared folder. – Cosmin Prund May 09 '11 at 07:02
1

You need to think of your VMPlayer virtualized hardware as an independent computer, running it's own independent operating on it's own hardware. That's the way virtualization works!

Technically the HOST doesn't even know it's "running" the other computer, so it's not going to treat it differently. The same is true for the GUEST operating system: you are running a "vanila" operating system, it has no reason to treat it's HOST computer differently, to the GUST the HOST is just an other computer accessible through the local network.

That being said, you can re-write your question like this:

I'd like to create an app that when run from one computer will create a shared folder to a known location on an other computer. One computer would be running Windows XP 32 bit, the other would be running an other version of Windows, probably Windows 7 x64

The answer: Of course you can't do that: it would create a security breach! If you're able to create the shared folder, anyone's able to create a shared folder. Anyone could create a shared folder to any location on your machine!

To wrap this up, if you could run your application on the HOST, not the GUEST, you might be able to use VmWare API to do something, but AFAIK the API is not available with the free VmPlayer. Also, if you could run applications on both guest and host you'd be able to do whatever you want.

Cosmin Prund
  • 25,498
  • 2
  • 60
  • 104
  • I disagree partly: If both host and VM-client are running in the same domain with a trust relationship, then yes this should be doable. If there's no domain, then you need to be part of the same workgroup (not sure if you can create shared folders in the latter case though). – Johan May 06 '11 at 10:08
  • @Johan, the most important part of my answer is saying there's nothing special about VmWare "hardware"; Again, if two normal computers are part of the same domain domain with a trust relationship they could do it, the "VM" part is irrelevant. Not that I know anything about domains... – Cosmin Prund May 07 '11 at 04:50
  • You can manually create a shared drive from within VMWare Workstation or VMWare Player that connects to one or more folders on the host machine by going under Settings/Options/Shared Folders. I have a legacy 16 bit app that is used by a number of my customers that they cannot run when they upgrade their systems to, for example, Windows 7 64bit. At the moment upgrading the app is not an option. XPMode using MS Virtual PC is not an option because of lack of a shared folder. Looking for a way (other than manually) to create the host/client share linkage. – TheSteven May 08 '11 at 22:49
  • @TheSeven, where are you doing `"Settings/Options/Shared Folders"`? I'm looking at my VmWare Tools (running within the GUEST) and I don't have such options. If you're talking about VmPlayer's "Settings" menu, that's technically running on the GUEST, not on the HOST. – Cosmin Prund May 09 '11 at 06:58
  • The settings are on the VMPlayer interface, not VMWare Tools. I was originally thinking that this was on Guest side. Thinking of it as part of the interface I would be more inclined to say it was part of the Host. Interesting question, I don't know enough of VMWare internals to do more than speculate. – TheSteven May 10 '11 at 01:38