How to find the IP address of Linux guests

There’s a lot of examples in the internet showing how you can obtain the IP address of a libvirt guest virtual machine. Most of the examples show how to do that when the network is using NAT forwarding (aka “Virtual Networks”).

However, how to do that if your setup is using Bridged Networking and your guests receive an IP address from an external DHCP server?

One idea is to install the read the DHCP leases file straight from the guest FS. You can do that by using the libguestfs-tools to cat the file within the image. For RHEL 6 (and CentOS 6 and similar distributions) the process is similar to this:

For RHEL 7 (as well as CentOS 7 and similar) the process is slightly different due to the way NetworkManager stores the leases file:

In this Gist there’s a modified script I used to update the IP address of all guests in one shot.

MQTT Cheat Sheet

The MQTT (Message Queue Telemetry Transport) messaging protocol is a lightweight protocol well suited for the Internet of Things. It is a simple protocol and an ISO standard. It comes with an extensible reference documentation.

To help me learn about it and simplify my work flow, I created this cheat sheet (warning: PDF) which highlights the most relevant details about the protocol. You can also see it online here.

 

EOY 2016 links

Some links about interesting things I’ve read or watched by the end of 2016. Further comments are provided on each item of the list.

 

Google Sanitizers and Fedora 25

Here’s a tip if you are using Fedora and trying to use one of the Google Sanitizers with clang and is having problems doing so. One of the common problems is not being able to find libclang_rt.asan-x86_64.a:

This can be resolved by simply installing the compiler-rt package:

Restoring click method behavior on Fedora 25 and libinput

Here’s a quick tip if you need to enable the Software Button Area behavior on an Apple macbook running Fedora 25:

Some comments about this:

  1. You have to run it after every reboot
  2. There’s, probably, a better way to do this. Per documentation, it should be possible to set it up permanently by creating a file on /etc/X11/xorg.conf.d however I did not manage to create a file that works so far.

References: