Page 1 of 2

[SOLVED] Access tcp port 1433 on XP Guest

Posted: 26. Apr 2017, 16:06
by MarkFoley
I have a new XP guest that was created from an Acronis image backup. The original XP host was a SQL Server 2005 server. It has port 1433 opened in its firewall to accept SQL Server connections. How to I make the Linux host pass port 1433 requests to the XP guest VM?

Re: Access tcp port 1433 on XP Guest

Posted: 26. Apr 2017, 18:24
by frank
Use NAT for your VM and use port forwarding. See section 6.3.1 in the user manual for explanations. To set up port forwarding, open your VM settings, go to network settings, Advanced, Port-forwarding.

Re: Access tcp port 1433 on XP Guest

Posted: 26. Apr 2017, 22:44
by MarkFoley
Not working. In Settings > Network > Adapter 1 > Advanced > Port Forwarding > Rule 1, I have: Protocol = TCP; Host IP = 192.168.0.2; Host Port = 1433; guest port = 1433. See attachment.

Running tcpdump on 192.168.0.2 confirms that workstations are trying this post. On the XP VM quest I can connect to that port via telnet. I've stopped the firewall.

I must be missing something. Ideas?

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 03:47
by BillG
MarkFoley wrote:Not working. In Settings > Network > Adapter 1 > Advanced > Port Forwarding > Rule 1, I have: Protocol = TCP; Host IP = 192.168.0.2; Host Port = 1433; guest port = 1433. See attachment.

Running tcpdump on 192.168.0.2 confirms that workstations are trying this post. On the XP VM quest I can connect to that port via telnet. I've stopped the firewall.

I must be missing something. Ideas?
Umm... guest IP?

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 07:35
by MarkFoley
I tried putting 10.0.2.15 in there (the IP determined by running ipconfig), but that didn't help.

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 10:35
by frank
Leave the host IP empty.

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 18:28
by MarkFoley
Tried that too. I started with both empty, then host IP only, then host IP and guest IP. I haven't tried guest IP only, but I suspect that's not going to help. I'll try though.

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 19:16
by Perryg
Did you miss the point about using NAT and not bridged, Etc.?

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 19:36
by MarkFoley
I do have NAT. See image. Note that I also have Remote Display enabled for port 3389 and that works. From any host on the LAN I can connect to the VM Remote Display. From the VM's host I can `telnet localhost 3389` and get a connection. If I do `telnet localhost 1433` I get:

> telnet localhost 1433
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

If I try using the VM IP it timesout:

> telnet traversevm 1433
Trying 10.0.2.15...
telnet: connect to address 10.0.2.15: Connection timed out

I can telnet to this port on the XP VM itself.

There is no firewall currently enabled on the XP guest. The linux host permits all ports on the LAN, which is eth1:

iptables -A INPUT -i eth1 -p tcp --syn -j ACCEPT
iptables -A INPUT -i eth1 -p udp -j ACCEPT

It's been painful getting this VM set up so far. I'd like to use the XP VM for legacy purposes and decommission the physical machine which is suffering from old age. Surely there is a way to get access to port 1433 working?!

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 19:49
by Perryg
I am going to need to see some diagnostic information. Post the following:
Post the guests log file ( as an attachment ). Right click on the guest in the Main Manager then click show log. Save and post as an attachment. Compress if it is too large to post.

Also

From the hosts terminal/command window type VBoxManage showvminfo <VM Name> --details and post here. Replace <VM Name> with the actual name of the VM. Use " " if the name has a space in it.

Note if the host is Windows you need to be in the directory that has VBoxManage.exe for the command to work.

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 21:53
by MarkFoley
Requests attached. The VM host is Linux.

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 22:12
by Perryg

Code: Select all

NIC 1 Rule(0):   name = Rule 1, protocol = tcp, host ip = 192.168.0.2, host port = 1433, guest ip = 10.0.2.15, guest port = 1433
According to the config file you have information that should be eliminated. Clear everything except the rule, TCP, and the post. While the guest is shut down ( not saved state ). I would even shut down the VBox main manager for at least 20 seconds to make sure all is shut down. You probably don't need to do the shut down of the main manager but it will eliminate another trip back here if that was in fact a deciding factor for your build. As a final thing to do if this does fail after doing all of this it to delete the rule completely and start fresh with just the rule, protocol, and port.

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 22:26
by MarkFoley
OK! I deleted the rule and re-created with just the ports and guest IP. That is, I removed the host IP. That was the only combination I hadn't tried yet -- that worked, sort of. I am now able to telnet to 1433 from hosts on the LAN. Sheesh! If that is the normal rule config, it ought to be better documented.

I am not, however, yet able to connect to the database. But I think I will further explore on SQL Server forums about this first -- even though the original, physical machine can connect OK. Nevertheless, if I can telnet, I must be getting through to the VM, so I think it's reasonable to explore non-VM issues next. I'll post back.

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 22:30
by Perryg
You do not need to put the guest IP in either as the program and config file already knows what it is. As I mentioned you only need 3 things the rule, protocol, and port, nothing else.

Re: Access tcp port 1433 on XP Guest

Posted: 27. Apr 2017, 23:14
by MarkFoley
Will try removing the guest IP later, after solving the connection issue at the XP level. I hesitate to change anything now. I did have it originally configured as you described, just ports, no IPs. The failure of that to work was what precipitated this post. Maybe there was something else I did wrong at that point, but since I'm able to connect now I'll leave well enough alone and experiment later.