在 Linux mint VirtualBox guest 上访问文件

发布于 2024-10-15 02:33:28 字数 162 浏览 4 评论 0原文

我有一个用于开发的 Linux virtualbox。我想要与主机操作系统共享的内容位于 /var/www 中。我尝试设置 samba 共享,但我似乎无法在网络上看到我的 virtualbox。有谁知道我该怎么做?我进行了搜索,但我发现的唯一的东西是 virtualbox 的共享文件夹,这并不完全是我想要的。

I have a Linux virtualbox that I use for development. The stuff I'd like to share to the host operating system resides in /var/www. I tried setting up a samba share, but I can't seem to see my virtualbox on the network. Does anyone know how I'd go about doing this? I searched, but the only thing I've found is virtualbox's shared folders which isn't quite what I'm looking for.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

情域 2024-10-22 02:33:28

默认情况下,VirtualBox 网络默认采用内部 NAT 实现,仅允许来宾访问网络,反之则不允许。

要从主机访问访客,您必须使用不同的网络模式

我的首选解决方案是仅主机网络,因为来宾在主机上显示为适当的联网计算机,而不会暴露在公共网络中。

桥接网络也可以,但您必须确保来宾的安全,就好像它是一台单独的计算机一样,并且可能存在不建议甚至不允许为单个物理 PC 使用两个 MAC 地址的网络。

无论如何,为什么共享文件夹不是您要查找的内容?

By default VirtualBox networking defaults to an internal NAT implementation, which only allows the guest to access the network and not the other way around.

To access the guest from the host you have to use a different networking mode.

My preferred solution is host-only networking, because the guest appears as a proper networked-machine on the host, without being exposed to the public network.

Bridged networking would also do, but you'd have to secure the guest as if it was a separate machine and there may be networks where having two MAC addresses for a single physical PC is not advised or even allowed.

Why aren't shared folders what you are looking for, anyway?

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