A Long List of Docker Books

We found Docker Cookbook to be a good reference book about Docker.  The author, via O'Reilly Customer Service, responded to us saying that on page 79 near the top of Figure 3-1, the open curly brace "{" should be removed.  We were impressed the author took that the time to respond.

A shorter book written by two authors (neither of whom authored the Docker Cookbook) is called Docker Up & Running.  We thought this was a decent book with a good overview of terms and Docker in general.

Here is a long list of Docker books in alphabetical order:

Developing with Docker by Jaroslaw Krochmalski
The Docker Book: Containerization is the new virtualization by James Turnbull
Docker Containers: Build and Deploy with Kubernetes, Flannel, Cockpit, and Atomic by Christopher Negus
Docker Cookbook by Sebastien Goasguen
Docker: Docker Guide for Production Environment (Programming is Easy) (Volume 8) by Matthew Gimson
Docker for Sysadmins: Linux Windows VMware by Nigel Poulton
Docker in Action by Jeff Nickoloff
Docker in Practice 1st Edition by Ian Miell and Aidan Hobson Sayers 
Docker in Production: Lessons from the Trenches by Joe Johnston, John Fiedler, Milos Gajdos, Antoni Batchelli, Justin Cormack
Docker Networking Cookbook Paperback by Jon Langemak
Docker: The Complete Beginner's Guide by Byron Francis
Docker: The Complete Beginners Guide to Starting with Docker (Programming, Docker Containers, Linking Containers) by Austin Spencer
Docker: The Complete Guide To Mastering Docker In No Time - Discover Amazing Advantages Of Using Docker! by Nick Williamson
Docker: The Complete Introduction To Using Docker Containers Today by David Larson
Docker: The Essential User Guide to Mastering Docker In No Time! (Docker, Docker Course, Docker Development) by Walter King
Docker: The Ultimate Beginners Guide To Learning The Basics Of Docker by Steven Jones
Docker: The Ultimate Beginners Guide to Starting with and Mastering Docker Fast! (Programming, Docker Containers, Linking Containers) by Nick Williamson
Docker: The Ultimate Guide With Instructions To Docker Container Technology! (Programming, Docker Containers, Linking Containers) by Henry Hayes
Docker Up & Running by Karl Matthias & Sean P. Kane
Docker: What You Need to Know by John Symonds
Native Docker Clustering with Swarm by Fabrizio Soppelsa, Chanwit Kaewkasi
Using Docker: Developing and Deploying Software with Containers by Adrian Mouat

How Do You Find Logs on a Linux Server That Pertain to a Failed mount Command?

Problem scenario
You want to set up a file share through Oracle VirtualBox.  You are trying to mount a file share on a Linux guest running via Oracle VirtualBox on a Windows host.   The mount command fails and you want to find relevant logs.  What do you do?

Solution
To find logs that are appropriate to debugging a mount command that does not work, try this:

grep -e mount -e vboxsf -lR /var/log 2> /dev/null | xargs ls -lhn --sort=time

On a busy system with considerable logging, you can run the mount command once to get a baseline of results.  Then you could try the mount command that is failing.  Then wait a couple minutes.  Finally run the above "grep" command a second time.  The output of recently modified files should allow you to determine which logs are being updated by the failed mount operation.

The /var/log/auth.log file or /var/log/syslog file commonly gets updated with events related to the mount utility.  You may want to copy these files to the /tmp/ directory so you have a standalone copy.  In case these logs need to be updated while you are viewing them with vi, using a standalone copy will do no harm (and cause no corruption or prevent important logging).

For future reference
Sometimes you need to find appropriate logs for mounting a specific file system that has nothing to do with a file share for Oracle VirtualBox.  To find logs for a file system such as ext4, you would run this command:

grep -e mount -e ext4 -lR /var/log 2> /dev/null | xargs ls -lhn --sort=time

How Do You Install Linux on an HP Laptop?

Problem scenario:  You cannot install Linux on your new HP laptop. It seems that no configuration will work.

Solution

  1. To create bootable media, see this link.  Just having an .iso on a USB stick or CD ROM is not enough.
  2. To boot the laptop to a USB stick or DVD, use this link
  3. In the BIOS, enable "Virtual Technology." 

FYI
Some people find that BIOS must have "Virtual Technology" enabled for Linux to be installed.  This is probably a good idea because hosted virtualization through KVM is very useful.  You may need to delete every partition that the Linux installer finds to properly install Linux.  Windows is usually pre-installed on HP laptops.  HP does not officially support Linux on most consumer laptops.  We installed Linux on an HP 15z laptop, and there were no problems. (We have not used this model of laptop, but you may be interested in it.) For learning more about Linux, having a laptop with its Linux can help tremendously because laptops are portable.

How Do You Know If Guest Additions Have Been Installed on Your Linux Guest Running Via Oracle VirtualBox on a Windows Host?

Question:  How do you find out if Guest Additions have been installed on your Linux guest running via Oracle VirtualBox on a Windows host?

Background  We find this message to be ignorable when installing Guest Additions:  "Could not find the X.org or XFree86 Window System, skipping."

Answer
Go into the Linux guest and run this command:

lsmod | grep -i vbox

You should see results related to vbox.  If you see no results, then Guest Additions have not been installed.

Two AWS Servers Cannot Ping Each Other. What Is Wrong?

Problem scenario:  You have two AWS instances in the same security group.  The Security Group has rules for "All TCP" associated with both the public IP address (visible in the EC2 portion of the AWS Console) and the private IP address (found when you issue an "ifconfig" at the OS level of the server).  You find that the servers cannot ping each other.  You cannot SSH from one to the other either.

How do you get AWS instances to be able to ping each other?

Root cause:  The AWS Security Group rules are not properly configured for the servers to communicate with each other. There is a difference between "All traffic" and "All TCP." The "Type" options "All TCP" and/or "TCP" will not allow pings to work.  Pings are ICMP echo requests.  

Solution

Do the following:

  1. Find the IP address of each server at the OS level (e.g., with an "ifconfig" command).
  2. Go to "Security Groups" in the AWS Console.
  3. Click on the radio button for the security group that governs the instances (this step will not apply if you only have one security group).
  4. Go to the "Inbound" tab near the bottom then click the "Edit" button.
  5. Create a rule with Type "All traffic", and for the field with the IP address, use one of the IP addresses above with a "/32" at the end.  The result should be like this: x.x.x.x/32
  6. Create a rule with Type "All traffic", and for the field with the IP address, use the other IP address from above with a "/32" at the end.  The result should be like this: x.x.x.x/32
  7. Click save.

Relevant parting tips:

To have a more secure Security Group and have pings work without other communication working, for "Type" use "All ICMP - IPv4" (instead of "All Traffic").  Remember that SSH will not work when you have hardened your Security Group with such a configuration.

The Public IP address is usually not relevant for configuring AWS Security Groups for the purposes of allowing TCP/IP networking between instances. 

Optional reading: You may want to view this article on troubleshooting network problems.

You Cannot Apply Security Updates to Ubuntu Due to Errors about vim. What Should You Do?

Problem scenario:  You are running Ubuntu 16.10. When you log in you see this message:
65 packages can be updates. 33 updates are security updates.
As root you run this: apt-get upgrade
However you get this ominous message:
"The following packages have unmet dependencies: vim: Depends: vim-common (= 2:7.4.1829-1ubuntu2.1 2:7.4.1829-1ubuntu2 is to be installed vim-runtime (= 2.7.4.1829-1ubuntu2.1) but 2:7.4.1829-1ubuntu2 is installed
vim-tiny : Depends vim-common (= 2:7.4.1829-1ubuntu2.1) but 2:7.4.1829-1ubuntu2 is installed"

You tried to install aptitude to address this problem, but you receive an error similar to the messages above.  How can you apply the security updates for Ubuntu?

Solution:  To get around this problem with vim, try this command: "apt-get -f install".  Then run "apt-get update".  Finally, run "apt-get upgrade". The command "apt-get update" should be run first to update the meta data about potential packages and updates themselves.  This way when you install something, the latest package will be selected.  The command "apt-get upgrade" actually installs packages and updates on your machine (rather than merely update meta data about the updates that are available).  For more information, see this link.

How Do You Use Oracle VirtualBox for The First Time?

Problem scenario:  To install Oracle VirtualBox on a Windows host, use this link.  Assuming you have Oracle VirtualBox on a Windows host, you now want to create a virtual server also known as a guest machine.  You want Oracle VirtualBox to run a guest Ubuntu VM so you can have access to a Linux server straight from your laptop. 

Solution
1.  Open Oracle VM VirtualBox Manager
2.  Click the "New" button
3.  Give the server a name.  For the "Type" drop-down, choose "Linux."   For the version, choose "Ubuntu (32-bit)."  (Selecting this means you'll need a 32-bit version of Ubuntu.)
4.  Click Next.  
5.  For the Memory size, choose 1024 MB, unless you desire something else.  Then click "Next."
6.  Leave the option checked for "Create a virtual hard disk now. " Click "Create."
7.  For the "Hard disk file type" choose the VDI option unless you desire something else.  Click "Next."
8.  Leave the "Dynamically allocated" option checked unless you desire something else.  Click "Next."
9.  For the "Create Virtual Hard Disk" window, leave it at the default 8 GB unless you desire something else. Click "Create"
10.  Right-click the server (which should be in the upper left-hand corner with the name you entered).  Go to "Start" -> "Normal Start."
11.  You will be prompted with "Select start-up disk."   Do one of two things:  
i) Insert a DVD with a bootable .iso with a 32-bit version of Ubuntu.  Then choose the DVD drive in the pop-up window for Oracle VirtualBox. Then click "Start."  Finish the installation by following the directions in this link.
ii)  Leave this prompt open and do the following substeps:
a) Download this file:  http://mirror.pnl.gov/releases/16.10/ubuntu-16.10-server-i386.iso
  b) Windows can mount this .iso as if it were a bootable DVD drive. ISO GUI viewers or DVD software applications will allow you to mount it.  Using a CyberLink ISO Viewer (assuming it is installed), highlight the .iso file you just downloaded. Then click the icon for "Mount this ISO."
  c) Go back to Oracle VirtualBox.  Choose the drive letter that you mounted to in step "11.ii.b" (the previous sub-step).  Install Ubuntu.  For directions on how to install Ubuntu, see this link.  Once Linux is installed as a guest server, you can use this link to get to the Internet from the guest.

Connection Refused Error When Trying to Configure Chef Server on RedHat

Problem scenario:  You are trying to set up a Chef Client on a VM to be configured to communicate with your Chef Server (version 12). The OS of both servers (the Chef server and the server that will be the Chef client) is RHEL 7.3.

You run this command from a server that you want to be a Chef client:

knife client list

You get this:

    ERROR: Connection refused connecting to https://chef-server.name/organizations/myorg/clients, retry 1/5 ...

You need to keep SELinux enabled. There is no firewalld or iptables running on either server.  What do you do?

Solution There is an intermediate firewall that is blocking port 443.  Between the two servers, port 443 is filtered.  Assuming both servers are AWS instances, here is a solution.  

First find the IP addresses via the "ifconfig" command on two servers -- the Chef master server and the Chef client server.  In the AWS Security Group, create a Custom TCP rule.  Use these settings:

-For the "Type" have it be HTTPS.
-For the "Source" use "Custom."
-The field next to custom should have the IP address of the Chef Server obtained above with a "/32" at the end.  It will look like this: 172.31.21.5/32

Create a second inbound rule.  It should use these settings:

-For the "Type" have it be HTTPS.
-For the "Source" use "Custom."
-The field next to custom should have the IP address of the Chef Client obtained above with a "/32" at the end.  It will look like this: 172.31.21.6/32

How Do You Troubleshoot Common Problems With Puppet?

Problem scenario:  You want to troubleshoot a variety of issues with Puppet.  You go to Puppet's page for "Troubleshooting Common Errors." It says that a "A newer version is available; see the version menu above for details." ​

But every link newer than Version 2.8 you try gives you this "We tried to find that page, but 404."

Solution
Google the error itself.  If there is no error and it is a Puppet manifest that is not working properly, try this link.  Other useful links outside of the manifest not working include this one from Puppet and this one from Upguard.

How To Install Oracle VirtualBox 5.1 on Windows 7 Professional

Problem scenario  Your employer has no licenses for another virtual server.  You need a hypervisor to host a guest VM that runs a Linux OS.  Your workstation is running Windows 7 Professional.  What should you do?

Solution  Install Oracle VirtualBox 5.1. on your workstation. These directions are for how to install it on Windows 7 Professional.

1.  Get the installation media from this link.  Go to "Windows hosts" and download the file.  As of 1/20/17, it is 118 MB.

2.  Double-click the file.  Answer "Yes" to the "Open Executable File?" prompt.

3.  Click "Next" to the "Welcome to the Oracle VM VirtualBox 5.1.14 Setup Wizard" window.

4.  You can choose where to install it.  You may want to put it on a different hard drive.  But if you only have one (e.g., you are using a laptop), the default installation location is probably fine.  After deciding about where to install it, just choose "Next."

5.  For the next Window, you can unselect any option you do not want.  I would unselect "Create a shortcut in the Quick Launch Bar."  Then click "Next."

6.  Click "Yes" to the "Proceed with installation now?" prompt.

7.  Click "Install" to proceed.

8.  Click "Yes" to the Windows UAC confirmation prompt.

9.  You will be prompted to install this device software.  Choose "Install."

10.  You will be prompted to install this device software a second time.  Choose "Install."

11.  You will be prompted to install this device software a third time.  Choose "Install."

12.  Click "Finish" to the "Oracle VM VirtualBox installation is complete" window.