Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 258
Bobby B Avatar asked Jul 13 '10 18:07

Bobby B


People also ask

Does SQL Server work on Parallels?

The latest version of Parallels Remote Application Server Reporting Service supports SQL Server versions up to 2019.

Can I run Windows Server on Parallels?

Parallels® Remote Application Server (RAS) supports Windows Server 2022 with its version 18.3 release. This allows businesses to take advantage of the latest features of Windows Server 2022 when delivering virtual applications and desktops through Parallels RAS.

Can you run a VM in Parallels?

With Parallels Desktop for Mac you can use Windows that you set up using VMware Fusion, Microsoft Virtual PC, and Virtualbox.


2 Answers

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)

like image 80
Pawel Brzeminski Avatar answered Sep 22 '22 09:09

Pawel Brzeminski


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

like image 30
mdrewlo Avatar answered Sep 18 '22 09:09

mdrewlo