使用 VMPlayer 是否可以通过编程方式与主机创建共享文件夹?

发布于 2024-11-05 13:24:47 字数 177 浏览 3 评论 0原文

首选使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

枫林﹌晚霞¤ 2024-11-12 13:24:47

有 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

栖迟 2024-11-12 13:24:47

您需要将 VMPlayer 虚拟化硬件视为一台独立的计算机,在自己的硬件上运行自己的独立操作。这就是虚拟化的工作原理!

从技术上讲,主机甚至不知道它正在“运行”另一台计算机,因此它不会以不同的方式对待它。对于 GUEST 操作系统来说也是如此:您正在运行一个“vanila”操作系统,它没有理由以不同的方式对待它的主机计算机,对于 GUST 来说,主机只是可以通过本地网络访问的另一台计算机。

话虽这么说,你可以像这样重写你的问题:

我想创建一个应用程序,当从一台计算机运行时,该应用程序将在另一台计算机上的已知位置创建一个共享文件夹。一台计算机将运行 Windows XP 32 位,另一台计算机将运行其他版本的 Windows,可能是 Windows 7 x64

答案:当然不能这样做:这会造成安全漏洞! 如果能够创建共享文件夹,那么任何人都能够创建共享文件夹。任何人都可以在您计算机上的任何位置创建共享文件夹!

总而言之,如果您可以在主机上运行您的应用程序,而不是在访客上,您也许可以使用 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:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文