This discussion is archived
6 Replies Latest reply: May 14, 2013 5:33 AM by EdStevens RSS

The host & VirtualBox network connectivity issue.

974057 Newbie
Currently Being Moderated
Hi, Experts,

I am really stuck up for the last week trying to sort out the network connectivity issue between Host And VIrtualBox.machines. Both have RHEL 6 installed.

I 've faced the same Issue few weeks back on the same Host machine where VIrtualBox wasn't able to established network connection. The Issue get resolved by disbling the xen Interface
suggested in this http://www.cyberciti.biz/faq/rhel-fedora-centos-linux-remove-network-interface-virbr0/ .
and The network connection between the Host and VirtualBox was establised. and It worked perfectly fine i 've even clone the Host EBS r12 DB to that VirtualBox.

I 'd to delete that VirtualBox machine as it was of 400GB size and created another machine of 200GB size. Installed the same OS which installed earlier i.e RHEL 6
also kept the same network configuration like IPs..
Now it failed to establish network connection to host machine.
I tried with AND Without disabling the xen enterface i .e
virsh # net-destroy default
on both Host machine and VIrtualBox. but when it didn’t work Than i remove yum groupremove “Virtualization” as well without any success.
Also i tried this too rpm -ev libvirt* on both Host & VirtualBox and removed that libvirt* rpm as well.

Both the machine can self ping itself but not to each other Also Firewall & iptable on both is disabled and stoped as well

Please see  the following configuration of both the machines

The Host IP configuration:
root@ebs Desktop]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1E:67:22:2D:6E
inet addr:192.168.122.6 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Memory:d0100000-d0120000

eth1 Link encap:Ethernet HWaddr 00:1E:67:22:2D:6F
inet addr:192.168.122.3 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::21e:67ff:fe22:2d6f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12343 errors:0 dropped:0 overruns:0 frame:0
TX packets:12451 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:10079134 (9.6 MiB) TX bytes:2473157 (2.3 MiB)
Memory:d0000000-d0020000

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:16436 Metric:1
RX packets:65 errors:0 dropped:0 overruns:0 frame:0
TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4920 (4.8 KiB) TX bytes:4920 (4.8 KiB)

vboxnet0 Link encap:Ethernet HWaddr 0A:00:27:00:00:00
inet addr:192.168.122.13 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::800:27ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:20710 (20.2 KiB)

THE VIRTUALBOX IP Configuration: VirtualBox configured with Host-only-Adapter.

*[root@idmebs Desktop]# ifconfig*
eth0 Link encap:Ethernet HWaddr 08:00:27:47:43:66
inet addr:192.168.122.10 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe47:4366/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:246 (246.0 b) TX bytes:5297 (5.1 KiB)

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:16436 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1828 (1.7 KiB) TX bytes:1828 (1.7 KiB)


The /etc/hosts & /etc/resolv.conf files of both the machines are also in sync.

Really Apprecaite any suggestion on the Issue. Kindly suggest.



Thanks & Regards
Priya
  • 1. Re: The host & VirtualBox network connectivity issue.
    BillyVerreynne Oracle ACE
    Currently Being Moderated
    Your host's network config looks suspect to me.

    I'm running Ubuntu 12.10 (x86_64) as host o/s. Via VirtualBox, I have OL6.4 (x86_64) VM running.

    I have 2 interfaces in the host o/s. eth0 and lo. Host o/s uses DHCP to obtain an IP for eth0.

    The VM is configured for a single bridged interface. In the VM, I have 2 interfaces only. eth0 and lo. VM o/s is configured for using DHCP to assign an IP to eth0.

    In your host o/s case - eth1 uses the same subnet as eth0. Why?

    vboxnet0 is used by the host o/s. Why? This indicates a virtual subnet created by VirtualBox for the VMs, and that these VMs are isolated on a private network, not connected to any existing network.
  • 2. Re: The host & VirtualBox network connectivity issue.
    EdStevens Guru
    Currently Being Moderated
    Billy  Verreynne  wrote:
    Your host's network config looks suspect to me.

    I'm running Ubuntu 12.10 (x86_64) as host o/s. Via VirtualBox, I have OL6.4 (x86_64) VM running.

    I have 2 interfaces in the host o/s. eth0 and lo. Host o/s uses DHCP to obtain an IP for eth0.

    The VM is configured for a single bridged interface. In the VM, I have 2 interfaces only. eth0 and lo. VM o/s is configured for using DHCP to assign an IP to eth0.
    Billy, I saw this also mentioned in your reply to HuaMinChen and am wondering .... if you run your VM with a DHCP address, doesn't this cause issues trying to use it as a "server"?

    I'd guess your usage and "host network" considerations are different than mine, but I have come to prefer a host-only adapter with a fixed ip in the subnet of the VBox adapter running on the host os. Actually, some issues I had the last couple of weeks (see my thread in the Oracle Linux forum) and some work I was doing this weekend have lead me to consider some adjustments to my long-standing procedure, but I don't want to further hijack the OP's thread, so I'll start a new one in a little bit, to discuss the details.
    >
    In your host o/s case - eth1 uses the same subnet as eth0. Why?

    vboxnet0 is used by the host o/s. Why? This indicates a virtual subnet created by VirtualBox for the VMs, and that these VMs are isolated on a private network, not connected to any existing network.
  • 3. Re: The host & VirtualBox network connectivity issue.
    EdStevens Guru
    Currently Being Moderated
    971054 wrote:
    Hi, Experts,

    I am really stuck up for the last week trying to sort out the network connectivity issue between Host And VIrtualBox.machines. Both have RHEL 6 installed.

    I 've faced the same Issue few weeks back on the same Host machine where VIrtualBox wasn't able to established network connection. The Issue get resolved by disbling the xen Interface
    suggested in this http://www.cyberciti.biz/faq/rhel-fedora-centos-linux-remove-network-interface-virbr0/ .
    and The network connection between the Host and VirtualBox was establised. and It worked perfectly fine i 've even clone the Host EBS r12 DB to that VirtualBox.

    I 'd to delete that VirtualBox machine as it was of 400GB size and created another machine of 200GB size. Installed the same OS which installed earlier i.e RHEL 6
    also kept the same network configuration like IPs..
    Now it failed to establish network connection to host machine.
    I tried with AND Without disabling the xen enterface i .e
    virsh # net-destroy default
    on both Host machine and VIrtualBox. but when it didn’t work Than i remove yum groupremove “Virtualization” as well without any success.
    Also i tried this too rpm -ev libvirt* on both Host & VirtualBox and removed that libvirt* rpm as well.

    Both the machine can self ping itself but not to each other Also Firewall & iptable on both is disabled and stoped as well

    Please see  the following configuration of both the machines

    The Host IP configuration:
    root@ebs Desktop]# ifconfig
    eth0 Link encap:Ethernet HWaddr 00:1E:67:22:2D:6E
    inet addr:192.168.122.6 Bcast:192.168.122.255 Mask:255.255.255.0
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
    Memory:d0100000-d0120000

    eth1 Link encap:Ethernet HWaddr 00:1E:67:22:2D:6F
    inet addr:192.168.122.3 Bcast:192.168.122.255 Mask:255.255.255.0
    inet6 addr: fe80::21e:67ff:fe22:2d6f/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:12343 errors:0 dropped:0 overruns:0 frame:0
    TX packets:12451 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:100
    RX bytes:10079134 (9.6 MiB) TX bytes:2473157 (2.3 MiB)
    Memory:d0000000-d0020000

    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:16436 Metric:1
    RX packets:65 errors:0 dropped:0 overruns:0 frame:0
    TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:4920 (4.8 KiB) TX bytes:4920 (4.8 KiB)

    vboxnet0 Link encap:Ethernet HWaddr 0A:00:27:00:00:00
    inet addr:192.168.122.13 Bcast:192.168.122.255 Mask:255.255.255.0
    That address for the vboxnet adapter looks very suspicios. I'd expect it to be 192.168.something.1 .. not 192.168.something.13. And almost always (not 100%) that 'something' has been "56".

    A few months back I had an issue with vbox just deciding to change the address of the adapter. Never found out why. But for you, I'd do the following:
    1) Open the Vbox management console
    2) Menu selection File -> Preferences
    3) In the "Virtual Box Settings" window, select "Network" from the navigation panel on the left.
    4) Select "Virtual Box Host-only Ehternet Adapter" and select to edit (the 'screwdriver' icon)
    5) On the "Adapter" tab, set the IPv4 Address to 192.168.56.1. (you could leave the third node at 122, but the 4th node should be .1
    6) make sure the IPv4 network mask is 255.255.255.0

    Stop and restart the vbox management console. Double check that what you did above 'took'. Then change your client vm configurations accordingly.




    inet6 addr: fe80::800:27ff:fe00:0/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 b) TX bytes:20710 (20.2 KiB)

    THE VIRTUALBOX IP Configuration: VirtualBox configured with Host-only-Adapter.

    *[root@idmebs Desktop]# ifconfig*
    eth0 Link encap:Ethernet HWaddr 08:00:27:47:43:66
    inet addr:192.168.122.10 Bcast:192.168.122.255 Mask:255.255.255.0
    inet6 addr: fe80::a00:27ff:fe47:4366/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:3 errors:0 dropped:0 overruns:0 frame:0
    TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:246 (246.0 b) TX bytes:5297 (5.1 KiB)

    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:16436 Metric:1
    RX packets:25 errors:0 dropped:0 overruns:0 frame:0
    TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:1828 (1.7 KiB) TX bytes:1828 (1.7 KiB)


    The /etc/hosts & /etc/resolv.conf files of both the machines are also in sync.

    Really Apprecaite any suggestion on the Issue. Kindly suggest.



    Thanks & Regards
    Priya
  • 4. Re: The host & VirtualBox network connectivity issue.
    BillyVerreynne Oracle ACE
    Currently Being Moderated
    EdStevens wrote:

    Billy, I saw this also mentioned in your reply to HuaMinChen and am wondering .... if you run your VM with a DHCP address, doesn't this cause issues trying to use it as a "server"?
    That depends on what the VM is used for and the nature of the DHCP server.

    My router at home serves DHCP IPs from an assigned IP block on a first-come first-serve IP handout. So when I configure RAC and storage server VMs at home, I use an IP from my static IP block as a VM server IP can change each time it boots. For other VMs (like DOS, Win3.1, WFW, NT, etc), I use DHCP.

    In the office, DHCP servers are MAC savvy - and once an IP has been allocated to a MAC, it gets the same IP again. But then I also do not actually use the VMs in the office as servers. We build stuff in a VM as test platform, and then deploy that to the real server.
    I'd guess your usage and "host network" considerations are different than mine, but I have come to prefer a host-only adapter with a fixed ip in the subnet of the VBox adapter running on the host os.
    I personally prefer bridged adapter configurations as I want the VM to be in the same environment (and subject to the same issues) as a real platform would be - but your method is preferred if that is specifically a problem, where having a VM directly on the network has IT security asking questions about this new platform on their network..
  • 5. Re: The host & VirtualBox network connectivity issue.
    974057 Newbie
    Currently Being Moderated
    Yes , You are spot on when i checked eth0 & eth1 on hosts machine through setup network configuration wizard that Both eth0 & eth1 was not active so once its gets activated
    than the Host can ping the VMbox & Vice Versa.

    Thank you so much for your invaluble Inputs.

    vboxnet0 has to be configured in VMbox in order to get the Host-only- adapter in VMBox network configuration thats why it is showing in Host machine in the output of ifconfig command.

    Could you tell whether vboxnet0 should not be showing in the host machine i.e in the output of ifconfig command



    Thanks & Regards
    Priya
  • 6. Re: The host & VirtualBox network connectivity issue.
    EdStevens Guru
    Currently Being Moderated
    Billy  Verreynne  wrote:
    EdStevens wrote:

    Billy, I saw this also mentioned in your reply to HuaMinChen and am wondering .... if you run your VM with a DHCP address, doesn't this cause issues trying to use it as a "server"?
    That depends on what the VM is used for and the nature of the DHCP server.

    My router at home serves DHCP IPs from an assigned IP block on a first-come first-serve IP handout. So when I configure RAC and storage server VMs at home, I use an IP from my static IP block as a VM server IP can change each time it boots. For other VMs (like DOS, Win3.1, WFW, NT, etc), I use DHCP.

    In the office, DHCP servers are MAC savvy - and once an IP has been allocated to a MAC, it gets the same IP again. But then I also do not actually use the VMs in the office as servers. We build stuff in a VM as test platform, and then deploy that to the real server.
    I'd guess your usage and "host network" considerations are different than mine, but I have come to prefer a host-only adapter with a fixed ip in the subnet of the VBox adapter running on the host os.
    I personally prefer bridged adapter configurations as I want the VM to be in the same environment (and subject to the same issues) as a real platform would be - but your method is preferred if that is specifically a problem, where having a VM directly on the network has IT security asking questions about this new platform on their network..
    So, yes, our (possibly self-imposed) requirements require different approaches. For my purposes, I don't want the vm to be at all visible outside of the host. They should work even when the host is not connected to any network at all. My long running thread with Dude last week showed that my NAT adapter was giving me more exposure than I had realized or wanted. I set up the NAT adapter only because in the build of a new linux vm I need to be able to get to Oracle's yum server to download necessary packages. This weekend I had an epiphany as I was building a new vm to host a Windows server. It occurred to me that since I didn't need to download any packages, and did NOT want to download MS's weekly load of new bugs - uh, "updates" -- I didn't need to configure a NAT adapter at all. Then I realized that for my linux vm's, I could configure the host-only adapter on nic 1/eth0 and the NAT on nic 2/eth1, and as soon as I was past the package downloads (the last one being the oracle-validated) I could just disable nic 2/eth1. Last night I tried just swapping the cards and eth0/eth1 configurations on an existing machine, and was completely successful. Another step in my network education.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points