Ubuntu 17.04 configuration

August 15, 2017

To get Ubuntu 17.04 nice and ready for software development, there are a few settings you might want to take care of first.

Fonts

If you’re dual booting, you might want to copy *.TTF and *.ttf from your Windows partition font directory into your Linux ~/.fonts directory.

As always, you need to make sure that your /etc/fonts/conf.d symbolic links are properly set:

$ ll /etc/fonts/conf.d/10-*
lrwxrwxrwx 1 root root 31 elo   10 17:01 /etc/fonts/conf.d/10-antialias.conf -> ../conf.avail/10-antialias.conf
lrwxrwxrwx 1 root root 29 elo   10 17:01 /etc/fonts/conf.d/10-hinting.conf -> ../conf.avail/10-hinting.conf
lrwxrwxrwx 1 root root 34 elo   10 18:22 /etc/fonts/conf.d/10-hinting-full.conf -> ../conf.avail/10-hinting-full.conf
lrwxrwxrwx 1 root root 40 elo   10 17:01 /etc/fonts/conf.d/10-scale-bitmap-fonts.conf -> ../conf.avail/10-scale-bitmap-fonts.conf
lrwxrwxrwx 1 root root 35 elo   10 18:24 /etc/fonts/conf.d/10-sub-pixel-rgb.conf -> ../conf.avail/10-sub-pixel-rgb.conf

Remember to switch the Gnome / KDE / XFCE4 apperance dialog into the Full hinting mode as well.

Unfortunately some of the Windows TrueType fonts include an embedded bitmap copy, which totally screws up the rendering for fonts such as Calibri. The solution is to disable embedded bitmap rendering.

mkdir -p ~/.config/fontconfig/conf.d
nano -w ~/.config/fontconfig/conf.d/20-no-embedded.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="embeddedbitmap" mode="assign">
      <bool>false</bool>
    </edit>
  </match>
</fontconfig>

After a quick relogin, your Calibri should be fine.

calibri-fine

Which is good, since various corporate email software packages use it as a default.

BBR congestion control

To get your bits running down the line double time, enable BBR congestion control:

/etc/sysctl.d/10-custom-kernel-bbr.conf:

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

Workaround to “Your connection was interrupted”

Those Finnish cable modem customers of the DNA.fi / Welho broadband Internet who get to enjoy the services of the “Cisco EPC3825 EuroDocsis 3.0 Data Gateway” cable modem, will have their IPv6 connection interrupted every 10-15 seconds, resulting in the always delightful “Your connection was interrupted” error message in Chrome.

Looking at the system log lets us know that for some reason, dhclient renews its lease every ~10 seconds, and executes the dhcp6-change scripts.

$ journalctl -f

elo 15 18:56:13 gumibook dhclient[29558]: PRC: Renewing lease on enp0s31f6.
elo 15 18:56:13 gumibook dhclient[29558]: XMT: Renew on enp0s31f6, interval 9680ms.
elo 15 18:56:13 gumibook dhclient[29558]: RCV: Reply message on enp0s31f6 from fe80::56d4:6fff:fee3:1748.
elo 15 18:56:13 gumibook NetworkManager[29478]: <info>  [1502812573.0750] dhcp6 (enp0s31f6):   valid_lft 60
elo 15 18:56:13 gumibook NetworkManager[29478]: <info>  [1502812573.0750] dhcp6 (enp0s31f6):   preferred_lft 30
elo 15 18:56:13 gumibook NetworkManager[29478]: <info>  [1502812573.0751] dhcp6 (enp0s31f6):   nameserver '2001:14b8:1000::1'
elo 15 18:56:13 gumibook NetworkManager[29478]: <info>  [1502812573.0751] dhcp6 (enp0s31f6):   nameserver '2001:14b8:1000::2'
elo 15 18:56:13 gumibook NetworkManager[29478]: <info>  [1502812573.0751] dhcp (enp0s31f6):   domain search 'bb.dnainternet.fi.'
elo 15 18:56:13 gumibook NetworkManager[29478]: <info>  [1502812573.0752] dhcp6 (enp0s31f6): state changed bound -> bound, event ID="b9:da:40:19|1502812573"
elo 15 18:56:13 gumibook dbus[929]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
elo 15 18:56:13 gumibook systemd[1]: Starting Network Manager Script Dispatcher Service...
elo 15 18:56:13 gumibook dbus[929]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
elo 15 18:56:13 gumibook systemd[1]: Started Network Manager Script Dispatcher Service.
elo 15 18:56:13 gumibook nm-dispatcher[8837]: req:1 'dhcp6-change' [enp0s31f6]: new request (1 scripts)
elo 15 18:56:13 gumibook nm-dispatcher[8837]: req:1 'dhcp6-change' [enp0s31f6]: start running ordered scripts...

Google-fu leads us to Ville Skyttä’s earlier discoveries in 2015.

And indeed,

$ sudo tcpdump -i enp0s31f6 -vvv -n ip6 | grep dhcp6

18:48:43.281218 IP6 ... dhcp6 reply ... T1:15 T2:45 ...

Which can be interpreted with a little help from RFC 3633.

The same settings weren’t problematic with a previous Ubuntu 17.04 installation which had been upgraded from 14.04 to 14.10 to 16.04 to 16.10 to 17.04, but on a clean vanilla 17.04 installation, I started getting connection problems.

I suppose there might have been other ways to solve the problem, but I just upped the IPv6 valid period to 6000 “seconds” (I think the UI and firmware developers were not exactly in sync with the units assigned to the various field values) in the modem UI, and the problems went away.

Let’s see if they stay gone.