Question

First, my setup:

  • Mac OSX 10.8
  • Windows 7 running in VM (VMWare Fusion)
  • SQL Server 2008 R2 running in VM
  • Boatload of Python scripts + my highly customized Python installation on the Mac side.

I'd like to be able to run scripts locally on my laptop against a snapshot of our development database, which exists happily in my VM. I'd also like to not have the PITA that is rebuilding my Python installation in the Windows VM.

So the question: how can I access the SQL Server instance running in my VM from the Mac side? To access the production data, I use pymssql, which is based on FreeTDS.

Was it helpful?

Solution

I am running with this configuration, as follows:

  • Create an additional network adapter for the VM and set it as "Private to my Mac". The default network adapter created during the VM set-up will be used by Windows to get to the network to which the Mac is attached (Internet, etc.) and this new one you create will be used for communication between the Mac and VM host.
  • The Mac IP on the virtual network can be identified using ifconfig. In my case it was named vmnet1 with IP 192.168.23.1
  • The Windows VM IP will, by default, be dynamically allocated. You should go into the network setup in Windows and set a static IP that is on the same network as that of the Mac IP. In my case the Windows network adapter created by Fusion was named Ethernet1. I set this to 192.168.23.100/255.255.255.0. Do not set a gateway address as you do not want routes down this path
  • Create an entry in the Mac /etc/hosts file for the Windows IP, e.g. "192.168.23.100 mywinsys.local"
  • Create an entry in the Windows /windows/system32/drivers/etc/hosts file for the mac IP, e.g. "192.168.23.1 mymacsys.local"
  • Be sure to turn off Windows firewall or otherwise open up necessary ports
  • Be sure that SQL Server is configured to accept IP connections https://technet.microsoft.com/en-us/library/hh231672(v=sql.110).aspx

Processes running on the mac can connect to Windows processes with mywinsys.local. Processes running on Windows can connect to Mac process with mymacsys.local

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top