Search code examples
sql-servermacosvirtual-machineparallels

Connect to SQLServer running in a parallels VM


I'm running a Windows 7 VM via Parallels on OSX. There's an instance of SQL Server running on that VM. I would very much like to be able to connect to that instance from my host (OSX). I want to be able to leverage my local RoR environment with SQLServer as a backend.

I can't get the VM to respond to any requests from my Mac and I haven't a clue where to begin the troubleshooting process.

Can anyone provide any insights or helpful resources?

TIA!


Solution

  • Bobby, if you want to connect from your mac osx to a sql server installed on a parallels vm you need to do 3 things:

    1) Enable remote connections on your sql server.

    Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Surface Area Configuration -> Surface Area Configuration for Services and Connections -> Database Engine -> Remote Connections -> Local and remote connections -> Enable TCP/IP -> Apply

    2) Turn on the SQL Server Browser service (sql server express and dev edition turn this off by default) Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Configuration Manager -> Start SQL Server Browser service

    3) Configure the firewall to allow network traffic

    You can configure it per program or I just opened a port in firewall exceptions (1433 by default for SQL Server 2005)

    For instance my jTDS connection string looks like that:

    jdbc:jtds:sqlserver://10.211.55.7:1433;DatabaseName=master
    

    (where the host is your vm's ip of course)