Problems with accessing the Internet under a virtual machine in Ubuntu 11.04

Source: Internet
Author: User

Because you are using a mobile network, that is, mobile provides a network cable and dial-up Internet access. I installed ubuntu11.04 on the virtual machine. It is currently the latest version! As a result, you want to access the Internet on both the host and virtual machine. I checked a lot of information on the Internet, but I was not clear about it. On the basis of these materials, I have been doing things for a long time. Fortunately, I finally got it done! Next, let's take a look at my setup steps, hoping to help you!

========================================================== =========== Bridge Mode ======================================== ======================================

1. Set the network under the virtual machine to bridge:

2. Set the broadband connection attributes:


The system automatically sets "Local Connection" to Note that this setting will take effect only after the connection is disconnected and restarted!

3. Ubuntu network settings:

Sudo ifconfig eth0 192.168.0.x netmask, where X can be 2 ~ 254

Sudo route add default GW and set the default gateway. At this time, Ping and you will be able to ping it! In fact, at this time, I am connected to the Internet. If you ping Baidu's IP address, you can only ping the IP address, not the domain name, because the DNS server is not installed yet.

Sudo gedit/etc/resolv. conf, set the DNS server

Save. After restarting Ubuntu, you should be able to access the Internet!

========================================================== ========================================================== ======================================


========================================================== ========================================================== ======================================

A QQ Group created by myself! This article mainly discusses Linux C language, shell script, and driver development. You are welcome to join us. First of all, I declare that my skills are good .... Haha
QQ: 213622826

========================================================== ========================================================== ======================================


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.