Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have as issue i am Ubuntu desktop and i have installed virtual-box(4.1) ISSUE:- Ubuntu 11.10 desktop is my host operating system and on Virtual-box i installed Ubuntu server selecting bridge adapter as my first adapter by default my network interfaces file get ip address by dhcp server but i want to setup an static ip.

by changing network interface file to static and gave some static ips my internet stop working on guest operating system(virtual-box -> Ubuntu server).

Can any one help me how can i setup static on virtual-box so that my internet will work too on my guest operating system.

thanks in advance.

share|improve this question
    
Need more information. Try posting screen shots of the dhcp configuration pages on your home router. –  hbdgaf Mar 17 '12 at 21:12
2  
make sure to enter dns info into /etc/resolv.conf, for example: nameserver 8.8.8.8 –  duffydack Mar 17 '12 at 23:31
    
I am also facing the same problem. I have set both eth0 and eth1 in my ubuntu12.04, which is installed in a virtual box.But I am unable to access the network Its still very confusing how to set a router in the virtual box with ubuntu installed. waiting for the reply. –  Udit Narayan Kar Jul 9 at 9:45

2 Answers 2

It would help to post the following:

#ifconfig eth0

Validate that the Static IP Address is in fact assigned to your virtual machine.

It's quie possible that due to a typo or error the static IP address never binded properly to your Ubuntu Instance. You did mention that upon initial install DHCP was able to acquire an IP Address, so we know the network is working.

Just as a quick test try doing the following:

Example:

#sudo ifconfig eth0 down
#sudo ifconfig eth0 192.168.1.55 255.255.255.0 192.168.1.1
#sudo ifconfig eth0 up

First set of octets is going to be your client IPADDRESS

Second set is the netmask

Third set is the gateway

That should temporarily set up eth0 with a static IP. Does that happen to work?

In the meantime please post the output of the following commands in a pastebin.ubuntu.com link

#ifconfig eth0

#cat /etc/default/interfaces

#dmesg
share|improve this answer

Just to be sure, you tell us:

by changing network interface file to static and gave some static ips my internet stop working on guest operating system(virtual-box -> Ubuntu server).

The IP address you assign to your virtual Ubuntu Server installation is is the same IP range as your local network?

If you gave an IP address that is in another IP range (say, in the IP range 10.0.0.0/8 [10.0.0.1 to10.255.255.254]), your virtual Ubuntu Server machine won't be able to communicate with your router -- your router won't be able to correctly route packets from your VM to Internet and vice versa.

If your local network has the IP range 192.168.0.0/24 (192.168.0.1 to 192.168.0.254), you should assign an IP address that is free in this range (say, 192.168.0.50).

Another option you might want to explore:

my first adapter by default my network interfaces file get ip address by dhcp server but i want to setup an static ip.

If you only want your VM to have the same IP address (I mean: not necessarily having to configure your Ubuntu Server to use a static IP address, but your server should always respond to the same IP address), you might want to get some information about DHCP reservations, so your DHCP server would always provide the same IP address to your server.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.