Quicklearn Containers

31 Oct 2021

Background

I’m again running into an issue at work where there are gaps in what I know, and it’s slowing down my debugging process. The overall project has to do with running a MANET network with some nodes. Usually the nodes would be real physical devices that move around and dynamically connect and disconnect from each other (self-healing network). The MANET network layer is beta software, and mostly not in our domain. Our job is to try to turn their beta software into a usable product. For testing, we want to run the nodes on virtual machines (VMs). The current process is to use Vagrant to start a few VMs. This starts / configures a few Linux VMs with virtualbox. Then we run an Ansible playbook to install / configure the MANET network software. The current problem is that the ansible build fails. Each node hosts a web page, which is supposedly accessible from the host machine. Even when I ssh into the VM and manually start each service with failed before (which is mostly successful), I still can’t find the web page. One issue is that I don’t know what IP it’s supposed to show up from, but I do know the port. When I start the VMs, my host machine has another network interface, which indicates something about docker.

VM setup

I’ve read this post on virtualbox network settings which was very clarifying. I think we should be on a NAT network, but other people who I work with have gotten it to work with the NAT setting. Also, when I try to simply choose ‘NAT Network’ it doesn’t work / requires further setup. Because others have gotten it working with just NAT, I’m moving on from this for now.

Curious observations

Current questions

Networks with docker are confusing me right now, and while I don’t think this exercise will answer all my questions, I think I’ll gain a better framework for understanding how this internal network is working and will help me debug it.

This post is like the Quicklearn Networking post, but following Julia’s Kubernetes / containers section.

So I first reread the NAT section from the virtualbox networking post linked above. “A guest operating system on a VM can access hosts in a physical local area network (LAN) by using a virtual NAT (Network Address Translation) device. External networks, including the internet, are accessible from a guest OS. A guest machine is not accessible from a host machine, or from other machines in the network when the NAT mode is used for VirtualBox networking.” Well that answers some questions! But then how is the host supposed to be able to access the web page served from a VM? I’m guessing through the docker network interface (if that’s even what that interface is used for). The issue is that when I tried to use the docker IP with web server port, it didn’t work.

Post summaries

Docker is amazing

Some questions about Docker and rkt

Skipping a few that don’t seem relevant

What even is a container: namespaces and cgroups