如何允许 Delphi XE2 从运行 Windows 7 的 VirtualBox VM 中查看 Mac 上的共享文件夹
我在 MacBook Air 上的 VirtualBox(最新版本,4.1.4)下运行 Windows 7 64 位旗舰版。我在 Mac 上的用户文件夹下创建了一个共享文件夹。我已将此文件夹的读/写权限授予我的帐户。 (我还为每个人配置了读/写访问权限,但这没有什么区别。)
在 VirtualBox 下的 Windows 7 中,我已将该文件夹添加为共享文件夹。
在我的 Windows 7 VM 中,我可以使用 Windows 资源管理器查看此文件夹、在其中创建新文件夹和文件以及读取文件夹和文件。
问题出在 Delphi XE2 上。如果我尝试打开项目或将项目保存到此共享文件夹,则从“保存”对话框中,共享(我当前已映射到网络驱动器)会显示一个红色 X 图标,表明它存在问题。如果我单击此文件夹,Delphi 将显示一个标题为“恢复网络连接”的对话框,并显示一条消息“将 E: 重新连接到 \VBOXSVR\Demos VirtualBox 共享文件夹时发生错误:不支持该请求。此连接不支持”已恢复。”
我无法将项目保存在该共享文件夹中,这限制了我使用 Delphi 的 dpr2xcode.exe 实用程序轻松创建 iOS 应用程序和生成必要的 Xcode 文件夹的能力。我要做的是在本地创建项目文件夹,运行 dpr2code.exe 生成 Xcode 项目,然后使用 Windows 资源管理器将本地文件夹的内容复制到共享文件夹,然后我可以在其中加载生成的项目Xcode 中的项目,编译并运行它。
有谁知道我可以采取任何配置或步骤来允许 Delphi 将共享文件夹视为有效文件夹?
作为记录,我在其他版本的 Delphi 中看到了类似的问题,涉及在 Windows 7 主机下运行的 VMWare Workstation (8.0) 中的 Delphi 安装中的文件夹。在这些情况下,Delphi 根本不显示共享文件夹。
I am running Windows 7 64-bit Ultimate under VirtualBox (latest version, 4.1.4) on my MacBook Air. I have created a shared folder on the Mac under my user folder. I have granted read/write privileges to this folder to my account. (I also configured it with read/write access to everyone, and that did not make a difference.)
In Windows 7 under VirtualBox, I have added that folder as a shared folder.
From within my Windows 7 VM, I can see this folder, create new folders and files in it, and read folders and files, using Windows Explorer.
The problem is with Delphi XE2. If I attempt to open or save a project to this shared folder, from the Save dialog box the share (which I have currently mapped to a network drive) appears with an red X icon indicating that there is something wrong with it. If I click on this folder, Delphi displays a dialog box with the title "Restoring Network Connection" and a message "An error occurred while reconnecting E: to \VBOXSVR\Demos VirtualBox Shared Folders: The request is not supported. This connection has not been restored."
That I cannot save projects in that shared folder inhibits my ability to easily create iOS apps and generate the necessary Xcode folders using Delphi's dpr2xcode.exe utility. What I have to do instead is to create the project folder locally, run dpr2code.exe to generate the Xcode project, and then to use Windows Explorer to copy the contents of the local folder to the shared folder, where I can then load the generated project in Xcode, compile, and run it.
Does anyone know of any configuration or steps I can take to permit Delphi to see the shared folder as a valid folder?
For the record, and I have seen a similar problem with other versions of Delphi with respect to Folders from a Delphi installation in VMWare Workstation (8.0) running under a Windows 7 host. In those cases, Delphi simply does not display the shared folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将您的虚拟机切换到“桥接”网络而不是 NAT。
在 VBox 中,选择您的 VM,转到“设置”>“网络>适配器1>将“附加到”更改为“桥接适配器”
我猜您已经在 OSX 主机上启用了 SAMBA 共享(系统偏好设置 > 共享 > 文件共享(将其打开) > 选项 > 勾选“共享文件和使用 SMB (Windows) 的文件夹”)
您需要桥接网络的原因是为您的 VM 分配自己的 IP 地址,而不是共享 OSX 主机的 IP(这就是 NAT 的作用)。
试一试,如果有帮助请告诉我:)
Switch your VM to "Bridged" networking as opposed to NAT.
In VBox, select your VM, go to Settings > Network > Adapter 1 > change "Attached to" to "Bridged Adapter"
I'm guessing you've already enabled SAMBA sharing on the OSX host (System Preferences > Sharing > File Sharing (switch it on) > Options > tick "Share files and folders using SMB (Windows)")
The reason you want Bridged networking is so that your VM is assigned its own IP address, rather than sharing the IP of your OSX host (which is what NAT does).
Give it a shot, let me know if it helps :)