如何使用 virtualbox 访问本地 Rails 网站

发布于 2024-12-09 23:50:53 字数 211 浏览 1 评论 0原文

我正在本地 Rails 网站上工作,我想从运行 winXP 的 visrtualbox 机器访问它。

在我的 Ubuntu 机器上,我使用浏览器打开 http://www.myapp.local:3000 我如何从 Virtualbox 访问它?

非常感谢!

I'm working on a local Rails website, and I'd like to access to it from my visrtualbox machine running winXP

From my Ubuntu machine, I use my browser to open http://www.myapp.local:3000
How can I access it from Virtualbox?

Thanks a bunch!

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

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

发布评论

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

评论(1

岁月如刀 2024-12-16 23:50:53

在您的 xp 计算机上,使用本地文本编辑器(如记事本或其他任何内容)打开位于 C:\Windows\System32\drivers\etc\hosts 的主机文件。

然后添加如下行:

10.70.30.31 www.myapp.local

其中 10.70.30.31 是 Ubuntu 计算机的 IP 地址。

保存主机文件。然后重新启动您在 XP 机器上使用的任何浏览器。确保关闭所有打开的浏览器窗口,因为浏览器将缓存您的主机文件,直到您正确重新启动它。

打开新的浏览器窗口后,您应该能够从 Ubuntu 计算机上使用的同一地址访问您的 Rails 站点。

http://www.myapp.local:3000

On your xp machine, open up your hosts file at C:\Windows\System32\drivers\etc\hosts in a local text editor like notepad or whatever is on there.

Then add a line like this:

10.70.30.31 www.myapp.local

Where 10.70.30.31 is the IP address of your Ubuntu machine.

Save the hosts file. Then restart whatever browser you're using on the XP box. Make sure you close all of the browser windows you have open as well because your browser will cache your hosts file until you properly restart it.

Once you've opened a new browser window you should be able to access your rails site from the same address you use on your Ubuntu machine.

http://www.myapp.local:3000

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