多台 VirtualBox 机器之间的网络链接
我正在尝试一个会议应用程序(BigBlueButton)。
为此,我创建了一个 Ubuntu 虚拟机作为应用程序服务器。在这台计算机上,我可以通过导航到应用程序 URL(例如 http://10.0.2.15)来测试应用程序。
我还创建了第二个虚拟机,它应该充当客户端。在这台机器上,我也希望能够导航到服务器,但这似乎不起作用。如果我尝试使用 app-url 从客户端导航到服务器,我什么也得不到,然后超时。
要在两台计算机之间建立网络,我尝试了以下解决方案:
- 在每台虚拟机上创建第二个网络适配器,并附加到名称为“vboxnet0”的“仅主机适配器”
- 在每台计算机上创建第二个适配器并附加到“内部网络” ”命名为“intnet”。
我认为上述任何一个选项都是一个很好的解决方案,但它们都不起作用。
有人可以帮我吗?
仅供参考,我使用 MacOS X 作为主机系统。
编辑: 我通过克隆第一台机器(使用克隆实用程序)创建了第二台机器。也许这会导致两台机器相同,从而使它们在网络上无法区分。这会引起问题吗? (作为一名桌面开发人员,我在 IT 方面有点菜鸟)
I am trying out a conferencing application (BigBlueButton).
For this I created an Ubuntu virtual machine that functions as the application server. On this machine I can test the application by navigating to the app url (for example http://10.0.2.15).
I also created a second virtual machine that should function as a client. On this machine I want to be able to navigate to the server as well, but that doesn't seem to be working. If I try to navigate from the client to the server by using the app-url I get nothing, followed by a timeout.
To establish a network between the two machines I tried the following solutions:
- Create a second network adapter on each virtual machine and attach to "Host-only Adapter" with name "vboxnet0"
- Create a second adapter on each machine and attach to "Internal network" named "intnet".
I thought that either of above options would be a good solutions, but none of them works.
Can anyone help me out here?
FYI I am using MacOS X as host system.
EDIT:
I created my second machine by cloning the first one (using the clone utility). Maybe this causes both machines to be identical which makes them indistinguishable on a network. Would this cause a problem? (As a desktop developer I'm a bit of a noob when it comes to I.T.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我刚刚开始工作。我所做的是在两个虚拟机上使用有品味的名称的内部网络,但然后我进入高级并将混杂模式设置为“允许全部”。我现在连接得很好。试试吧!
好的,只是查看了日期,最后更新时间为 2009 年,但对于任何寻找答案的人来说,就在这里!
I just got this to work. What I did was the internal network with the tasteful name on both VMs, but THEN I went to Advanced and set the Promiscuous Mode to "Allow All". I connect just fine now. Try it!
OK, just looked at the dates and it was last updated 2009, but for anyone looking for the answer, here you go!
如果你克隆了机器并且没有更改IP,它们将永远不会连接......
另外,请确保您尝试访问的网址上有某些内容正在监听。
每台机器应该有不同的ip
(当然是在同一个网络上)
IF you cloned the machine and didn't change the ip, they will never connect...
Also - make sure there is something listening on the url that you're trying to reach.
each machine should have a different ip
(but on the same network of-course)
将您创建的接口设置为内部网络。选择一个有品味且有趣的名称,例如“mynet”。使用该名称作为两个虚拟机的网络名称,它们将自动能够通过这些接口相互通信。
抱歉,我看到你已经这么做了。在这种情况下,只需在“内部网络”类型的接口上为这两台机器提供静态 IP 地址即可。例如 192.168.0.2 和 192.168.0.3。
另外,更改 IP 后,请确保服务器正在侦听正确的接口。
Set the interfaces you created to internal networking. Choose a tasteful and interesting name, like "mynet". Use that name as the network name for both of the virtual machines and they will automatically be able to talk to each other over those interfaces.
Sorry, I see you already did that. In this case just give those two machines static IP addresses on the interfaces of "internal networking" type. Like, 192.168.0.2 and 192.168.0.3.
Also, once you've changed the IPs make sure the server is listening on the right interface.
我意识到这早就该发生了……但我刚刚完成设置,并且能够互相 ping 通每一台虚拟机。
假设您像我一样运行 boot2docker,只需右键单击 boot2docker VirtualBox 中的虚拟机并单击克隆。在弹出的框中,请务必选中“重新初始化所有网卡的 MAC 地址”框,以便两个虚拟机不会具有相同的 MAC 地址。
就是这样,似乎对我有用。我可以从另一个虚拟机或从我的主机对虚拟机进行 ping、扫描(通过 nmap)甚至 SSH。
I realize this is long overdue... But I just got mine set up and am able to ping each virtual machine from one another.
Assuming you're running boot2docker like I am, simply right-click the boot2docker VM in VirtualBox and click clone. In the box that pops up, be sure to check the box that says "Reinitialize the MAC address of all network cards" so that the two virtual machines don't have the same MAC address.
That's it, seems to be working for me. I can ping, scan (via nmap) and even SSH into the virtual machines from one another or from my host machine.