Connect to SQLServer running in a parallels VM
Asked Answered
V

3

17

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!

Vomiturition answered 13/7, 2010 at 18:48 Comment(0)
M
14

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)

Mockery answered 16/12, 2010 at 17:56 Comment(2)
For 2014, you have to configure remote access this way: msdn.microsoft.com/en-us/library/ms191464.aspxPerquisite
I also had to enable TCP/IP in the sql server configuration manager as detailed here: kb.sp.parallels.com/en/118540Perquisite
F
3

Posting a new answer since I cannot comment, yet.

For me, in addition to the helpful advice from Pavel and Ed that is all required, I had to setup an additional adapter in Parallels on the Windows VM as a Host-only adapter. Then, I assigned that adapter a static IP in the VM and used that IP in my connection string.

More details are available here which helped me get my configuration working.

This is the most relevant section:

First, define another network adapter in Parallels. This network adapter will have a static IP and will only allow connections from the host, that is OS X. Parallels cannot be running for this part.

Choose Configure… in the Virtual Machine menu of Parallels Choose the Hardware tab Add a new network adapter to the list on the left Choose Host-Only Networking from the Type dropdown and be sure Connected is checked Make a note of the MAC Address Press OK

Next, we need to set a static IP for the new network adapter.

Start Parallels and, in my case, Windows XP (other versions of Windows should be similar) Go to Network Connections in the Control Panel The new LAN connection will be in the list, if you are unsure as to which one is the new one (it should have the highest number) you can compare the MAC address by checking the status Bring up the properties panel for the correct LAN connection and go to the Internet Protocol (TCP/IP) properties Enter a static IP of 10.37.129.10 (which is in a range that Parallels reserves for Host-Only Networking) and set the subnet mask to 255.255.255.0. Leave the gateway blank.

Save the changes by pressing OK

Feodora answered 12/3, 2014 at 1:43 Comment(2)
Kindly quote the most relevant part of the link provided, so that people can find the answer here, even when the link goes down. stackoverflow.com/help/how-to-answerHovis
That returns a 404. Found it on the wayback machine though: web.archive.org/web/20120624145825/http://craigcoded.com/2010/…Perquisite
T
2

You need to make sure remote connections are enabled in SQL server and open the relevant ports on the Windows firewall.

All the relevant steps are listed in this MSDN page (documentation for "Quadrant", but relvant to any installation).

Tyrolienne answered 14/7, 2010 at 8:1 Comment(2)
Thanks for the answer. I've gone through the necessary steps for SQL Server access before. I've even set this up successfully on a real box. I'm afraid parallels probably has some "firewall-ish" configuration that I don't know about. I think that's where I'm getting blocked. Any experience with that?Vomiturition
@Bobby B - Sorry; I have no experience of Parallels. Are you able to connect to the VM via TCP/IP on other ports than 1433 (or whatever SQL Server is running on)?Tyrolienne

© 2022 - 2024 — McMap. All rights reserved.