My host machine is Ubuntu 20.04. I have an installed Oracle 8.5 tty version on my VirtualBox which I used oracle database 19.3.0. I have a bridge connection to my Oracle Linux and a second adapter as a 'host-only adapter'. I configured my listener - listener.ora in the following way. (test.max.com is my hostname)
and my tnsnames.ora
I checked my port 1521 whether it is open or not.
I used this command.
netstat -an | grep $1521
then I tried to connect java from my host machine(Ubuntu), I used the 'thin' client option, via bridge adapter. So I was stuck on a 'The network adapter could not establish connection' error.
P.S. I also tried the connection using a host-only adapter, before connecting I used the ping command IP of the host-only adapter, but it froze and it didn't show anything.
Suggesting you have some network connectivity problem from your vm-host to your vm-guest.
In vm-host open firewall port 1521 for outgoing/outbound packets.
In vm-guest open firewall port 1521 for incoming/inbound packets.
In vm-guest run ip a
command, to identify the IP4 addresses of vm-guest.
ping
command on each vm-guest IP4 address.Once you have network connectivity established.
lsnrctl status
tool documented here.Assuming your vm-host is Linux machine, suggesting to load a prepared Docker container installed and configured with Oracle database from Oracle or Docker hub.