2

I have set up VMware and installed a minimal CentOS (my laptop's OS is Windows 7). But cannot connect to the internet. Eventually I tried following this guide but still no luck.

Trying to ping a domain such as www.google.com returns unknown host. Trying to ping an IP address such as 8.8.4.4 returns Destination Host Unreachable, as does pinging 192.168.0.1 (my laptop's IP address - I believe). But pinging itself at 192.168.0.100 is successful.

The contents of /etc/sysconfig/network-scripts/ifcfg-eno16777736 are

TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTONCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eno16777736"
UUID="57fe27e3-790d-435c-a4bc-dff0e1a5fd5a"
DEVICE="eno16777736"
ONBOOT="yes"
HWADDR="00:0C:29:19:05:61"
IPADDR="192.168.0.100"
PREFIX="24"
GATEWAY="192.168.0.1"
DNS1="8.8.4.4"
DNS2="156.154.70.25"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_PRIVACY="no"

I realise a google search for this question returns many results, but none of the answers I've been able to follow have resolved it.

output of ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:39:19:05:61 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.100/24 brd 192.168.0.255 scope global eno16777736
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe19:561/64 scope link
       valid_lft forever preferred_lft forever

output of ipconfig from host (Windows 7)

Wireless LAN adapter Wireless Network Connection 2:
    Connection-specific DNS Suffix  . : home
    Link-local IPV6 Address . . . . . : fe80::a9ac:efe6:ba1e:e80%13
    IPV4 Address. . . . . . . . . . . : 192.168.1.75
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . :
Ethernet adapter VMware Network Adapter VMnet1:
    Connection-specific DNS Suffix  . : localdomain
    Link-local IPV6 Address . . . . . : fe80::581c:361f:cd90:e74c%52
    IPV4 Address. . . . . . . . . . . : 192.168.18.1
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . :
Ethernet adapter VMware Network Adapter VMnet8:
    Connection-specific DNS Suffix  . :
    Link-local IPV6 Address . . . . . : fe80::bd93:dfad:eb52:488e%53
    IPV4 Address. . . . . . . . . . . : 192.168.22.1
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . :

The rest of the output has Media disconnected.

VMware has the network configured for the CentOS VM to be NAT: Used to share the host's IP address.

  • Worth adding output of "ip a" and how you've configured networking within VMware ("NAT : Used to share the host's IP address", perhaps?) – steve Jul 11 '15 at 21:32
  • @steve I've added the output of ip a. I'm not sure what you mean about how I've configured networking with VMware. – Kvothe Jul 11 '15 at 21:45
  • If using VMware workstation you'll have VM settings, where you specify things like amount of memory, size of disks presented to the VM and how the network interfaces are setup. I'm using CentOS on VMware workstation and I happily use NAT. Use ipconfig on your laptop to make sure its IP address is truly 192.168.0.1 and also check its default router. – steve Jul 11 '15 at 21:49
  • 1
    @steve This link would seem to suggest that is the IP address of my router? I'll try correcting the host IP address in my CentOS setup – Kvothe Jul 11 '15 at 22:24
  • 1
    Just tried doing an automatic dhcp install and it connects! More importantly - yum can find packages now! When I'd tried to do installs previously I hadn't been altering the network settings at all - but I think that meant the ethernet connection was off... I've yet to go through and see what the actual IP address is but that can be a task for tomorrow. Thanks for your help @steve – Kvothe Jul 11 '15 at 23:20
2

Summary answer after exchange of comments : allow VM to obtain IP address + subnet mask + default router via DHCP.

  • 1
    Thanks for your help with this - the VM is now able to connect to the internet to install packages, etc which is exactly what I was asking for. I'm having trouble now trying to navigate to the VM in my browser after installing and setting Apache running on it (putting the IP of my VM in my browser as per here). Are you able to explain how to do this / direct me to somewhere that can? – Kvothe Jul 12 '15 at 17:00
  • Probably best to post a whole new question for that (rather than tag it all on the end of this existing question) together with details of your laptop's IP address, the VM's IP address, whether you can ping the VM's IP address and output of "ps -ef|grep http". – steve Jul 12 '15 at 17:08
0

You can set up internet on your Linux OS in virtual-box by following set of instructions:

  • Open your virtual-box's network settings and select NAT there.
  • Run your OS and go to the network settings in there and ADD VPN.
  • VPN would require some manual settings ,setup IP, subnet mask, default gateway address and DNS (USE your host configurations - find these by using cmd ) Use ipconfig /all in cmd and use the configurations in VPN same as those you find in cmd.
  • Make sure you turned off IPV6 and IPV4 are all automatic for WIRED.
  • Restart your virtual machine.

ONLY turn ON you WIRED option it would connect you to internet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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