IP Address to access CouchDB running on Debian 8.6 on Virtualbox(latest)

Discussions related to using VirtualBox on Windows hosts.
Post Reply
jlb333333
Posts: 4
Joined: 17. Oct 2016, 12:59

IP Address to access CouchDB running on Debian 8.6 on Virtualbox(latest)

Post by jlb333333 »

Hi.
I have installed CouchDB 2.0 on Debian 8.6 running on Virtualbox installed on my Windows 10 PC
I also have CouchDB running on the host(Windows 10)
To replicate from one CouchDB setup to another, the complete http addresses are needed for both instances.
On my Debian 8.6, how do I find out what address CouchDB is running on?
Locally, on either machine, I would find it on localhost but how do I ascertain what address to use from the host machine to the 'Debian machine?
Using docker, a command: 'docker-machine ls' showed the required address.
I have used 'ip a' on Debian but this does not seem to tell me anything.
This must be a common question but the only queries I could find( in 2009)did not seem to help me.
It must be fairly simple.
I would appreciate help from the clever people.
I hope my explanation is adequate.
Many many thanks in advance for any help.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: IP Address to access CouchDB running on Debian 8.6 on Virtualbox(latest)

Post by scottgus1 »

One of the best pieces of advice you can use as a new VB'er is to solve your problem, if possible, as if you were running a physical PC. So for your Debian guest, if it was a physical PC, how would you find its IP address? A quick Googling might give you the "ifconfig" command (I believe, I am a Windows guy not Linux).

However, you'll need to be sure your guest is networked correctly to your host to allow communication. Virtualbox provides several types of network connections between host and guests. The default, NAT, is great for getting the guest on the internet but will not work for letting the host and the guest communicate. Try Host-Only or Bridged. See section 6 in the manual for the different networking types.
jlb333333
Posts: 4
Joined: 17. Oct 2016, 12:59

Re: IP Address to access CouchDB running on Debian 8.6 on Virtualbox(latest)

Post by jlb333333 »

Hi scottgus1.
Thank you for you comments and input.
I have looked at Chapter 6 of the Manual(Virtual Networking)
I don't understand most(all) of it.
As far as I can see, CouchDB is a server.
It is installed on Debian, running on Virtualbox.

The Manual says:

"Bridged networking

This is for more advanced networking needs such as network simulations and running servers in a guest. When enabled, VirtualBox connects to one of your installed network cards and exchanges network packets directly, circumventing your host operating system's network stack."

I have set my machine to Bridged Adapter. My PC is linked with a cable to my router so I used that choice, not the wifi.

Running 'ip a' on Debian gives the following output:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:89:3e:ec brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic eth0
valid_lft 62757sec preferred_lft 62757sec
inet6 fe80::a00:27ff:fe89:3eec/64 scope link
valid_lft forever preferred_lft forever

Running ifconfig produces:

eth0 Link encap:Ethernet HWaddr 08:00:27:89:3e:ec
inet addr:10.0.0.10 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe89:3eec/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:240373 errors:0 dropped:0 overruns:0 frame:0
TX packets:149731 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:207543256 (197.9 MiB) TX bytes:23624381 (22.5 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:31610 errors:0 dropped:0 overruns:0 frame:0
TX packets:31610 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:22778135 (21.7 MiB) TX bytes:22778135 (21.7 MiB)

I would be expecting something like "IPv4 : xxx.xxx.xxx.xxx

I hope the above doesn't tell anyone something I should to be showing.

Also, There are network settings under Virtualbox preferences, and network settings under Machine Settings. I am sure these must be 'in sync'.

Any help in the right direction would be appreciated.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: IP Address to access CouchDB running on Debian 8.6 on Virtualbox(latest)

Post by scottgus1 »

Yes, the manual can be a little thick at times. You have to live in it like you're learning a new language for a while.

It appears to me that your guest's IP address from ifconfig is 10.0.0.10, from this:

Code: Select all

eth0 Link encap:Ethernet HWaddr 08:00:27:89:3e:ec 
 inet addr:10.0.0.10 
The network types:
Bridged will allow your guest to appear as just another PC on your host's network. The host, all the other network PCs, the internet and the guest can all communicate. The guest would default to getting an IP address from your host network's router. The host needs to be connected to an active network to allow guests to use Bridged. And Bridged is not always compatible with Wi-Fi.

Internal makes a private network just for your guests. There is no host communication or internet. There is no DCHP server on an internal network by default, though you can put one on in Virtualbox. Otherwise configure static IP address for the guests within the guest OS's. Or you can make a router guest using a router OS like pfSense. You can make more than one internal network by naming the new networks differently.

Host-Only is a special form of internal network that also includes the host, via a virtual Host-Only network adapter made on your host, defaulting to IP address 192.168.56.1, and there is a default DHCP server handing out IP addresses to the guests starting at 192.168.56.101. You can change the IP address range or make multiple host-only networks in Virtualbox's Network settings in the main GUI. There is no internet in Host-Only.

Virtualbox has two kinds of NAT: regular NAT and a NAT network service. Regular NAT ("NAT" in the dropdown) connects each guest to the host's network connection and internet via an independent channel. The host and any other guests cannot connect to the NAT-connected guest, although ports can be opened, just like NAT in a router. (The NAT guest can, however, see any services and shared folders on the host's network.)

The NAT network service ("NAT network" in the dropdown) is like a home router, NAT to the outside world and multiple "LAN" guest connections. All the guests connected to this "NAT network" can see and communicate with each other. Internet is accessible. Ports can be opened just like a real router. You need to make a new NAT network in the main Virtualbox window, File Menu, Preferences, Network. Then attach the guests using the name of the NAT network you made in Preferences.
jlb333333 wrote:network settings under Virtualbox preferences, and network settings under Machine Settings. I am sure these must be 'in sync'.
No they should not be in sync, they should stay different. IP addresses are like street addresses: each house has to have a different number or the mailman gets confused. If you have changed the numbers in Preferences please change them back.

So it appears that your guest is at 10.0.0.10 Try that address and see if it works to get access to your guest. If it doesn't, don't change anything in Virtualbox's settings, and post these things:

1. open a command window on your Windows host and type the command "ipconfig" (note the p instead of f like Linux's "ifconfig:.) Post the output.

2. run another ifconfig in the guest and post the output.

3. find the guest's .vbox file, make a zip file of it and attach it using the "Upload Attachment" tab below the textbox where you're posting the above info. The .vbox file is the recipe of the guest, and it will show what network you're using for the guest.

To find the .vbox file, be sure your Windows host is set to show all extensions (google for how) and then open the main Virtualbox window. Right-click the guest then click "Show in Explorer". A folder window with the guest files will open. The .vbox file will be the blue cube icon, named the same as the guest name. Right-click the .vbox file and click Send To -> Compressed (zipped) folder. Attach the new zip file.
jlb333333
Posts: 4
Joined: 17. Oct 2016, 12:59

Re: IP Address to access CouchDB running on Debian 8.6 on Virtualbox(latest)

Post by jlb333333 »

Thank you scottgus1 for your reply.
Firstly, your opinion about 10.0.0.10 was correct.
I was able to connect from my Host to CouchDB on my Guest.
I am having trouble with CouchDB's GUI connection but that is a separate story and it can't be the connection address as command-line commands are being executed 100% correctly.
Thank you also for your comments on the network services.
The NAT network service looks like something I should try as well.
Many many thanks.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: IP Address to access CouchDB running on Debian 8.6 on Virtualbox(latest)

Post by scottgus1 »

NAT network won't let the host communicate without opening ports. Host-Only or Bridged are your best bets.

NAT is like a house router with one LAN port. You can have the whole world on one side through the internet, and one PC on the other side. In Virtualbox, the host is part of the "whole world" side. Each guest you connect through NAT gets its own private one-LAN-port router, and it's completely shut off from getting talked to by any other guests or the host, unless you open ports.

NAT network is the same kind of router, but with more LAN ports added. All the guests connected to the one private "router" (the one NAT network) can talk in their own private network. But the host and other guests can't get in, unless ports are opened.

Neither of these NAT's are convenient when you need the host and the guest(s) to talk freely.
jlb333333
Posts: 4
Joined: 17. Oct 2016, 12:59

Re: IP Address to access CouchDB running on Debian 8.6 on Virtualbox(latest)

Post by jlb333333 »

Many many thanks for your replies scottgus1.
Post Reply