Find the answer to your Linux question:
Results 1 to 7 of 7
Hi all, I have installed Ubuntu 12 and SSH server on my Virtualbox but I can't install Apache (Temporary failure resolving 'security.ubuntu.com') or ping anything. I think the thread attached ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2011
    Posts
    14

    Ubuntu on Virtualbox - can't ping


    Hi all,

    I have installed Ubuntu 12 and SSH server on my Virtualbox but I can't install Apache (Temporary failure resolving 'security.ubuntu.com') or ping anything. I think the thread attached has a solution to the problem - if so can anyone please translate this to tell me what I need to do? I have put my /etc/dhcp/dhclient.conf and /etc/network/interfaces below.

    Thank you...


    Code:
    $ cat /etc/dhcp/dhclient.conf
    # Configuration file for /sbin/dhclient, which is included in Debian's
    #       dhcp3-client package.
    #
    # This is a sample configuration file for dhclient. See dhclient.conf's
    #       man page for more information about the syntax of this file
    #       and a more comprehensive list of the parameters understood by
    #       dhclient.
    #
    # Normally, if the DHCP server provides reasonable information and does
    #       not leave anything out (like the domain name, for example), then
    #       few changes must be made to this file, if any.
    #
    
    option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
    
    send host-name "<hostname>";
    #send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
    #send dhcp-lease-time 3600;
    #supersede domain-name "fugue.com home.vix.com";
    #prepend domain-name-servers 127.0.0.1;
    request subnet-mask, broadcast-address, time-offset, routers,
            domain-name, domain-name-servers, domain-search, host-name,
            netbios-name-servers, netbios-scope, interface-mtu,
            rfc3442-classless-static-routes, ntp-servers,
            dhcp6.domain-search, dhcp6.fqdn,
            dhcp6.name-servers, dhcp6.sntp-servers;
    #require subnet-mask, domain-name-servers;
    #timeout 60;
    #retry 60;
    #reboot 10;
    #select-timeout 5;
    #initial-interval 2;
    #script "/etc/dhcp3/dhclient-script";
    #media "-link0 -link1 -link2", "link0 link1";
    #reject 192.33.137.209;
    
    #alias {
    #  interface "eth0";
    #  fixed-address 192.5.5.213;
    #  option subnet-mask 255.255.255.255;
    #}
    
    #lease {
    #  interface "eth0";
    #  fixed-address 192.33.137.200;
    #  medium "link0 link1";
    #  option host-name "andare.swiftmedia.com";
    #  option subnet-mask 255.255.255.0;
    #  option broadcast-address 192.33.137.255;
    #  option routers 192.33.137.250;
    #  option domain-name-servers 127.0.0.1;
    #  renew 2 2000/1/12 00:00:01;
    #  rebind 2 2000/1/12 00:00:01;
    #  expire 2 2000/1/12 00:00:01;
    #}
     
    $ cat /etc/network/interfaces
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet dhcp
    $
    Attached Images Attached Images

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Hi,

    To get on the 'net, the things you need on your VM needs are: an ip address, a DNS server, and a route to that DNS server. check the current state of your VM using the following commands and post them here:

    Code:
    sudo ifconfig
    Code:
    sudo route -n
    Code:
    cat /etc/resolv.conf

  3. #3
    Just Joined!
    Join Date
    Sep 2011
    Posts
    14
    Quote Originally Posted by atreyu View Post
    Hi,

    To get on the 'net, the things you need on your VM needs are: an ip address, a DNS server, and a route to that DNS server. check the current state of your VM using the following commands and post them here:
    @ atreyu - thanks for your help...

    Code:
    $ sudo ifconfig
    [sudo] password for juc1:
    eth0      Link encap:Ethernet  HWaddr 08:00:27:50:33:1a
              inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::a00:27ff:fe50:331a/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:373 errors:0 dropped:0 overruns:0 frame:0
              TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:48518 (48.5 KB)  TX bytes:14687 (14.6 KB)
    
    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:52 errors:0 dropped:0 overruns:0 frame:0
              TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:4032 (4.0 KB)  TX bytes:4032 (4.0 KB)
    
    $ sudo route -n
    
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 eth0
    192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
    $ cat /etc/resolv.conf
    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    nameserver 192.168.1.1
    nameserver 0.0.0.0
    $
    Last edited by Juc1; 04-15-2013 at 10:32 AM.

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    hmmm, that all looks good. or at least you have an ip address, a default route, and a DNS server.

    out of curiosity, what is the ip address of the DNS server on your host machine? btw, i assume your host machine is on the internet.

    do you have connectivity b/t the guest and host (i.e., can you ping host from guest)?

    Is there a firewall running on the host?

  5. #5
    Just Joined!
    Join Date
    Sep 2011
    Posts
    14
    Quote Originally Posted by atreyu View Post

    out of curiosity, what is the ip address of the DNS server on your host machine? btw, i assume your host machine is on the internet.
    Do you mean the DNS server of my ISP? If so please see attached.

    do you have connectivity b/t the guest and host (i.e., can you ping host from guest)?
    Do you mean the IP of the host as given by whatismyipdotcom ? If so then yes the guest can ping to this address.

    Is there a firewall running on the host?
    Do you mean the attached?

    Thanks...
    Attached Images Attached Images

  6. #6
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,526
    If you are running on virtualbox, the IP address is usually in a different range to that (10.0) and it is by default natted.

    Make sure that in the Virtual Machine Manager Settings the Network adapter is set to NAT and that the network connection in Ubuntu Network Manager is picking up it's settings using DHCP. This should allow you to connect to the Internet but not your local network.
    Last edited by elija; 04-16-2013 at 07:23 PM.
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

  7. #7
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Are you sure the guest is getting its ip address from the host? To test that, you can try this:

    Code:
    sudo ifconfig eth0 down
    sudo killall dhclient
    sudo dhclient eth0
    that will bring down the interface, then bring it back up and request an ip address (which should also assign a default route and DNS servers). to see what is what, run the commands from post #2 again and compare them to your original values.

    if it is still the same, try setting those dhcp config files back to their default states and retry again.

    btw, i confirmed on my Ubuntu 12.10 VirtualBox VM that the ip addr is 10.0.x.x, then default route is on that 10.0.x.x network, and the DNS server (in /etc/resolv.conf) is the same one that my VM host uses (and I'm guess should be what your ISP's DNS servers are - but let the DHCP server in the VM networking stack handle that).

Posting Permissions

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