When I finally asked to make the switch to a Mac at work I was faced with a problem. It was not a big deal to spin up a VM with windows server to host ArcGIS Server. However, I didn't want to develop from within my VM. I wanted to continue to use the great development environment that I had in OSX. I also didn't want to write apps that hit ArcGIS Server cross-domain. Hitting ArcGIS Server from localhost on my Mac like this was my goal:
/ArcGIS/rest/services...
) from within my apps. I accomplished this with a few tricks within the virtual machine software that I use, VMware Fusion.The first goal was to be able to serve projects that are located within my OSX file system through IIS on my Windows Server 2008 virtual machine. This is accomplished by setting up a shared folder in VMware Fusion (Settings -> Sharing).
Then I set up a virtual directory in IIS that points to that shared folder.
Make sure that you have the
\\vmware-host\
in your path. I had to hand type this in to get it to work. This enabled me to hit my web apps that were stored on my Mac from my Windows IIS. However, to hit my VM from my Mac, I still had to use it's ip address. This was a big pain because by default it is not static which meant I was always having to check my VM's ip address and I couldn't bookmark anything.
Finally, I came across an article showing how you can assign a static ip address to your guest and then forward localhost on your host to your guest. The first step is to assign a static ip address to your guest VM by appending
/Library/Preferences/VMware Fusion/vmnet8/dhcpd.conf
. You can read the article for the specifics of what to add. My addition looks like this:I don't think that the host name matters as long as you have the correct mac (hardware ethernet) address from your VM.
This change gave my VM the permanent ip address of 192.168.247.100. Then by adding line 55 to
/Library/Preferences/VMware Fusion/vmnet8/nat.conf
I was able to forward localhost
on my Mac to IIS on my VM...and voila!
I can now write and debug my apps on my Mac but have them served up through IIS on my windows VM.
This comment has been removed by a blog administrator.
ReplyDelete