Cannot connect to port listening on Ubuntu 10.10

Asked by Vineet Kashyap

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'

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

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu virtualbox-ose Edit question
Assignee:
No assignee Edit question
Solved by:
Vineet Kashyap
Solved:
Last query:
Last reply:
Revision history for this message
Hilario J. Montoliu (hjmf) (hmontoliu) said :
#1

Hi,

have you tried to connect with http://<ip of ubuntu>:8080/rpc2 ?

If you haven't set up properly the windows hosts (iec:\windows\system32\drivers\etc\hosts) that maps ubuntu with it's IP or if you don't have a dns server around to translate that name to it's IP you'll need to provide the ubuntu's IP in the URL

HTH

Revision history for this message
Vineet Kashyap (vineetkashyap586) said :
#2

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}

I have modified the hosts file as well. Should i restart my network adaptor for it to recognize the changes ?

Revision history for this message
Vineet Kashyap (vineetkashyap586) said :
#3

I tried restarting my network adaptor but still the same exception. Anything else i can try ?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Can you ping the IP of the Ubuntu system?
As you are using bridged networking, does the Ubuntu system show in the DHCP client list

Revision history for this message
Vineet Kashyap (vineetkashyap586) said :
#5

Yes i can ping the guest and using bridged networking.

I have assigned IP address and DNS servers manually. It also has internet access.

Revision history for this message
Vineet Kashyap (vineetkashyap586) said :
#6

When i type http://vbubuntu:8080/rpc2 or with the ip in browser i get the following:

Error 404

Not Found

ABYSS Web Server for XML-RPC For C/C++ version 1.06

Revision history for this message
Vineet Kashyap (vineetkashyap586) said :
#7

When i type http://ubuntu:8080/rpc2 or with the ip in browser i get the following:

Error 404

Not Found

ABYSS Web Server for XML-RPC For C/C++ version 1.06

Revision history for this message
Vineet Kashyap (vineetkashyap586) said :
#8

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>

Revision history for this message
Vineet Kashyap (vineetkashyap586) said :
#9

Its working now.

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

Thanks for all your help.

Regards,

Vineet