There was a small form factor computer, an HP Pavilion, sitting forlornly in a corner in need of a new purpose in life. As proof of the fact that the computer is rather old, let's just say that it has an AMD Athlon 64 X2 dual core processor and it came with Windows Vista Media Centre (32 bit) preinstalled. I decided it could be used as a headless remote backup system. To that end the hard drive was replaced with a (nominal) 2 TB Seagate liberated from a USB 2.0 enclosure. The TV tuner expansion card was removed and the CD-ROM drive was ripped out to be replaced with a second hard drive. All that needed to be done was to install a Linux server distribution and that's when a problem manifested itself. I could not get the Wi-Fi network interface running. As the subtitle says, it was my own fault, the solution was in the manual.
Table of Contents
- Which Server Distribution?
- Initial Installation and Configuration
- Installing the Wi-Fi Interface
- Removing Snap
- Disabling Automatic Upgrades
- Disabling CloutInit
While I have installed various "light" Linux distributions on a number of ARM-based single-board computers in the last few years, my experience with similar installations on AMD64 systems is much more limited. The installation of Debian on an old Dell computer a few months ago was relatively simple (see Domoticz Backup Scripts), although I was surprised at how sparse the system was and remains. In any case, I installed the same "non-free" distribution and was quite pleased that the installer found both the Ethernet and Wi-Fi network interfaces and could proceed with the installation of "standard" Debian. However, I could not get the Wi-Fi card up on the installed image.
My next attempt was to install Mint 20 Mate. That went smoothly and the Wi-Fi worked in that distribution. However, installing a complete graphic user interface which would not be used just to enable the Wi-Fi card was not very satisfying. Of course it would be possible to remove the GUI and end up with a lighter distribution.
My third try was to install Ubuntu Server. Its installer did not find the Wi-Fi interface and again I was unable to install the Wi-Fi card once the OS was running. I also noticed that Snap was installed and I happen to have a probably unjustified bias against that package manager.
At that point, which was a couple of weeks ago, I ran out of time and had to abandon the project. Yesterday, I was able to come back to it and managed to get the Wi-Fi up in Ubuntu Server and to modify the latter to my liking.
The first thing I did after the initial boot was to edit the
sudoers file to reduce the number of times it is necessary to enter the user password when using the
The only member of the group
michel is user
michel, so the percent (%) prefix is not really necessary. Of course, others will have to adjust and use the correct user or group if doing the same thing. Then, as usual, the system should be updated and upgraded. Of course, it is necessary to have a network connection for this but fortunately,
Linux usually has no problem setting up wire Ethernet interfaces.
The next step involved repairing a mistake because I did not include the SSH server during the installation of Ubuntu when I think there was an opportunity to do so. First I verified that the prerequisite was installed, and then it was a simple matter to add the server and verify that it was installed.
As can be seen, I opened an SSH session about a minute after starting the server. Everything was done in SSH sessions from then on.
Because this server will be moved to another network which I know uses a different subnet, I deliberately continued with dynamic IP address which is not the best solution for a server. To make it easy to find the address, especially when the system will be used without a keyboard and without a monitor, I installed the ZeroConfiguration daemon,
avahi-daemon and modified its configuration file so that it will advertise the server as a desktop.
Checking on my desktop, I found the server with the Zeronconf browser.
The time zone is not set as shown by the
Since I know that nearby Halifax (N.S.) is in the time zone database, it was easy to confirm the correct name of the time zone in preparation for setting it with the same
A further call of the utility showed that the last step was successful.
The next step was to get the Wi-Fi network card running. Again, I would prefer that a server be connected to the local area network with an Ethernet cable, but this machine is destined to live in a dark corner of the basement of a relative where there is no hope of running a cable from the router on the first floor.
As it happens, Ubuntu not only recognized the Wi-Fi interface, but it installed the drivers.
NetManager package is not installed so I assumed that editing the
/etc/network/interfaces or the
/etc/dhcp/dhcpcd.conf and adding a WPA Supplicant configuration file with the Wi-Fi credentials should do the trick, much as it had in many installations of Debian based distributions on single board computers. To make a long story short, I could not manage it, but I eventually landed on an article, Ubuntu 20.04: Connect to WiFi from command line by Lubos Rendek (May 13, 2020), that set me on the correct path. It seems that for some time Ubuntu has been using a different network configuration tool: Netplan. After reading a bit of the documentation on that site and How to Use the Netplan Network Configuration Tool on Linux by Jack Wallen (September 7, 2018),
I came up with the following
netplan configuration file.
subiquity is the Ubuntu installer, so this
.yaml will not be overridden. The
ethernets section was already created by the installer, I added the
optional: true line because it would not do to suspend the boot process waiting for an ethernet connection which in the end will not be used. The interface name of the Wi-Fi card,
wlx00e533bf124a, I found with the
lshw command shown above, but it can be found with the
ip a command.
After rebooting, I was disappointed to see that the Wi-Fi card was not up.
Luckily, the system journal had some pertinent information:
Actually, I found the information another way, first by listing failed system services; there was one, and then checking its status.
I verified that the package, called
wpasupplicant, that contains
wpa_supplicant was not installed and then installed it in the usual manner.
The welcome screen after rebooting and logging back on the machine showed that everything worked.
Had I read the manual page for
netplan, I would have realized immediately that WPA Supplicant had to be installed.
In conclusion, installation of a Wi-Fi network interface in Ubuntu Server 20.04 is not complicated at all:
- Make sure that the hardware driver is loaded.
- Install the
- Add the needed Wi-Fi credentials to the the
Out of curiosity, I checked how the Wi-Fi interface is handled on my desktop running Mint 19 which is derived from Ubuntu.
I actually like that Ubuntu Server uses the built-in
systemd-networkd configuration controller instead of installing yet another package. However, there are some aspects of Ubuntu Server that I wanted to change.
Snap is the Canonical package manager that competes with Flatpak and AppImage. I think the way it is so closely tied into the system (try the
df -h command to see what I mean) sort of defeats the purpose. Furthermore, I was disappointed with early snap packages in Ubuntu 18.04 which was one of the reasons, but only a minor one, that pushed me to return to the Mint (the major reason is that I prefer the Mate desktop).
Removing the Snap package and daemon was not complicated following the instructions found in Disabling Snaps in Ubuntu 20.04 by Kevin Custer (April 20, 2020). I noticed that the installed Snap packages were not the same as in the article, but then the author may have been running the full desktop version of Ubuntu. On my system snap list showed that
lxd were the only packages running plus the spand service. The following commands were all that were needed on my system.
Unfortunately, forgetting to keep a keep a record, I cannot recall the actual name of the Snap core service that had to be unmounted. It can be found by running the df command. I did not find any of the Snap related directories mentioned in the article, but there was an additional directory, mostly empty, that I removed.
By default, automatic upgrades are enabled. I prefer to control the updates of the system so I disabled them.
The service that handles the upgrades, a Python script, still gets loaded by
systemd. If this is to be avoided, see How To Disable Unattended Upgrades On Ubuntu by sk (March 16, 2020) for the details on how to remove the package altogether. I'll wait until I am sure that is what I want, although it should be simple enough to install the deleted package if wanted.
This will take effect on the next boot. After reading what
CloudInit did, I preferred disabling the service just in case. Disabling the service did not change the locale, time zone or hostname so perhaps I will simply remove the package a little later on.
With all these changes, I found that the operating system occupies 118 Mbytes of the 3,72 Gbytes of available memory which is a relatively small footprint. According to
htop the system was running 29 tasks after settling down once the initial boot sequence was completed. This is not too bad, my Debian server has 78 tasks loaded which use up 141.7Mbytes but it is running two important servers,
nginx not yet added in the Ubuntu system.
Today, I have been looking at just how I should use this remote server and it struck me that I may be installing some lightweight NAS system which would mean replacing Ubuntu. No matter, this exercise was a lesson which I am glad to have completed.