How Do You Use an .Ova File with Oracle VirtualBox?

Problem Scenario:  You downloaded an .ova file.  You want to create a virtual server (a clone) with this pre-configured OS.  How do you use Oracle VirtualBox to use this .ova file?

Solution
1.  Open Oracle VirtualBox
2.  Go to File -Import Appliance (or press Ctrl-i)
3.  Select the OVA file
4.  Click “Next”
5.  Now you are ready to start the VM.

How Do You Install Nginx on a CentOS/RHEL/Fedora Server?

Problem scenario
You want to install Nginx on a CentOS/RHEL/Fedora Linux server.  What do you do?

Solution
1.  Create a file here: /etc/yum.repos.d/nginx.repo

2.  It should have these five non-blank lines:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
gpgcheck=0
enabled=1

3.  Run these commands:

sudo yum -y update
sudo yum -y install nginx
sudo systemctl start nginx

How Do You Troubleshoot a C++ Program That Will Not Compile Due to Undefined Reference Errors?

Problem scenario: You try to compile a C++ program with gcc, but you get this output:

/tmp/ccj6eKDl.o: In function `main’:
q.cpp:(.text+0x14): undefined reference to `std::cout’
q.cpp:(.text+0x19): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)’
q.cpp:(.text+0x28): undefined reference to `std::cout’
q.cpp:(.text+0x2d): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)’
/tmp/ccj6eKDl.o: In function `__static_initialization_and_destruction_0(int,

How Do You Troubleshoot Installing Oracle VirtualBox Guest Additions on a CentOS Server?

Problem scenario
You are running Oracle VirtualBox on a Windows host.  You have Linux CentOS guest server.  Guest additions fails to install.  You tried to run this script VBoxLinuxAdditions.run.  The run fails with an error saying “
check /var/log/VBoxGuestAdditions.log for details.”

You examined /var/log/VBoxGuestAdditions.log, and it said this:
“vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: Please check that you have gcc,

How Do You Permanently Change the Hostname of a Linux CentOS Server?

Problem scenario:  You edited the /etc/hosts file and the /etc/sysconfig/network file to have a new hostname. You used the “hostname newHostname” command (where newHostname is the desired new host name). You rebooted the server and the hostname is still localhost.localdomain. How do you configure the host name to be different?

Solution
None of the above steps were necessary for changing the hostname for the purposes of having the “hostname” command return a new hostname. 

How Do You Find the Network Interface Name of a CentOS 7.X Server That Will Connect to the Default Gateway of Your Network?

Problem scenario:  You want to find the name of the network interface that can connect to the default gateway on your Linux CentOS 7.x server.  Typical new deployments of CentOS 7.x using the minimal .ISO do not have the “route” utility nor the “ifconfig” utility installed.  How do you find the interface’s name (e.g., eth0) without using the “route” command? 

When Running Oracle VirtualBox on a Windows Host with a Linux Guest, What Does the Linux Guest Think Is the IP Address of the Host?

Problem scenario:  You have Oracle VirtualBox installed on a Windows host.  You have Linux CentOS as a guest VM. You want to test network connectivity (e.g., hostname resolution).  You want to know what IP address the Linux guest could use to interact with the Windows host.

Solution
Install traceroute with this command:

sudo yum -y install traceroute

Then use this command:

traceroute 8.8.8.8

The results of the above traceroute command will show you the packet hop from the Linux guest to the Windows host.