Oracle VirtualBox Client (or VM or virtual Linux server) Has No Internet Access

Problem scenario:  You are running Linux 7.x in Oracle VirtualBox on a Windows Professional 7 laptop.  In the Linux server, you try to ping an IP address.  You get "connect: Network is unreachable."

Solution

1.  In the Oracle VirtualBox window of the server, go to Devices -> Network Settings -> Adapter 1

     a) Go to Attached To: and choose "NAT"

b) Check the box for "Cable Connected"

2.  On the client, modify this file /etc/sysconfig/network-scripts/ifcfg-enp0s3

a) Add these two lines, with no spaces, above the "ONBOOT" stanza without deleting other lines:

     DNS1=8.8.8.8
     DNS2=8.8.4.4

     b) Change the "ONBOOT" stanza to be yes, like this (with no spaces):

     ONBOOT=yes  

c) Save the changes.

3.  Reboot the client

4. If you are still having problems, you may want to see this posting.

Leave a comment

Your email address will not be published. Required fields are marked *