Ant*_*nAL 12 parallels virtualization web-development osx-snow-leopard
i need to test my web site, running on a local Mac, under several browsers in Windows.
I use Windows XP, installed in Parallels Desktop.
It would be great, when i will be able to access my http://localhost:3000 from Windows, sitting in virtual environment (Parallels).
How to wire all the stuff up ?
Update:
I figured out, how to access shared web-site on the mac.
I have following settings:
Parallels Desktop -> Preferences -> Network -> Shared Network
"Parallels Shared Networking Adapter #0" i tweaked with ip=192.168.123.1
From WinXP this ip is accessible via ping.
C:\Documents and Settings\Administrator>ping imac.local
Pinging imac.local [192.168.123.1] with 32 bytes of data:
Reply from 192.168.123.1: bytes=32 time<1ms TTL=64
Reply from 192.168.123.1: bytes=32 time<1ms TTL=64
Reply from 192.168.123.1: bytes=32 time<1ms TTL=64
Reply from 192.168.123.1: bytes=32 time<1ms TTL=64
Run Code Online (Sandbox Code Playgroud)
When on the Mac i turn the "Shared Web" on, the address "http://imac.local/~AntonAL" will get accessible from WinXP and Mac. Note, that i have set the name of my mac to "iMac", which is equivalent to ip=192.168.123.1
But, the only problem, i can't figure out is unaccessible port 3000.
So, the address "http://imac.local:3000" is still does't work from WinXP. Actually, it is not accessible even from the Mac ... possible i'm doing something wrong.
问题是- 我应该在 WinXP 端使用哪个地址,以便能够在 Mac 端访问“localhost:3000”?尝试了“Parallels Shared Networking Adapter #0”的 ips、网关、Mac 的 ip,但仍然没有成功......
小智 6
在 Windows 命令行中键入“ipconfig”。您将看到类似于我在下面看到的信息:
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : localdomain
IPv6 Address. . . . . . . . . . . : fdb2:2c26:f4e4:0:a1e2:ed15:e43a:daf7
Temporary IPv6 Address. . . . . . : fdb2:2c26:f4e4:0:b5d9:4d70:47a:b0b0
Link-local IPv6 Address . . . . . : fe80::a1e2:ed15:e43a:daf7%11
IPv4 Address. . . . . . . . . . . : 10.211.55.3
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.211.55.1
Run Code Online (Sandbox Code Playgroud)
如果您注意到,最后一行是您的默认网关,上面两行是 IPv4 地址。默认网关是 Windows 和 Mac OS X 之间的虚拟路由器。由于 Windows 使用 xxx3 的 IP 地址,而路由器使用 xxx1,因此 Mac 在 xxx2 上可用。就我而言,我可以通过 10.211.55.2 访问 Mac。所以你可以使用http://xxx2/访问你的网络服务器,在我的例子中我使用:
http://10.211.55.2/
Run Code Online (Sandbox Code Playgroud)
我已使用以下条目编辑了 Windows“主机”文件:
10.211.55.2 localhost.mac
Run Code Online (Sandbox Code Playgroud)
现在,我可以输入http://localhost.mac/来访问在我的 Mac 上运行的 Web 服务器。虽然,编辑“hosts”文件的这一步不是必需的,但它对我有帮助。
附带说明一下,您可以使用在 Windows 上键入“ipconfig”时获得的 IPv4 地址从 Mac 访问基于 Windows 的 Web 服务器。
获取 Mac 虚拟 IP 地址的另一种方法是在 Mac OS X 的终端上键入以下命令:
ifconfig vnic0
Run Code Online (Sandbox Code Playgroud)
“vnic0”是 Parallels 安装在 Mac 上的虚拟以太网。如果您有多个虚拟机实例正在运行,您将看到多个虚拟以太网。所有这些虚拟以太网都以“vnic”一词开头。如果您有两个虚拟机正在运行,当您在终端上运行“ifconfig”命令时,您将看到列出的“vnic0”和“vnic1”。
就我而言,当我输入“ipconfig vnic0”时,我会得到以下输出,您会注意到您得到了列出的 inet xxxx IP 地址。
vnic0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=3<RXCSUM,TXCSUM>
ether 00:1c:42:00:00:08
inet 10.211.55.2 netmask 0xffffff00 broadcast 10.211.55.255
media: autoselect
status: active
Run Code Online (Sandbox Code Playgroud)
我希望这可以帮助你。
干杯!
SG
尝试找出 Mac 的本地 IP 地址并使用该地址访问 VM 上的网页。
您可以在系统偏好设置下、使用命令 ifconfig 或使用某些应用程序或仪表板小部件(如iSlayer 的 iStat)找到您 Mac 的 IP 地址。
归档时间: |
|
查看次数: |
22253 次 |
最近记录: |