使用 VMPlayer 是否可以通过编程方式与主机创建共享文件夹?
首选使用 Delphi 进行回答,但任何解决方案都会有帮助。
我想要做的是创建一个应用程序,当从 VMPlayer 内运行时,它将创建一个共享文件夹到主机上的已知位置。
VMPlayer 将运行 Windows XP 32 位,主机也运行 Windows 操作系统,也可能运行 Windows 7 x64。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有 vmrun.exe 实用程序可用于控制 VM。请参阅:
http://www.vmware.com/support/developer/ vix-api/vix110_vmrun_command.pdf
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
您需要将 VMPlayer 虚拟化硬件视为一台独立的计算机,在自己的硬件上运行自己的独立操作。这就是虚拟化的工作原理!
从技术上讲,主机甚至不知道它正在“运行”另一台计算机,因此它不会以不同的方式对待它。对于 GUEST 操作系统来说也是如此:您正在运行一个“vanila”操作系统,它没有理由以不同的方式对待它的主机计算机,对于 GUST 来说,主机只是可以通过本地网络访问的另一台计算机。
话虽这么说,你可以像这样重写你的问题:
答案:当然不能这样做:这会造成安全漏洞! 如果您能够创建共享文件夹,那么任何人都能够创建共享文件夹。任何人都可以在您计算机上的任何位置创建共享文件夹!
总而言之,如果您可以在主机上运行您的应用程序,而不是在访客上,您也许可以使用 VmWare API 来执行某些操作,但据我所知,免费的 VmPlayer 不提供该 API。此外,如果您可以在来宾和主机上运行应用程序,您就可以做任何您想做的事情。
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:
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.