Cannot connect to port listening on Ubuntu 10.10

Discussions about using Linux guests in VirtualBox.
Post Reply
vineet12
Posts: 4
Joined: 5. Jan 2011, 15:46
Primary OS: MS Windows 7
VBox Version: OSE self-compiled
Guest OSses: Ubuntu 10.10

Cannot connect to port listening on Ubuntu 10.10

Post by vineet12 »

I have Windows 7 64-bit as the host OS and Ubuntu 10.10 as the guest OS using Oracle Virtualbox v4.0 with Bridged network adaptor (Have tried all adapters) with which I can ping to the guest from host and vice-versa. I have configured samba so the virtual pc 'ubuntu' is on the same workgroup.

I have an xmlrpc server process on the guest OS that i run on the terminal which listens on a certain port and created an xmlrpc client with the URL to http://ubuntu:8080/rpc2 which when i run on the Windows machine i get an exception 'the remote server cannot be reached'

When i use the ip address i get the following exception:

{System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.HttpWebRequest.MakeMemoryStream(Stream stream)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
at CookComputing.XmlRpc.XmlRpcClientProtocol.GetWebResponse(WebRequest request)
at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object clientObj, MethodInfo mi, Object[] parameters)
at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(MethodInfo mi, Object[] Parameters)
at XmlRpcProxyaae9c7fd-2897-493c-bc91-6818dd637465.translate(parameter p)
at WpfApplication1.MainWindow.MenuItem_Click1(Object sender, RoutedEventArgs e) in C:\WpfApplication1\WpfApplication1\MainWindow.xaml.cs:line 202}

netstat gives me 0.0.0.0/8080 Listening

Does ubuntu by default have a firewall that blocks all ports by default ? I have tried other ports without any luck.

I basically want client-server communication irrespective of where the client app is running: internal/external. The server is Abyss which handles xmlrpc. I can configure Apace to handle xmlrpc as well.

I have a hostname that i have setup, enabled port forwarding, set up the firewall. Shouldn't NAT on the router bind the
hostname vineetk.no-ip.biz to the ip address of the server pc ? Strangely, i can access the website hosted on the same machine when i log onto vineetk.no-ip.biz.

From my understanding it appears to be a network issue on the server side.

How do i map the hostname to my virtualbox pc for outside access ?

Regards,

Vineet
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Cannot connect to port listening on Ubuntu 10.10

Post by Perryg »

port forwarding in VirtualBox is only relevant when using NAT.
To add name resolution from host to guest add the guest name - IP to the hosts host file.
To be able to make the guests name available to the outside it would need to be a FQD and registered with a DNS.

As for firewalls Ubuntu does not have one configured by default AFAIK but the Windows host does.
vineet12
Posts: 4
Joined: 5. Jan 2011, 15:46
Primary OS: MS Windows 7
VBox Version: OSE self-compiled
Guest OSses: Ubuntu 10.10

Re: Cannot connect to port listening on Ubuntu 10.10

Post by vineet12 »

i added the hosts name to the hosts host file, restarted both host,guest OS but i still get the same exception.

Anything else that you want me to check or try ?
vineet12
Posts: 4
Joined: 5. Jan 2011, 15:46
Primary OS: MS Windows 7
VBox Version: OSE self-compiled
Guest OSses: Ubuntu 10.10

Re: Cannot connect to port listening on Ubuntu 10.10

Post by vineet12 »

It looks like a network issue but from the server side: Please see below if
you can pick up anything. It looks like it tries to send data to the socket with
content-type text/html instead of text/xml.

Let me know if you need any more information.

vineet <at> VBUbuntu:~$ export XMLRPC_TRACE_XML=1
vineet <at> VBUbuntu:~$ export ABYSS_TRACE_CONN=1
vineet <at> VBUbuntu:~$ export ABYSS_TRACE_SOCKET=1 // for low-level tracing

vineet <at> VBUbuntu:~$ /home/vineet/Desktop/mosesdecoder/server/./mosesserver
-config /home/vineet/Desktop/moses/model/moses.ini --server-port 8080
--server-log /home/vineet/log.txt
Defined parameters (per moses.ini or switch):
config: /home/vineet/Desktop/moses/model/moses.ini
distortion-file: 0-0 wbe-msd-bidirectional-fe-allff 6
/home/vineet/Desktop/moses/model/reordering-table.wbe-msd-bidirectional-fe.gz
distortion-limit: 6
input-factors: 0
lmodel-file: 0 0 5 /home/vineet/Desktop/moses/lm.srilm.gz
mapping: 0 T 0
ttable-file: 0 0 0 5 /home/vineet/Desktop/moses/model/phrase-table.gz
ttable-limit: 20
weight-d: 0.3 0.3 0.3 0.3 0.3 0.3 0.3
weight-l: 0.5000
weight-t: 0.2 0.2 0.2 0.2 0.2
weight-w: -1
Loading lexical distortion models...have 1 models
Creating lexical reordering...
weights: 0.3 0.3 0.3 0.3 0.3 0.3
Loading table into memory...done.
Start loading LanguageModel /home/vineet/Desktop/moses/lm.srilm.gz : [4] seconds
Finished loading LanguageModels : [6] seconds
Start loading PhraseTable /home/vineet/Desktop/moses/model/phrase-table.gz : [6]
seconds
filePath: /home/vineet/Desktop/moses/model/phrase-table.gz
Finished loading phrase tables : [6] seconds
Start loading phrase table from /home/vineet/Desktop/moses/model/phrase-table.gz
: [6] seconds
Finished loading phrase tables : [18] seconds
Abyss socket layer will trace socket traffic due to ABYSS_TRACE_SOCKET
environment variable
Listening on port 8080
Waiting 15000 milliseconds for READ of socket
Socket has 633 bytes available
Abyss socket: read 633 bytes: 'POST /rpc2 HTTP/1.1
Content-Type: text/xml
User-Agent: XML-RPC.NET
Host: vbubuntu:8080
Content-Length: 495
Connection: Keep-Alive

<?xml version="1.0"?>
<methodCall>
<methodName>translate</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>text</name>
<value>
<string>mr. makwana hamesha kahati thi dunia eak talab hai. hamare
karm us me fenke huye paththar aur achcha kaam karoge to khubsurat laher
milegi.</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>'
READ FROM SOCKET:
POST /rpc2 HTTP/1.1
Content-Type: text/xml
User-Agent: XML-RPC.NET
Host: vbubuntu:8080
Content-Length: 495
Connection: Keep-Alive

<?xml version="1.0"?>
<methodCall>
<methodName>translate</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>text</name>
<value>
<string>mr. makwana hamesha kahati thi dunia eak talab hai. hamare
karm us me fenke huye paththar aur achcha kaam karoge to khubsurat laher
milegi.</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
Abyss socket: sent 24 bytes: 'HTTP/1.1 404 Not Found
'
WROTE TO SOCKET:
HTTP/1.1 404 Not Found

Abyss socket: sent 25 bytes: 'Content-type: text/html
'
WROTE TO SOCKET:
Content-type: text/html

Abyss socket: sent 19 bytes: 'Connection: close
'
WROTE TO SOCKET:
Connection: close

Abyss socket: sent 37 bytes: 'Date: Thu, 06 Jan 2011 10:54:29 GMT
'
WROTE TO SOCKET:
Date: Thu, 06 Jan 2011 10:54:29 GMT

Abyss socket: sent 27 bytes: 'Server: XMLRPC_ABYSS/1.06
'
WROTE TO SOCKET:
Server: XMLRPC_ABYSS/1.06

Abyss socket: sent 2 bytes: '
'
WROTE TO SOCKET:

Abyss socket: sent 223 bytes: '<HTML><HEAD><TITLE>Error
404</TITLE></HEAD><BODY><H1>Error 404</H1><P>Not Found</P><p><HR><b><i><a
href="http://xmlrpc-c.sourceforge.net">ABYSS Web Server for XML-RPC For
C/C++</a></i></b> version 1.06<br></p></BODY></HTML>'
WROTE TO SOCKET:
<HTML><HEAD><TITLE>Error 404</TITLE></HEAD><BODY><H1>Error 404</H1><P>Not
Found</P><p><HR><b><i><a href="http://xmlrpc-c.sourceforge.net">ABYSS Web Server
for XML-RPC For C/C++</a></i></b> version 1.06<br></p></BODY></HTML>
vineet12
Posts: 4
Joined: 5. Jan 2011, 15:46
Primary OS: MS Windows 7
VBox Version: OSE self-compiled
Guest OSses: Ubuntu 10.10

Re: Cannot connect to port listening on Ubuntu 10.10

Post by vineet12 »

Its working now.

The url set was not correct, i needed an uppercase RPC.

Thanks for all your help.

Regards,

Vineet
Post Reply