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.
Related
I've 4 SQL Express servers on my network, and I'm able to connect to all of them with SSMS from the different computers across the network.
But I'm not able to see them in the SSMS "Browse for Servers" window if i'm doing a search (Browse for network servers).
I've tried to disable all firewalls, made firewall rules for TCP port 135, 1433, 1434 and 4022 and UDP port 1434 allowed for both in and out.
And servers has been set up for listening on port 1433. And the "SQL Server Browser" is running.
It is working with connection, but not able to browse them.
Does anyone know why, and if there is a fix for this?
I've solved my problem, it was caused by VMware workstation on the computers. I found out about this, by using the CMD "C:\Program Files (x86)\Microsoft SQL Server\90\Shared\sqlbrowser.exe" -c like mentioned in this thread.
By stopping the "SQL Server Browser" Service, and start it from the CMD you get to see what happens in the service, And it was not as I expected. It seems like that the virtual network adapters from VMware was causing the problem, because it looking like the SQL server browser was using the wrong adapters.
It might be because I've installed the VMware workstation before the SQL server. But anyway by removing the adapters and using only a bridged connection from the VMware for now, everything is working as expected.
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.
I have installed SQL Server 2017 on Linux Ubuntu together with SQL Command Line Tools.
Instantly after setting up and normal configuration I am unable to connect to it using the command line tools.
I am getting the following error:
How can I fix this issue?
I finally managed to fix the issue by reinstalling the SQL Server 2017 on my Debian machine.
Microsoft instructions are for Ubuntu not Debian but the only error I was getting on Debian was about OpenSSL which I solved it using the following answer:
https://askubuntu.com/questions/930712/installation-problems-with-ms-sql-server-for-linux
Now it works perfectly on my Debian machine.
Look here:
Configure a Windows Firewall for Database Engine Access
Configure a Server to Listen on a Specific TCP Port
Specifically:
Can not connect to MS SQL from Ubuntu sqlcmd
client
The fix for letting the Ubuntu client connect was to set "Listen to
All" to No in the SQL Server Configuration Manager > SQL Server
Network Configuration > Protocols for [instance name]. And under IP
Address change 127.0.0.1 to the [ip] used to connect. Don't forget to
restart the SQL Server!
Other tip: check your firewall (or temporaly disable it for testing).
Also allow remote connections in SQL Server properties > Connections.
See above posts.
I restored a MSSQL backup to SQL Server Express in a Windows 7 virtual machine under Virtualbox. I am attempting to connect to this SQL Server instance from the host (Mac OS) using a user inside the imported database that has credentials to connect. The virtual machine is configured to use a Host-Only adapter. SQL Server express is running inside the VM at WIN7VM/SQLEXPRESS, port 1433.
I am able to connect to Apache in the VM on port 8080 from the Mac host without a problem. I can also telnet into the SQL server at port 1433 from the Mac host, using the host-only IP address (192.168.56.101).
What I am unable to do is connect to SQL server from Navicat in MacOS, or remotely using PHP. Here is what I have tried:
Disabled Windows Firewall
Configured SQL server port setting to use 1433
Enabled SQL server authentication
Enabled TCP/IP in SQL Server
Enabled remote connections to SQL server
I am trying to connect with this info:
Host/IP address: 192.168.56.101 OR 192.168.56.101\SQLEXPRESS (have tried both)
Port: 1433
Database: MyDatabase
Authentication type: Basic
Username: username
Password: password
What am I missing here to be able to remotely connect without any issues? Thanks in advance!
I believe you need to use a Bridged Adapter - rather than a Host-Only adapter. A Host-Only adapter does not use the physical NIC - so that is probably the issue here. I have encountered the same issue before.
Using a Bridged Network connection on both the Host and the Guest - will mean that both are on the same network. Assuming the firewall are not blocking port 1433, you should be able to connect without issue.
It turned out to not be a Virtualbox issue, but a SQL Server authentication issue.
The user I was trying to connect with had access to a database, but did not have a corresponding SQL Server Login.
MSDN - Managing Logins, Users, and Schemas How-to Topics
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).