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.
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, make, the header files for your Linux kernel and possibly perl installed."
You have already installed gcc, make, Perl and updated the Linux kernel. To investigate the kernel you use a "uname -r" command. You also go to /usr/src/kernels/ and find a directory name that does not match the results of the "uname -r" command. In /usr/src/kernels/ you execute the "ls" command and find this directory: 3.10.0-514.10.2.el7.centos.plus.i686
You then issue this command: uname -r You find this result: 3.10.0-327.el7.i686
Under normal circumstances, these strings match. What do you do to install Oracle VirtualBox Guest Additions on a Linux CentOS server?
Solution Reboot the CentOS guest. After you run "yum update kernel*" the changes (assuming changes were made) will not take effect completely until you reboot. Then install guest additions. The errors should go away.
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. The above steps by themselves would not change the hostname that you see on the command prompt either. To change the hostname for the "hostname" command to return the new hostname, and to have the character prompts reflect a new hostname, do this:
1. Modify /etc/hostname to the desired new hostname. 2. Save the file. 3. Reboot for the hostname on the character prompts to reflect the new hostname.
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?
Solutions
Solution #1 (preferred)
The easiest solution is to use this command: ip route | awk '{print $3}'
Solution #2
This solution avoids the "ip route". This solution takes more time.
a. Run this command: ip addr show b. Evaluate the results. The results of the above command will have integer values followed by discrete interfaces. For example you'll see "1: lo" and "2: ..."
The first result, "1: lo", is a loopback interface. The second result, "2: enp0s3", will be the interface you want (assuming there are only two interfaces). The lo interface by default will never have the default gateway. For a simple CentOS server the other interface will.
For CentOS 7.3 servers installed from the current .ISO (as of March 17, 2017) with the default settings, the name of the interface that can connect to the default gateway is "enp0s3" as shown above. There may be multiple interfaces with multiple default gateways for servers in complex environments with multiple NICs.
Also note that the corresponding file for this interface name will have a name that is prefaced with "ifcfg-". Therefore in /etc/sysconfig/network-scripts/ the file that governs the interface will be "ifcfg-enp0s3".
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. Thus you will know what IP address the Windows host has insofar as the Linux CentOS guest is concerned.
UPDATE: If you are using RHEL 8.x use these directions instead of the ones below.
Problem scenario You want to install Docker on an AWS instance of RedHat Linux (version 7.x or below). You do not want to use CentOS packages. What do you do?
Solution For RedHat Linux running via AWS, you have to run one command to enable numerous yum repositories. This way yum command can install many packages and dependencies. In this case, you just want to install Docker.
# If you cannot run yum-config-manager, see these alternative directions.
# To start the Docker service, run this command: sudo service docker start # For using kubeadm, you will need to enable the Docker service. This command can help you do that: sudo systemctl enable docker
If you want to install Docker on a RHEL server in GCP, see this posting. For CentOS in GCP you simply need to run sudo yum -y install docker.
For a variety of different Docker installation directions, see this posting.
For directions on using Docker without using the root user, see this posting.
Question: How Do You Get Yum Repositories to Work with a AWS Instance of RHEL? Problem scenario: You are using RedHat Linux via AWS and very few yum commands work. The repositories are very limited, and few packages are available. When trying to use yum to install packages, you see output like this:
"Loaded plugins: amazon-id, rhui-lb ... No package lynx available. Error: Nothing to do"
It may seem like you need to register a RedHat subscription (separate from your AWS account) to enable more yum repositories to be available. You do not know the corresponding credentials for an rhnreg_ks or rhn_register command. It seems as though your server has not been configured to use the Red Hat Update Infrastructure. You do not want to manually download various .rpms to the server. You may have contemplated setting up a RedHat satellite server to get your yum repositories to work like you think they should. You do not know why it seems this complex and difficult to get some common RedHat packages with the "yum install" command. What do you do to have yum commands install packages and their dependencies?
Solution Run this command to enable optional channels: