LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't connect Oracle on Fedora Virtual Box (https://www.linuxquestions.org/questions/linux-newbie-8/cant-connect-oracle-on-fedora-virtual-box-795160/)

aniceto 03-13-2010 11:39 AM

Can't connect Oracle on Fedora Virtual Box
 
Hi to all, im a newbie in this of linux. I want to have a linux virtualbox with DB servers like Oracle, MySQL, PostgreSQL and so on, so i installed Fedora in virtual machine of virtualbox. In the network configuration i set the Bridge Connection to enable Fedora to get IP from DHCP and it works fine. After that i've installed Oracle 10G Express and it works fine, i can connect without problems to oracle admin web application from Fedora. Previously i checked if port 1521 is open on fedora so when Oracle is running i use nmap and i get this:

Code:

nmap locahost
Starting Nmap 5.21 ....
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00015s latency)
rDNS record for 127.0.0.1: localhost.localdomain
Not shown: 996 closed ports
PORT      STATE      SERVICE
25/tcp    open      smpt
631/tcp    open      ipp
1521/tcp    open    oracle
8080/tcp    open    http-proxy

So, i think that port is open. The ip of virtual machine is 192.168.1.4 and host is 192.168.1.2 . After that, i ping both host between them and both are reachable, but when i try to connect to oracle from host using SQLDeveloper i can't, it gives me :
Code:

Error: Excepción de E/S: The Network Adapter could not establish the connection
The SID of database is XE, user and pass are dummy (SYS/server) and as the server address i use the IP (192.168.1.4) and port 1521 . So, after that i googled about it and people says that i have to check things like firewalls (not host nor virtual machine has one) and another is to do
Code:

telnet ip port
so i tried that and i get this:
Code:

aniceto@mypc:~/apps/sqldeveloper$ telnet 192.168.1.4 1521
Trying 192.168.1.4...
telnet: Unable to connect to remote host: No route to host

also i use netstat -nr to see if exists a router from my ISP and i get that:

Code:

aniceto@mypc:~/apps/sqldeveloper$ netstat -nr
Tabla de rutas IP del núcleo
Destino        Pasarela        Genmask        Indic  MSS Ventana irtt Interfaz
192.168.1.0    0.0.0.0        255.255.255.0  U        0 0          0 eth0
0.0.0.0        192.168.1.1    0.0.0.0        UG        0 0          0 eth0

As you see only shows my IP and 0.0.0.0, also used traceroute and i get this:

Code:

aniceto@mypc:~/apps/sqldeveloper$ traceroute 192.168.1.4
traceroute to 192.168.1.4 (192.168.1.4), 30 hops max, 60 byte packets
 1  192.168.1.4 (192.168.1.4)  9.609 ms !X  10.287 ms !X  10.284 ms !X

So i don't know another way to solve that. Thanks in advance.

kbp 03-14-2010 09:17 PM

Can you post the output of 'netstat -tnlp' from the vm and also the content of your listener.ora file ?

thanks

aniceto 03-14-2010 11:40 PM

Thanks for answer kbp, this is the output:

Code:

[root@server ~]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address              Foreign Address            State      PID/Program name 
tcp        0      0 0.0.0.0:8080                0.0.0.0:*                  LISTEN      1087/tnslsnr     
tcp        0      0 0.0.0.0:1521                0.0.0.0:*                  LISTEN      1087/tnslsnr     
tcp        0      0 127.0.0.1:631              0.0.0.0:*                  LISTEN      872/cupsd         
tcp        0      0 127.0.0.1:25                0.0.0.0:*                  LISTEN      1146/sendmail: acce
tcp        0      0 0.0.0.0:44252              0.0.0.0:*                  LISTEN      1119/xe_d000_XE   
tcp        0      0 ::1:631                    :::*                        LISTEN      872/cupsd

Well, i think that the relevant lines are those:

Code:

tcp        0      0 0.0.0.0:8080                0.0.0.0:*                  LISTEN      1087/tnslsnr     
tcp        0      0 0.0.0.0:1521                0.0.0.0:*                  LISTEN      1087/tnslsnr

As i see is the port of http server to see the web client and the 1521 for oracle.

About the listener.ora file, here is it (also tnsnames.ora):

Code:

# listener.ora Network Configuration File:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
      (ADDRESS = (PROTOCOL = TCP)(HOST = server)(PORT = 1521))
    )
  )

DEFAULT_SERVICE_LISTENER = (XE)

------------------

# tnsnames.ora Network Configuration File:

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = server)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

Also i want to add that the Fedora virtual machine name is server like the HOST name specified in listener.ora , and that the host machine is Ubuntu Karmic.

kbp 03-15-2010 10:44 PM

Does sqlplus connect ok from 'server' to itself ? ... also, just to confirm can you post the output of 'iptables -L' from host and vm ?

aniceto 03-16-2010 12:04 AM

Well, this is the output from my host machine (Ubuntu) of iptables -L:

Code:

oskar@ubuntupc:~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target    prot opt source              destination       

Chain FORWARD (policy ACCEPT)
target    prot opt source              destination       

Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination

And from virtual machine:

Code:

[root@server Desktop]# iptables -L
Chain INPUT (policy ACCEPT)
target    prot opt source              destination       
ACCEPT    all  --  anywhere            anywhere            state RELATED,ESTABLISHED
ACCEPT    icmp --  anywhere            anywhere         
ACCEPT    all  --  anywhere            anywhere         
ACCEPT    tcp  --  anywhere            anywhere            state NEW tcp dpt:ssh
REJECT    all  --  anywhere            anywhere            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target    prot opt source              destination       
REJECT    all  --  anywhere            anywhere            reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination

About sqlplus, i hadn't installed but today i installed sqlplus (having problems about shared libs, environment variables like ORACLE_HOME, ORACLE_SID, LD_LIBRARY_PATH) but with internet help i installed and tried and i can connect to instance as you can see:

Code:

[root@server server]# sqlplus

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 15 17:01:41 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Enter user-name: system
Enter password:

Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL>

So i don't know if is something about the iptables output because i don't understand really that output but i see that the output of my host is less than server (virtual machine) output.

Thanks for answer

kbp 03-16-2010 01:58 AM

It looks like iptables on the vm will be blocking access to the database, you'll need to permit port 1521

aniceto 03-17-2010 08:57 AM

Ok, i'm going to try tonight. I only have to modify iptables in vm or also i need to do the same on host machine?

kbp 03-17-2010 04:49 PM

Only in the vm, the pc's iptables rule list is empty with an accept policy so it won't block anything

cheers


All times are GMT -5. The time now is 12:59 AM.