How Do You Give Internet Access to a Linux Guest of Oracle VirtualBox Running on a Windows Host?

Problem scenario:
You created a new Linux CentOS 7.x guest server using Oracle VirtualBox on a Windows host.  Your Windows machine has Internet access.  From the Linux Guest you try to ping a 8.8.8.8 but you get this message “connect: Network is unreachable.”

How do you give the Linux guest Internet access?

Possible Solution #1
1.  Using the GUI of the Oracle VirtualBox guest server,

How Do You Install and Configure Postgresql on a Linux CentOS 7 Server?

Problem scenario:  You have a Linux Centos 7.3 server.  You want to get Postgresql to work on it.  What do you do?

Solution
To get Postgresql working on a CentOS 7.3 server, do the following four commands as the root user:

yum -y install postgresql-server postgresql-contrib

postgresql-setup initdb

systemctl start postgresql

systemctl enable postgresql

How Do You Find The Default Gateway of Your Linux Server?

Problem scenarios:  Either you are using CentOS 7.x (and ifconfig is even not a command) or you are using ifconfig and different flags (like -v for verbose), but you cannot find the default gateway.  How do you know if you have a default gateway even configured on a Linux server?

Solution  The “ifconfig” command cannot show the default gateway.  To find the default gateway on your Linux server,

How Do You Troubleshoot Chef’s Knife Command When You Get An Error About “Failed to read the private key”?

Problem scenario:  You are using knife commands and getting errors.  For example, you try to run this: knife client list
As a result, you get this error:

“WARN: Failed to read the private key /root/.chef/continual.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen – /root/.chef/continual.pem>
ERROR: Your private key could not be loaded from /root/.chef/continual.pem
Check your configuration file and ensure that your private key is readable”

What should you do?

How Do You Troubleshoot The Linux Error “/sbin/mount.vboxsf: mounting failed with the error: Protocol error”?

Problem scenario:  You are trying to share files between your Windows desktop host of Oracle VirtualBox and a Linux guest virtual server.  You run this command:

mount -t vboxsf contint /mnt/windows-share

but you get this error:

“/sbin/mount.vboxsf: mounting failed with the error: Protocol error”

Solution
For the example command above that reproduces the error, the “contint” needs to match the “Name” value in what was configured in the Oracle VirtualBox Devices -Shared Folders -Shared Folder Settings window.

How Do You Determine the Repo ID When For The “reposync” Command?

Problem scenario:  Synchronizing yum repositories has a number of benefits.  In a secure environment, CentOS/RedHat/Fedora servers have no access to the Internet.  There are numerous valuable yum repos on the Internet.  Your network administrator may grant you temporary access to such an Internet repository.  You may go to the directory on a server on your network that you want to mirror a copy or house a non-updating copy of the repo locally. 

How Can Linux Mint Prompt For A Username With Every Desktop Login?

Problem Scenario:  When logging into Linux Mint, the first and only field for text is a password prompt.  The corresponding username is not shown.  You do not understand this.  How do you get Linux Mint to prompt for a username?

Solution
Log in with the password of the user who just logged in.  Go to Menu -Administration -Login Window.  Uncheck “Automatically select the last logged in user.”  (When this setting is checked,

How Do You Use Putty To Connect To A CentOS Server (A Guest VM running on Oracle VirtualBox on a Windows Host)?

Problem scenario:  You have a Windows 7 host with Oracle VirtualBox.  You have a guest CentOS Linux virtual server.  How do you connect to a CentOS VM using networking?

Miscellaneous:  If you are looking for directions on how to give a Linux guest access to the Internet, these directions will work (assuming the host is running Windows).

Solution
#1  In Oracle VirtualBox go to Devices -Network -Network Settings.