从外部连接到 Vagrant VM [英] Connecting to a Vagrant VM externally

查看:30
本文介绍了从外部连接到 Vagrant VM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发网站时使用 Vagrant,并且在过去一年左右的时间里一直在使用.我想在 iPad 上测试一些功能,但我不知道如何让 iPad 连接到我的 Mac 上的 Vagrant 盒子.

I use Vagrant when developing websites and have done for the last year or so. I would like to test out some functionality on an iPad but I can't figure out how to get the iPad to connect to the Vagrant box on my Mac.

可以这样做吗?

推荐答案

看看 Bridged Networking 在 Vagrant 文档中.启用它将允许您的虚拟机在网络上显示为设备,并允许您连接到其 IP 地址和您的网络服务器正在侦听的端口.

Take a look at Bridged Networking in the Vagrant documentation. Enabling it will allow your VM to appear as a device on the network, and allow you to connect to its IP address and the port your web server is listening on.

严重警告:您尚未提供有关本地网络的任何信息,因此您的 iOS 设备很可能无法访问 VM 的 IP,该设备可能通过 WiFi 连接 - 以及许多路由器的工厂配置不允许在无线连接的设备和通过以太网连接的设备之间进行通信.

Huge caveat: you haven't given any information about your local network, so it's entirely likely that the IP of the VM will not be reachable to your iOS device, which is likely connected via WiFi--and many routers' factory configurations do not allow communication between devices connected wirelessly and those connected via ethernet.

但这是可能的.

这篇关于从外部连接到 Vagrant VM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆