Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i have ubuntu installed on virtual box,but i am not able to install anything as ubuntu does not connect to internet.

My interface i.e eth0 was set to dhcp.when it was set to dhcp,it was not getting an IP address,so i went in and changed it to a static ip address.

I also changed the dns server.Still it does not connect.. My queries are

  1. What shld the DNS server address be?? shld it be the DNS address which i find when i do right click--->status on the internet. pls help
  2. What shld be the ip address ...current ip address is 192.168.1.100 255.255.255.0
share|improve this question

migrated from stackoverflow.com Sep 4 '10 at 5:10

This question came from our site for professional and enthusiast programmers.

    
What networking mode is your VM setup to use? NAT, Bridged, Internal or Host-only? –  heavyd Sep 4 '10 at 5:52
    
Sorry for the late reply ....i am new to this site..i was still checking in Stackoverflow...i am in bridged mode –  Vinod K Sep 4 '10 at 9:29

1 Answer 1

up vote 2 down vote accepted

The simple way to set up networking for a virtual machine running inside VirtualBox is to set up a host-only adapter and a NAT adapter. Let them both use DHCP (VirtualBox has a built-in DHCP server). Usually, this just works.

Only use a bridged adapter if you need a more complex networking setup. The most common reason is to have the virtual machine completely reachable from the outside. If you only need a few ports to be reachable from the outside, do it through NAT (see the VirtualBox manual).

If you use bridged mode, be prepared to have to learn more about networking. You can still use DHCP if there is a DHCP server on the network and it's willing to give you another IP address. You'll need to talk to your network administrator about this — some places only give out IPs to known machines and only one per machine (per MAC address). If you want to use a static IP, you'll also have to talk to your network administrator, so that the IP you pick is routed to your machine and doesn't conflict with another machine's. If you are your own network administrator, need bridged mode and don't understand what to do, you can get help here if you describe your network setup.

share|improve this answer
    
current ip address of ubuntu in virtual box is 192.168.1.100 255.255.255.0 .The static ip address i set on my windows machine is 192.168.1.102,i did this so that i could transfer the files from ubuntu to windows with help of Winscp...unfortunately this is not working..tht i guess is a diff issue....I connect to inter net using Username nd pass..i get a ip addr in the range of 111.92... –  Vinod K Sep 4 '10 at 17:21
    
@Vinod: if you set up both a NAT adapter and a host-only adapter, you will be able to both connect to the Internet from the VM and connect between the host machine and the VM. Again, setting up NAT + host-only is easier than setting up a bridge. –  Gilles Sep 4 '10 at 18:41
    
should i just set up NAT and host-only..what abt the addresses i should give?? –  Vinod K Sep 5 '10 at 1:14

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.