LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-13-2010, 11:39 AM   #1
aniceto
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Rep: Reputation: 0
Question 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.

Last edited by aniceto; 03-13-2010 at 11:41 AM. Reason: I want to use code tags around the commands result
 
Old 03-14-2010, 09:17 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

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

thanks
 
Old 03-14-2010, 11:40 PM   #3
aniceto
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
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.

Last edited by aniceto; 03-15-2010 at 12:08 AM. Reason: Add additional info
 
Old 03-15-2010, 10:44 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Does sqlplus connect ok from 'server' to itself ? ... also, just to confirm can you post the output of 'iptables -L' from host and vm ?
 
Old 03-16-2010, 12:04 AM   #5
aniceto
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
Old 03-16-2010, 01:58 AM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
It looks like iptables on the vm will be blocking access to the database, you'll need to permit port 1521
 
Old 03-17-2010, 08:57 AM   #7
aniceto
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Original Poster
Rep: Reputation: 0
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?
 
Old 03-17-2010, 04:49 PM   #8
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

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

cheers
 
1 members found this post helpful.
  


Reply

Tags
oracle, telnet


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
fedora-11-x86_64 on virtual box mobinskariya Linux - Newbie 4 03-31-2011 12:14 AM
how can i install an application in fedora 11 if i'm using a sun virtual box? jelly10_sakura Linux - Newbie 5 10-10-2009 12:37 AM
Fedora 10--on Virtual Box (wireless) cnotejunebug Fedora 2 01-11-2009 10:46 AM
virtual box 2.1 problem on fedora 10 manojabala Linux - Software 1 01-08-2009 02:23 PM
Can't go beyond 800x600 resolution when running Fedora 10 on Virtual box. zeezulander Linux - Newbie 4 12-22-2008 11:46 AM


All times are GMT -5. The time now is 09:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration