Connect to SQLServer running in a parallels VM - sql-server

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!

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)

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

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).

Related

AWS Lightsail Windows SQL Server Unable to connect via static IP

I created a new windows server + sql server in aws lightsail. I cant seem to connect remotely via ip address. I almost do everything but to no avail.
I tried the ff:
allow remote connection & windows/sql auth via connection properties
allow all tcp/udp ports (for testing)
enable tcp/ip sql config
add static ip address in tcp/ip sql config
disable firewall
Any help is very much appreciated.
Apparently when managing vps, some configurations such as networking are done via the providers interface, in my case its in AWS console. This means that the firewall rule for port 1433 which is used by SQL Server should be configured in the AWS site. There is a networking tab wherein you can add a custom rule to TCP 1433. Also don't forget to set the Server Properties Server Authentication to both windows and sql authentication (Right click the connection > Properties > Security) and then restart sql server service.
There are two version of Lightsail
Window + MS SQL
Window
When we talk about managing port of MSSQL from Networking tab this will work only when AWS setup MSSQL for you.
if you have just took window and then installed MS SQL from your side you need to do following setting:-
Server Server Configuration Manager, enabled TCP/IP from Networking section
and also open in detail and put port 1433 and remove dynamic ports
Create inbound Firewall in window.
Then it will work.

How to Enable TCP/IP for mssql instance in ubuntu 16.04?

I'm not able to connect SQL Server hosted in Ubuntu 16.04 using my program, I believe its because the TCP/IP is disabled for the instance I try to connect (Protocols for SQLEXPRESS under SQL Server network configuration).
How I'm sure because I tried to connect my program to SQL Server that hosted in Windows and it able to connect.
Example my instance name is SQLEXPRESS, so I'm trying to connect through SSMS by using IP Adress\SQLEXPRESS and it fails. But I am able to connect to the SQL if I use IP address only as the server name.
I tried to search about sqlcmd for enable the tcp/ip but all of them just show the guide to change the ports.
So, how can I enable tcp/ip connection for ip\SQLEXPRESS instance in Ubuntu 16.04?
picture below just an example on enabling tcp/ip for the sql instance in windows
I believe the reason why this doesn't work on linux is because it doesn't have a SQL Server Browser application that Windows has available. This application redirects the requests to 1433 to whatever random port it's listening to currently -- this is why it will only connect when the port is specified. In my case this stinks because I'm having to work around an ancient application that we don't have the source code for. I'm thinking about writing a little application that will redirect the default traffic to the correct port for linux msssql.

Connecting to SQL Database Server Remotely

I'll preface my question with: I am an absolute beginner with respects to the nature of MS SQL Server and have a layman's understanding of networking and 'computers' in general...
So, I'm trying to replicate an environment where:
There is an 'application server' which hosts HPE's ALM
This communicates with a database server with a Microsoft SQL Server DB
I currently have Microsoft SQL 2012 Server with a sample DB uploaded onto it on one laptop (Laptop 1) and the ALM software on the other laptop (Laptop 2). Both are connected to the same WiFi network.
Laptop 2 is asking me for Database parameters such as:
DB Host Name
DB Port Number (1433 by default)
OR Connection String
I have little idea of what I'm doing - I'd have thought it might be possible to connect to the DB through some sort of variant of the IP address of Laptop 1... but I'm unsure.
How can I connect to a MS SQL 2012 DB from one laptop to another? I realise this is probably a loaded question - I'd be happy if someone can point me in the right direction rather than an exact answer!
Thanks guys,
ST
I see two potential issues:
A corporate laptop might have firewall restrictions. So, you have to
open port 1433 for SQL Server.
Possibly you are playing with SQL Express, which by default, does not
have TCP/IP connection enabled. To enable it run "SQL Server
configuration manager", go to Network
configuration->Protocols->TCP/IP->Enable->restart SQL Server. Also check other properties. If static port 1433 is not set - set it.
Two types of adjustments must be set before connecting to the remote SQL Server. These settings are necessary because without them the connection to the remote SQL Server will not be able to be successfully created
Configuration settings:
-The SQL Server instance to allow the protocol being requested
-Allow access through the Window Firewall
1- Enabling TCP/IP protocol
2- Configuring Windows Firewall
For More details see the link :
https://www.sqlshack.com/how-to-connect-to-a-remote-sql-server/

Accessing Host SQL Server From VMWare Machines

I have Windows 7 with SQL Server 2008 and SQL Express 2012 on it. I have also installed win xp on two vmware machines. I am trying my best to connect to sql server on host machine from the vm machines using management studio, but no luck. I had problem even pinging the host machine and visa versa. When I turned off the firewall, I was able to ping the host machine. I tried to add the vm machine's IP to allow access to host machine, but even that didnt work.
I have added a custom rule from here
http://www.rackspace.com/knowledge_center/article/creating-an-inbound-custom-allow-rule-for-windows-firewall-windows-2008
I was running hotspot shield which i turned off, but still no luck. I have allowed remote connection on my sql server. but still not working. Can someone help here.
This is the error I get.
Here is the setting for vm machine.
When the firewall is on, cant ping, but can ping when its off.
Regards
Parminder
You need to configure SQL Server to listen on the TCP protocol. To do this, click Start | All Programs | Microsoft SQL Server 2012 | Configuration Tools and open SQL Server Configuration Manager.
In SQL Server Configuration Manager, expand SQL Server Network
Configuration in the console pane.
Click Protocols for instance name. (The default instance is
Protocols for MSSQLSERVER).
In the details pane, right-click TCP, it should be Enabled for the
gallery images by default. For your custom images, click Enable (if
its status is Disabled.)
Right-click on TCP/IP and select Properties.
Verify that, under IP2, the IP Address is set to the computer's IP
address on the local subnet.
Make sure that TCP Dynamic Ports is blank.
Make sure that TCP Port is set to 1433.
In the details pane, right-click SQL Server (instance name) (the
default instance is SQL Server (MSSQLSERVER), and then click
Restart, to stop and restart the instance of SQL Server.
Then, you need to open TCP ports in the Windows firewall for the default instance of the Database Engine. To do this, click Start | All Programs | Administrative Tools, and open Windows Firewall with Advanced Security.
In the Windows Firewall with Advanced Security, in the left pane,
right-click Inbound Rules, and then click New Rule in the action
pane.
In the Rule Type dialog box, select Port, and then click Next
In the Protocol and Ports dialog box, select TCP. Select Specific
local ports, and then type the port number of the instance of the
Database Engine (1433 for the default instance). Click Next.
In the Action dialog box, select Allow the connection, and then
click Next.
In the Profile dialog box, select Domain, Private, Public, and then
click Next.
In the Name page, set the Inbound Rule's Name to SQLServerPort and
click Finish. Close Windows Firewall with Advanced Security window.
Hope this help.
Best Regards
This comes straight from MSDN blog in regards to network error 26. Details here
1) Make sure your server name is correct, e.g., no typo on the name.
2) Make sure your instance name is correct and there is actually such an instance on your target machine. [Update: Some application converts \\ to \ If you are not sure about your application, please try both Server\Instance and Server\\Instance in your connection string]
3) Make sure the server machine is reachable, e.g, DNS can be resolve correctly, you are able to ping the server (not always true).
4) Make sure SQL Browser service is running on the server.
5) If firewall is enabled on the server, you need to put sqlbrowser.exe and/or UDP port 1434 into exception.
If that still fails you might want to run PortQry.
You can download PortQry from here details on application here, run "portqry.exe -n yourservername -p UDP -e 1434". If this command returns information and it contains your target instance, then you can rule out possiblity 4) and 5) above, meaning you do have a SQL Browser running and your firewall does not block SQL Browser UDP packet. In this case, you can check other issue, e.g. wrong connection string.
Note if you're running SQLExpress it still might not work after applying the steps from octavioccl's comment.
What fixed it for me was replacing my SQLExpress 2019 with SQL Server Developer 2019, applying the mentioned SQL Network config and Firewall settings and then I was finally able to connect to the Host's SQL server just by using the hostname, no IPs and ports.

SQL Server communication between VirtualBox images

I have a WinXP host with VirtualBox 3.1.2 installed. I have a VirtualBox image called "hydrogen" on which I installed WinXP and MS SQL Server 2005 Express. I have another VirtualBox image called "helium" on which I installed WinXP. I am trying to create a ODBC DSN on "helium" that connects to SQL Server on "hydrogen" but it fails.
All of the documentation I've seen so far only says to use a "bridged adapter" in my VirtualBox image settings. I've done that but I still don't have communication.
The express edition does not listen on remote ports by default. You can enable remote connections using the "Surface Area Configuration Tool" or by running this SQL script:
exec sys.sp_configure N'remote access', N'1'
go
reconfigure with override
go
Also, if you use a bridged adapter, your virtual boxes are sharing your host's IP address. That means you'll have to configure both instances of SQL Server on a separate port.
I've gone through a couple of tweaks and changes and I have it working. My environment:
Host:
WinXP Pro
SQL Server 2005
Guest "Hydrogen":
WinXP Pro
SQL Server 2005
Network Adapter #1: NAT
Network Adapter #2: Bridged
Guest "Helium":
WinXP Pro
Network Adapter #1: NAT
Network Adapter #2: Bridged
On "Hydrogen", I ran the Network Setup wizard, specifying that it was part of a network that did not have an internet connect (part of the "Other" option). I rebooted "Hydrogen".
On "Helium", I ran the Network Setup wizard, specifying taht it ws part of a network that did not have an internet connect (part of the "Other" option). I rebooted "Helium".
I turned off the firewall on "Hydrogen".
I can now connect to SQL Server on "Hydrogen" from both "Helium" and my host. Some of these settings may be extraneous; I don't know. But I know it's working for me reliably now, even after rebooting the host.

Resources