Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Can't get "Bridged Adapter" to work in VirtualBox Network Settings

  1. #1
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Can't get "Bridged Adapter" to work in VirtualBox Network Settings

    I'll start in this forum but may have to take the question to VirtualBox forum.

    re: VirtualBox network configuration of VM Ubuntu-12.04.2 LTS server.


    My problem is that I can't get Bridge Adapter to work in VirtualBox VM Ubuntu-12.04.2-i386-server.

    I have the following configuration:


    • Ubuntu-12.04.1 LTS desktop as the host OS.
    • Wired connection to cable modem.
    • Installed the latest version of VirtualBox, 4.2.12.
    • Installed on VirtualBox a guest VM Ubuntu-12.04.2 32bit server.


    My problem is in setting up VirtualBox network so that I can access the guest server from my host desktop.

    In VirtualBox Network Settings I have set Bridged Adapter (eth0).

    However when booting up the VM a network connection isn't found.

    When I login to the guest OS on VM and run ifconfig iI don't see an IP address against eth0.

    If I try to run ping 8.8.8.8 from the guest OS I get ..
    connect: Network is unreachable.

    I cannot ping the guest server from the host OS.

    If I then shut down the guest server and change network settings to NAT (instead of Bridged Adapter)
    and then startup again I can ping from guest to host using ping 10.0.2.2. But in reading this chapter on virtual networking ...

    http://www.virtualbox.org/manual/ch06.html

    NAT is not recommended when running guest OS as a VM server.


    So what steps must I take to ensure that Bridged Adapter works?

    ...

    I've read these threads ...

    http://ubuntuforums.org/showthread.php?t=1945029

    https://forums.virtualbox.org/viewtopic.php?f=7&t=43090


    Note .. I've looked in
    /etc/udev/rules.d/70-persistent-net.rules

    but the file is empty.

    ...

    Other files in host OS

    /etc/network/interfaces

    auto lo
    iface lo inet loopback




    and in guest OS (the VM)
    /etc/network/interfaces

    # the loopback network interface
    auto lo
    iface lo inet loopback

    # the primary network interface
    auto eth0
    iface eth0 inet dhcp

  2. #2
    dino99's Avatar
    dino99 is offline Ubuntu addict and loving it
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Can't get "Bridged Adapter" to work in VirtualBox Network Settings

    is the guest-addition package installed (from oracle) ?

  3. #3
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can't get "Bridged Adapter" to work in VirtualBox Network Settings

    Thanks for the suggestion.

    I hadn't read the manual as far as guest-additions.

    https://www.virtualbox.org/manual/ch04.html#idp12039536

    Reading the manual further I see that the command

    $ sudo apt-get install dkms

    has to be run in the guest terminal.

    I didn't see any reference to a "guest-additions package (from Oracle)".
    I did find an Extensions package which I installed.

    Since this command requires network access I had to setup network to be NAT.

    Applied this command $ sudo apt-get install dkms

    After successful installation shut down the VM.

    Set Network Settings back to Bridge Adapter.

    Restarted the VM.

    But $ ifconfig continues to show no IP address.

    What have I missed?

  4. #4
    Join Date
    Feb 2008
    Location
    Texas
    Beans
    14,713
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can't get "Bridged Adapter" to work in VirtualBox Network Settings

    Thread moved to Virtualisation.

  5. #5
    Join Date
    Dec 2009
    Beans
    5,370

    Re: Can't get "Bridged Adapter" to work in VirtualBox Network Settings

    I'll admit that I have a problem in that I tend to read posts literally so this may be a silly observation but:
    I have the following configuration:
    Ubuntu-12.04.1 LTS desktop as the host OS.
    Wired connection to cable modem.
    Installed the latest version of VirtualBox, 4.2.12.
    Installed on VirtualBox a guest VM Ubuntu-12.04.2 32bit server.
    In Bridged Mode the guest machine makes an independent connection to ( via a "bridge" to the hosts network card ) and receives it's IP address from the same router the host machine does. If you in fact have a "cable modem" and not a modem/router combination there is no router.
    Last edited by Morbius1; May 21st, 2013 at 12:46 PM.

  6. #6
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can't get "Bridged Adapter" to work in VirtualBox Network Settings

    Thanks. I think you may have hit the nail on the head.
    I do only have a cable modem and not a router.

    From reading this chapter ...

    http://www.virtualbox.org/manual/ch06.html

    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.

    It is was not clear to me that bridged networking only works with routers and not cable modems?

    Reading further posts I read that I should try to setup two Network Adapters in the guest OS:
    • NAT
    • Host-only


    as described here ..

    http://superuser.com/questions/38471...bridge-adapter

    I'll keep tweaking but stop trying Bridged Networking. However the manual (above) does suggest that a Bridged Adapter is needed for guest server testing and that is why I was persisting down this path.

    Also the ultimate goal is to export from VirtualBox an image of the (tested) guest OS to be placed in the cloud.
    Last edited by dragonfly41; May 21st, 2013 at 01:42 PM.

  7. #7
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can't get "Bridged Adapter" to work in VirtualBox Network Settings

    If you need to access the guest, you can still use NAT and then set port forwarding on the VM properties so you can access it.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  8. #8
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can't get "Bridged Adapter" to work in VirtualBox Network Settings

    Thanks .. with two network adapters (NAT and host-only .. in that order .. it seems there is a difference if order is changed)
    I'm now able to ping in both directions host <--> guest.
    IP addresses: host 192.168.56.1 and guest 192.168.56.101

    I can access guest LAMP from host via http://192.168.56.101/

    This blog was helpful.

    http://christophermaier.name/blog/20...ith-virtualbox


    Host
    The contents of /etc/network/interfaces in host:-

    Code:
    # the loopback network interface
    auto lo
    iface lo inet loopback
    
    # the primary network interface
    auto eth0
    iface eth0 inet dhcp

    Guest
    The contents of /etc/network/interfaces in guest:

    Code:
    # the loopback network interface
    auto lo
    iface lo inet loopback
    
    
    # the primary network interface
    auto eth1
    iface eth1 inet static
    address 192.168.56.101
    netmask 255.255.255.0
    network 192.168.56.0
    broadcast 192.168.56.255
    
    # note: gateway and dns-nameservers are not defined here .. should they be?
    Cannot connect from guest to Internet
    My current issue is I'm not not able to ping from guest to external Internet .. e.g. getting updates into the guest OS.

    What must I now setup to get Internet access?

    It seems that with only a cable modem (no router) I can't use Bridged Networking as a third adapter type.

    I'm now reading up on VBoxManage scripts so I can better dump relevant troubleshooting information.

    my ultimate requirement:
    ping host to guest (this now works) ping -c 4 192.168.56.101
    ping guest to host (this now works) ping -c 4 192.168.56.1
    ping guest to Internet (this has yet to work) ping -c 4 8.8.8.8 (Network Unreachable)

    I'm not sure if changing NAT type under File > Preferences > Network might help.

  9. #9
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can't get "Bridged Adapter" to work in VirtualBox Network Settings

    You would need to use NAT instead of Host-only. It will give the guest a 10.2.x.x IP address.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  10. #10
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can't get "Bridged Adapter" to work in VirtualBox Network Settings

    You would need to use NAT instead of Host-only.
    But I am using NAT as Adapter1 and Host-only as Adapter2.

    Are you suggesting disabling Host-only and using only NAT?

    Thanks.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •