Jan 16, '07 07:30:00AM • Contributed by: nick
I use Parallels Desktop mainly to make sure my websites work on IE. As the IP address of the virtual network devices installed by Parallels are assigned by a dedicated DHCP server also installed by Parallels, and the IP address of my laptop changes as I change locations, I use the following setup to be able to access my laptops webserver by name from Windows.
- Switch the Parallels virtual machine to host-only networking.
- Set up OS X Internet Sharing (in the Sharing System Preferences panel) to share the connection with the Parallels Host-Guest adapter.
- Open ports 80, 443, and any other ports you use for your development server (i.e. 3000-30xx for Rails development with locomotive) in the OS X firewall by adding a new rule.
- Assign static IP addresses (from an unused network range) to the Parallels Host-Guest adapter and the network interface in Windows (I used 192.168.123.1 and 192.168.123.2 with network mask 255.255.255.0).
- Add this to C:\WINDOWS\system32\drivers\etc\hosts:
192.168.123.1 yourcomputer
Optionally, you can even comment the lines that start the Parallels DHCP-NAT server in /Library -> StartupItems -> Parallels -> Parallels, as with this setup, you use neither DHCP nor Parallels' NAT (but OS X's own NAT is used).
[robg adds: I haven't tested this one.]
