CSCF Infrastructure Technology Group


CSI  » Setup Recipes  » Operating Systems  » Ubuntu  » Ubuntu Desktop Setup Guide

The Initial Ubuntu 18.04.2 Desktop OS Install

No I'm not going to tell you how to follow the installation procedure for one of the many ISO images available at "http://mirror.cs.uwaterloo.ca/ubuntu-releases/". Internet search will provide

A few suggestions I do have are:

  1. If your looking to exactly match the CSCF deployed systems,
    When you get to the "Updates and other software" screen, in the "What apps would you like to intall to start with?" area select "Minimal Installation".
  2. If you have two monitors (dual headed)
    Turn one of them off until the install is done. You can then add the second monitor using a "TwinView" Configuration (NVidia graphics card) in your "X Server Settings" (look in "System" -> "Administration" menu) after the install is finished.
  3. If the setup process does not detect all of the hard drives. It is likely that the motherboard supports on-board "SATA" Raid (winmodem styled cheap raid controller) that "dmraid" doesn't recognize properly (it doesn't seem to matter if the disk controller BIOS setting is SATA, RAID or AHCI). You need to remove Linux dmraid package from the install process.
     
    Boot the system with the "Try Ubuntu ..." selection and enter in a terminal window:
    sudo apt-get remove dmraid
    Now perform the setup by clicking the "Install Ubuntu ..." desktop icon (upper left corner of screen).
  4. If you're going to be connecting the host to one of the CSCF AD domains
    Make sure any local user accounts you create are unique (suggestion is to add a unique prefix like "local-" or "my").
  5. Check "/etc/hostname" and "/etc/hosts"
    Make sure the host name is the Fully Qualified Name minus whatever your official domain-name is, e.g. "cs.uwaterloo.ca".

So go ahead and do the base install, stopping just after the first reboot.

Updating the Apt Repository Sources to use the SCS sponsored local mirror.

  1. With the support of University of Waterloo School of Computer Science, the CS Club provides an official Canadian mirror (mirror.csclub.uwaterloo.ca) of many sites.

    CSCF setup makes use of this Ubuntu repository as their main Apt sources configuration file.

    Make sure this hosts "local apt key trust" has the ca-certificates package installed:
           sudo apt-get install ca-certificates
         
    Update /etc/apt/sources.list
           wget -q -O - \
             https://cs.uwaterloo.ca/cscf/internal/infrastructure/setups/os/ubuntu/UW-CS-common/etc/apt/sources.list
               | sed -e "s/CodeName/`lsb_release -c -s`/"       \
               | sudo -s tee /etc/apt/sources.list.d/uwcs-depot.list > /dev/null
         
    Update apt's local database, checking output for problems with new setup:
    sudo apt-get update
  2. Create /etc/apt/sources.list.d/canonical_partner.list

    Use this repository for up-to-date versions of Acroread, Flash, Skype, UEX, SUN Java, OpenBravo...

    Information from http://www.ubuntuupdates.org/ppa/canonical_partner

    sudo sh -c 'echo "deb http://archive.canonical.com/ubuntu/ `lsb_release -c -s` partner" > /etc/apt/sources.list.d/canonical_partner.list'
  3. These packages allow people to easily duplicate the Linux environments used within the Cheriton School of Computer Science.

    Add "depot.cs.uwaterloo.ca" gpg key to the local apt key trust.
    	if [ `lsb_release -sr` \> 22 ]; then 
               wget -q -O - \
                 https://cs.uwaterloo.ca/cscf/internal/infrastructure/setups/certs/depot.pub.gpg.key \
    	     | sudo tee /etc/apt/trusted.gpg.d/depot.pub.asc > /dev/null
    	else 
    	   wget -O - \
                 https://cs.uwaterloo.ca/cscf/internal/infrastructure/setups/certs/depot.pub.gpg.key \
    	     | sudo apt-key add - 
            fi
         
    Create /etc/apt/sources.list.d/uwcs-depot.list
           wget -q -O - \
             https://cs.uwaterloo.ca/cscf/internal/infrastructure/setups/os/ubuntu/UW-CS-common/etc/apt/sources.list.d/uwcs-depot.list \
             | sed -e "s/CodeName/`lsb_release -c -s`/"       \
             | sudo -s tee /etc/apt/sources.list.d/uwcs-depot.list > /dev/null
         
    Update apt's local database:
    sudo apt-get update

Update Kernel:

As of Ubuntu 16.04 LTS, Infrastructure group recommends using the HWE Kernel and supporting packages.

DESKTOP Systems
sudo apt-get install --install-recommends linux-generic-hwe-`lsb_release -sr` xserver-xorg-hwe-`lsb_release -sr` linux-tools-generic-hwe-`lsb_release -sr`

SERVER Systems
sudo apt-get install --install-recommends linux-generic-hwe-`lsb_release -sr` linux-tools-generic-hwe-`lsb_release -sr`

Update Kernel Tuning parameters:

Warning: This item maybe out of date WRT newer Linux kernels 5.0 and newer. A better solution maybe to use zram (and zswap) although that hasn't been evaluated by CSCF as of 2021-07-12

On hosts with plenty of memory, we want to reduce how aggressive the kernel is about swapping processes out.
By default swappiness=60, change the 10 below to 0 for lxc container IaaS (Infrastructure as a Service) containers or some other value but make sure you document your reasons/references in the sysctl.conf file!

echo -e "\n# \n# We have lots of memory so make system much less aggressive in swapping memory out to disk. \nvm.swappiness=10 \n" | sudo -s tee -a /etc/sysctl.conf

References:

  1. Linux Performance and Tuning Guidelines - IBM Redbooks
  2. What Is Swappiness on Linux? (and How to Change It) - Dec 2019
  3. Why most people recommend to reduce swappiness to 10-20? and the links it refers to
  4. Yoshinori's tutorial at the MySQL conference

Add Host to a SCS AD Domain (if it uses any SCS printing or network file server resourses).

For now, create a CSCF-INF RT request providing the name of the host, which domain (CS-TEACHING or CS-GENERAL or ...) for athentication and if the host should be restricted to a particular group of users within that domain.

You can also try to use https://www.cs.uwaterloo.ca/twiki/view/CF/ADAddUbuntu to add this host to a SCS AD Domain yourself.

Tracking the Basic Set of Packages that Define a SCS Infrastructure Desktop.

  1. Since we assume that all workstations are real hardware, all we need to install is: "uwcs-workstation" metapackage to make sure this host tracks the list of packages that define the base CSCF Infrastructure workstation system setup:
    sudo apt-get -y install uwcs-workstation

Enhance DHCP Services.