How to turn six Odroid-MC1 Solos I found on sale for 9 dollars into a PXE booted computer cluster on which to engage in further FOSS hijinks.

Parts

Quantity Description Source
6 Odroid-MC1-Solo 8 CPU/2GB RAM 32bit Hardkernel
1 MEAN WELL LRS-350-5 300W 5V 60 Amp Single Output Switchable Power Supply Amazon
1 Gigabit switch with >=7 open ports E-Bay
7 Cat6 RJ45 Snagless Ethernet Patch Cable in Yellow Color Amazon
6 MicroSD cards >= 8GB capacity Amazon
6 18 AWG DC Power Pigtail Cable, 2.1mm x 5.5mm Barrel Plug Wire Male Connectors Amazon
1 15A 250V Rocker Switch Power Socket Inlet Module Plug 5A Fuse Switch Amazon
1 Power cord Amazon

Tools

  • Cable Ties
  • Digital multimeter
  • Soldering iron, electrical solder, flux
  • Screw driver
  • Wire stripper
  • Electrical tape

Assembly

Power Supply

  • Checked on Mean Well power supply, changing switch on side from default of 230V to 115V.
  • Wired power socket to AC posts on power supply
  • Plugged power cord into socket and wall jack.
  • Turned socket switch on.
  • Measured DC output of power supply with multimeter, finding 5V as expected.
  • Turned off switch and unplugged cord from AC power.

Pigtails

  • Stripped lead ends of power pig tails to make slightly longer connections and tinned ends with soldering iron.
  • Removed a bit of the wire sheathing to allow lead ends to be separated further for connection between the most spread DC posts of the power supply.
  • Wired six pig tail power leads across the DC posts of the power supply.
  • Tested for continuity, against short circuits and to be sure center positive, outer negative connection on plug ends.
  • Wrapped pigtail bundle with electrical tape and cable tied wiring on power supply.

Cluster

  • Stacked the six MC1 units on top of each other and used cable ties on each side to hold stack together as a single unit.
  • Plugged a power lead from power supply onto each MC1 unit in stack.
  • Checked wiring connections over, plugged in power cord and turned power switch on.
  • Verified orange power indicator visible on each MC1 unit.
  • Turned off power switch and cabled connected each MC1 unit to network switch using Cat 6 patch cables.
  • Connected new network switch to rest of my network using Cat 6 patch cable to another switch already on the network.
  • Plugged in new network switch confirming active link on connection to existing network switch.

MicroSD Setup

With things mechanically assembled and seemingly electrically sound, the next step is to create a configuration to boot the MC1 off of on a MicroSD card.

On my computer, I downloaded a minimal Ubuntu 18.04 LTS image for the MC1 from Hardkernel.

Apply image to MicroSD

  • Open terminal window
  • Changed to directory where downloaded image file was saved.
  • Image file was downloaded as an XZ compressed file so I uncompressed using unxz command from XZ Utils
  • Inserted a blank MicroSD card into reader on my computer, noting from system log which device it was detected as. In this case the SD card was detected as /dev/sdc
  • I used the following command to apply image to SD card: dd if=ubuntu-18.04.3-4.14-minimal-odroid-xu4-20190910.img of=/dev/sdc bs=4M
    • The dd utility is powerful and can break things on your system if used incorrectly. It is critically important that you are certain of the device you wish the image written to, the bit after of=. If this worries you, or you are uncertain of what I am saying, you may wish to consider other methods for transferring the image to the MicroSD card such as using Etcher as documented by Hardkernel.
    • Be sure to use the correct image file name after if= and the correct destination device name after of= as there is a high probability of not succeeding and actually damaging your system if you execute the exact command I used without understanding it and adjusting for you specific circumstances.
    • Additional guidance on the use of dd and transferring images to MicroSD cards, can be found at this link from the Raspberrypi Foundation.
  • After the dd command completed it’s work and reruned me to a command prompt, I issued the sync command twice in a row to be certain buffer caches were committed to disk before removing the MicroSD card from my computer.

Initial MC1 Boot, Connection and Update

With image applied to MicroSD card, we are ready to boot one of the MC1 units into Ubuntu, connect to it, and apply some updates.

First time boot

  • Inserted the MicroSD card in one of the MC1 units, and turned on the power supply switch on the power socket.
  • All orange power indicators came on as expected, and after about 20 seconds, the MC1 unit with the SD card inserted began displaying an additional linking blue led indicating the heartbeat of a successfully booted system. Additionally the network switch was now showing an active network connection for this MC1’s port.

Find and Connect to Active MC1

  • The image I am using from HardKernel is configured to pick up an IP address from DHCP, so should have an address from you DHCP server or device such as a router providing DHCPi service. If you are not using DHCP then I will assume you know or can lookup how to find and connect to Automatic Private IP Addressing (APIPA) devices on your network. I run a DHCP server so I was able to identify what IP address on my local network was assigned to the MC1 node booted off the MicroSD card.
  • The image I am using, in addition to automatically picking up an IP address automatically via DHCP, also is configured to run an SSH server. Since the MC1 is a headless device, the easiest way to connect to it is over the network via an SSH client of your choice.
    • With the IP address of the device from my DHCP server log and the image default user name, I was able to successfully connect to the MC1 node using the following command in a terminal window, ssh root@192.168.1.109 and providing the default password.
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.14.165-172 armv7l)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

Last login: Sat Feb  1 08:38:15 2020 from 192.168.1.96
root@odroid:~#
  

Configure and Update

Now that I have successfully connected to the node, there are several things I want to change and update immediately. There are many additional changes which will be needed, but the ones listed below are a matter of urgency for me.

  • Change the default password
root@odroid:~# passwd
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
root@odroid:~# 
 
  • Create a new user account.
root@odroid:~# adduser chuck
Adding user `chuck' ...
Adding new group `chuck' (1000) ...
Adding new user `chuck' (1000) with group `chuck' ...
Creating home directory `/home/chuck' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for chuck
Enter the new value, or press ENTER for the default
	Full Name []: chrls
	Room Number []:
	Work Phone []:
	Home Phone []:
	Other []:
Is the information correct? [Y/n] y
root@odroid:~#
  • Grant new user ability to use sudo
root@odroid:~# usermod -aG sudo chuck
root@odroid:~#
 
  • Disable ability of root user to connect via ssh.
    • Before disabling root access via ssh be sure the new account created can connect and use sudo.
root@odroid:~# 
root@odroid:~# exit
logout
Connection to 192.168.1.109 closed.
chuck@setback ~/Downloads $ ssh 192.168.1.109 -l chuck
chuck@192.168.1.109's password: 
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.14.165-172 armv7l)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

Last login: Sat Feb  1 10:42:08 2020 from 192.168.1.96
chuck@odroid:~$ sudo ls -l /
[sudo] password for chuck: 
total 76
drwxr-xr-x   2 root root  4096 Jan 31 18:50 bin
drwxr-xr-x   2 root root  4096 Jan 31 18:53 boot
drwxr-xr-x  15 root root 14440 Jan 31 18:59 dev
drwxr-xr-x  91 root root  4096 Feb  1 10:36 etc
drwxr-xr-x   3 root root  4096 Feb  1 09:03 home
drwxr-xr-x  15 root root  4096 May 31  2018 lib
drwx------   2 root root 16384 May 29  2016 lost+found
drwxr-xr-x   3 root root  4096 May 29  2016 media
drwxr-xr-x   2 root root  4096 May 29  2016 mnt
drwxr-xr-x   2 root root  4096 May 29  2016 opt
dr-xr-xr-x 136 root root     0 Dec 31  1969 proc
-rw-r--r--   1 root root  1667 Sep 10 20:11 resize.log
drwx------   5 root root  4096 Jan 31 18:47 root
drwxr-xr-x  17 root root   560 Feb  1 10:44 run
drwxr-xr-x   2 root root  4096 Jan 31 18:51 sbin
drwxr-xr-x   2 root root  4096 May 29  2016 srv
dr-xr-xr-x  12 root root     0 Feb  1 10:42 sys
drwxrwxrwt  10 root root  4096 Feb  1 10:42 tmp
drwxr-xr-x  10 root root  4096 May 29  2016 usr
drwxr-xr-x  11 root root  4096 May 29  2016 var
chuck@odroid:~$ 
  
  • Since sudo works for user, it is time to disable root login via ssh.
chuck@odroid:~$ sudo sed -i 's/PermitRootLogin yes/#PermitRootLogin yes/g' /etc/ssh/sshd_config 
chuck@odroid:~$ sudo systemctl restart sshd
chuck@odroid:~$
  
  • Now let’s make sure root can’t get in anymore.
chuck@setback ~ $ ssh -v root@192.168.1.109
OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
...
debug1: Next authentication method: password
root@192.168.1.109's password: 
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
root@192.168.1.109's password: 
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
root@192.168.1.109's password: 
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
root@192.168.1.109: Permission denied (publickey,password).
chuck@setback ~ $
  
  • Make sure name DNS name resolution is working.
chuck@odroid:~$ sudo -i
[sudo] password for chuck:
root@odroid:~# mkdir /etc/systemd/resolved.conf.d
root@odroid:~# cd /etc/systemd/resolved.conf.d/
  • In the resolved.conf.d/ directory, create two files to set the DNS servers you want to use,and any serch domains needed. Files can be named whatever you like, but should have a .conf extension. Files in this directory will override the defaults for the systemd-resoved service. Below ar the files I used and the setting that work for me.
root@odroid:/etc/systemd/resolved.conf.d# ls
dns_servers.conf  domains.conf
root@odroid:/etc/systemd/resolved.conf.d# cat dns_servers.conf 
[Resolve]
DNS=192.168.1.96 1.1.1.1 8.8.8.8
Domains=~.
root@odroid:/etc/systemd/resolved.conf.d# cat domains.conf 
[Resolve]
Domains=grmmg.mine.nu
root@odroid:/etc/systemd/resolved.conf.d#
  • Finally change the /etc/resolv.conf link and restart systemd-resolved
root@odroid:/etc/systemd/resolved.conf.d# rm /etc/resolv.conf
root@odroid:/etc/systemd/resolved.conf.d# ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
root@odroid:/etc/systemd/resolved.conf.d# ls /etc/resolv.conf -ls
0 lrwxrwxrwx 1 root root 37 Feb  1 12:23 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf
root@odroid:/etc/systemd/resolved.conf.d# systemctl restart systemd-resolved
root@odroid:/etc/systemd/resolved.conf.d# systemd-resolve --status
Global
         DNS Servers: 192.168.1.96
                      1.1.1.1
                      8.8.8.8
          DNS Domain: ~.
                      grmmg.mine.nu
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 2 (eth0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
root@odroid:/etc/systemd/resolved.conf.d# exit
logout
chuck@odroid:~$
  • Apply all available updates to applications and the Ubuntu distribution.
chuck@odroid:~$ sudo apt update
Hit:1 http://ports.ubuntu.com/ubuntu-ports bionic InRelease
Get:2 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease [88.7 kB]   
Get:3 http://deb.odroid.in/5422-s bionic InRelease [1721 B]                                                  
Get:4 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease [74.6 kB]                              
Get:5 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease [88.7 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main armhf Packages [580 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports bionic-updates/universe armhf Packages [879 kB]
Fetched 1713 kB in 2s (808 kB/s)                                                   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
chuck@odroid:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
chuck@odroid:~$ sudo apt dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
chuck@odroid:~$ 

Next Steps

At this point we have a single MicroSD card which is reasonable base for either creating a new image off of and duplicating to the other five SD cards for the remaining MC1 nodes ore we can take things a little further and use what we have created as the foundation for a PXE boot solution for all of the nodes, as well as shifting the root file system off the SD cards and onto an NFS server, though that will be for another post.