how to connect the oracle db which is installed in windows machine from centos on virtualbox?

This is for discussing general topics about how to use VirtualBox.
Post Reply
dhinesh
Posts: 3
Joined: 8. May 2021, 13:32

how to connect the oracle db which is installed in windows machine from centos on virtualbox?

Post by dhinesh »

1)my host machine is a windows 10, i have installed oracle db in it.
2)i am trying to connect the jboss server from centos7 which is installed in virtualbox.
3)while the oracle db ip is configured to localhost(127.0.0.1) by default , i need the ethernet ip to be enabled to connect my linux to oracle db which is disabled at the moment due to default localhost ip.
4)oracle services are running fine so i don't know what to change.
So what i need to configure to access the oracle db from virtual linux machine ?
Attachments
i configured my vm as host only adapter
i configured my vm as host only adapter
Screenshot (38).png (68.77 KiB) Viewed 3447 times
ethernet shows media disconnected even oracle services are running fine
ethernet shows media disconnected even oracle services are running fine
Screenshot (37).jpg (64.87 KiB) Viewed 3447 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: how to connect the oracle db which is installed in windows machine from centos on virtualbox?

Post by mpack »

Your host is Windows 10? But you seem to have posted in the "Linux Hosts" forum. I will move your topic to "Using VirtualBox" since neither the choice or host OS nor the choice of guest OS seems especially relevant to the question asked.


A VM is just another PC. Make sure that host and guest share a network connection (e.g. use "bridged") and then configure them as you would any other two PCs on a network.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: how to connect the oracle db which is installed in windows machine from centos on virtualbox?

Post by scottgus1 »

"localhost" and "127.0.0.1" only work on the computer you're typing on. You can't access the host PC from the VM with localhost or 127.0.0.1. In the VM, these will only access the VM's services.

See Virtualbox Networks: In Pictures

Using Mpack's suggestion of Bridged, which would put the VM on the physical LAN along with the host, then you'd query the host's database using the host's LAN IP address 192.168.1.119 (One problem you might run into with Bridged is that 192.168.1.119 is a Wi-fi adapter, and Bridged does not always work over Wi-fi.)

Your VM is set to use Host-Only. This is also a valid way to access the host's database, using the host's Host-Only adapter IP address 192.168.56.1 Host-Only is a separate channel between host and VM, independent of the Wi-fi adapter.

You'll probably have to open appropriate ports for the database in the host's firewall.
dhinesh
Posts: 3
Joined: 8. May 2021, 13:32

Re: how to connect the oracle db which is installed in windows machine from centos on virtualbox?

Post by dhinesh »

scottgus1 wrote:"localhost" and "127.0.0.1" only work on the computer you're typing on. You can't access the host PC from the VM with localhost or 127.0.0.1. In the VM, these will only access the VM's services.

Using Mpack's suggestion of Bridged, which would put the VM on the physical LAN along with the host, then you'd query the host's database using the host's LAN IP address 192.168.1.119 (One problem you might run into with Bridged is that 192.168.1.119 is a Wi-fi adapter, and Bridged does not always work over Wi-fi.)

Your VM is set to use Host-Only. This is also a valid way to access the host's database, using the host's Host-Only adapter IP address 192.168.56.1 Host-Only is a separate channel between host and VM, independent of the Wi-fi adapter.

You'll probably have to open appropriate ports for the database in the host's firewall.
yeah i even tried bridged connection to establish the connection between host and vm but for some reason the connection is not getting enabled. I get that, once i establish bridged connection it will enable ethernet ip i can connect to oracle database on my host through that ip. But don't know what's the issue why it's not enabling the bridged network i even restarted the network in linux its not helping. It's showing unknown connection name enp0s8 but that is the actual name.
Attachments
Screenshot (43).jpg
Screenshot (43).jpg (53.91 KiB) Viewed 3439 times
Screenshot (42).jpg
Screenshot (42).jpg (61.71 KiB) Viewed 3439 times
Screenshot (40).jpg
Screenshot (40).jpg (46.86 KiB) Viewed 3439 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: how to connect the oracle db which is installed in windows machine from centos on virtualbox?

Post by scottgus1 »

dhinesh wrote: i even tried bridged connection...why it's not enabling the bridged network
scottgus1 wrote:Bridged does not always work over Wi-fi.
Did you notice this in the full quote you took of my message?

Your original setup was using Host-Only. Please try using it again.
dhinesh
Posts: 3
Joined: 8. May 2021, 13:32

Re: how to connect the oracle db which is installed in windows machine from centos on virtualbox?

Post by dhinesh »

scottgus1 wrote:
dhinesh wrote: i even tried bridged connection...why it's not enabling the bridged network
scottgus1 wrote:Bridged does not always work over Wi-fi.
Did you notice this in the full quote you took of my message?

Your original setup was using Host-Only. Please try using it again.
yeah scott i get that bridge does not always work over wifi, now i changed back to host-only adapter and i got the host-only ethernet adapter ip which is 192.168.28.1 from ipconfig on windows. If u know how to establish the oracle database connection with my jboss on linux virtual machine ,could you help me out in dependable manner as i am not sure how to do it as i am beginner practicing right now, because when i try 192.168.28.1:8080/apex (apex which is the oracle default login console page) on the edge browser i cannot enter into it(shows site can't be reached) and i also added oracle services to be allowed in firewall inbound rule(both oracle.exe and tnslsnr.exe) but still can't establish it. So explain me how to establish the connection, it would be helpful. Thanks. FYI as i mentioned earlier i have oracle10g installed on windows 10 host and i use vbox version 6.1.22.
Attachments
Screenshot (49).jpg
Screenshot (49).jpg (32.51 KiB) Viewed 3419 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: how to connect the oracle db which is installed in windows machine from centos on virtualbox?

Post by scottgus1 »

The original Host-Only adapter shown in your first posts was 192.168.56.1. It is now 192.168.28.1. How did it change? Did you manually change the IP address, or did you make a new Host-Only adapter or three? Looks like a lot of attempts at several different ideas. In tech support we call that 'thrashing', and a lot of stuff can break, especially with networking, where there is tons of room for pebcak errors.

Let's settle on one setup using Host-Only and not change anything else.

On the host OS's Command Prompt, run these commands and post the outputs:
cd "C:\Program Files\Oracle\Virtualbox"
vboxmanage list hostonlyifs
ipconfig /all


In the VM, run and post this:
ifconfig

Right-click the VM in the main Virtualbox window's VM list, choose 'Show in Explorer'. Zip the VM's .vbox file (not the .vbox-prev file), and post the zip file, using the forum's Upload Attachment tab. (Configure your host OS to show all extensions if the folder that opens does not show a .vbox file.)
Post Reply