Skip to content

Ubuntu 20.04 LTS

Todd Eddy edited this page Aug 8, 2020 · 10 revisions

Overview

  • See #4 for ticket created to add this
  • Ubuntu no longer officially supports the old debian installer / kickstart files. At least they went with cloud init instead reinventing another standard. While kickstart files should still work they shouldn't be relied on so might as well fix it now.
  • Looking in to netbooting and they've also dropped even mentioning the netboot image and instead wanting everyone to use the main server installer. A problem with this is while testing getting pxeboot working (see below) I had it get initial images and started download of iso but it failed because it ran out of room.
  • New autoinstall seems like a merge of cloud-init and curtin

Related pages in this wiki

Pxebooting

  • Copy ubuntu-20.04-live-server-amd64.iso to a local server to host it on a web site. Ideally this is on the same server as tftpd since you'll need to extract some files.
  • Double check you can download the iso locally.
  • Rest of this assumes you are setting up tftp server on same host that is hosting iso
apt install tftpd-hpa
mkdir /mnt/iso
mount -o loop $path_to_iso /mnt/iso
cp /mnt/iso/casper/{vmlinuz,initrd} /srv/tftp
umount /mnt/iso
rm -rf /mnt/iso
mkdir /srv/tftp/pxelinux.cfg
cat > /srv/tftp/pxelinux.cfg/default <<"_EOF_"
DEFAULT install
LABEL install
  KERNEL vmlinuz
  INITRD initrd
  APPEND ip=dhcp url=http://YOUR-INTERNAL-SERVER.example/isos/ubuntu-20.04-live-server-amd64.iso
_EOF_
cd /mnt/tftp
# looks like the directory that I wget from has all the legacy netboot files needed
# which may save time when doing installs still doing it The Suggested Way
wget http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/pxelinux.0
wget http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/ldlinux.c32
chown -R tftp:root /srv/tftp
find /srv/tftp -type d -exec chmod 0755 {} \;
find /srv/tftp -type f -exec chmod 0644 {} \;
  • edit /etc/default/tftpd-hpa
    • at least change TFTP_DIRECTORY to /srv/tftp
    • Also made TFTP_OPTIONS to --security --verbosity 5
  • run systemctl restart tftpd-hpa to pickup new changes

Configuring DHCP

TBD

Initial attempts at netboot

  • Initially had a bunch of issues till I set the right DHCP options. Was still not successful as it complained about not enough space. So still a work in progress
    • Turns out this was an issue with memdisk not having enough space. Had to up the memory on VM to 3GB before it could download the entire iso. Haven't done a full test using netboot.

Attempted to install with kickstart file fails

Tried to use the 18.04 kickstart file by modifying the boot string to add ks=http://... and it completely ignored it. Maybe extra config options had to be specified or you had to use the alternate install img (if that even exists now)

Looking at release notes on 20.04.1 and saw mention of http://cdimage.ubuntu.com/ubuntu-legacy-server/releases/20.04/release/ which peaked my interest. Turns out that's what they call the alternate install image now. That ISO does support kickstart files. Even better I was able to use my 18.04 kickstart with zero modifications and it worked. And since that can turn off the install recommends option it brings package list down from 568 using new installer to 352 with legacy server image. Interestingly it doesn't install snapd so I guess it's not a requirement.

Initial install

  • Testing setup: VirtualBOX with 20gb drive and 2gb ram and 2 vcpu
  • Be sure vm's network is set to bridged so you will pull a the BOOTP files needed
  • on boot press F12 and then L to use netboot since it doesn't appear to by default
  • Since netboot didn't actually work I did a full install by loading ISO in to virtualbox
  • Once you see keyboard on bottom of screen hit escape
    • Did some hunting around in startup options and nothing useful
  • Entered local apt-cache server when it asked for proxy
  • use entire drive and choose setup LVM group
  • Install OpenSSH - Has an option to import keys from github or launchpad but I didn't do that
  • now during install all you get is ctrl-alt-F2 to get a terminal session but no way to show debug logging. Suppose could just figure out where the install log is writing to and use that

Initial remarks

  • The naming of lvm is bad because they use dashes in name it becomes /dev/mapper/ubuntu--vg-ubuntu--lv
  • Uses around 2.2GB space
  • Doesn't create a swap partition
  • Made / only 4GB. With /boot at 1GB that leaves 15GB in LVM to expand existing mounts or create new ones
  • It creates several snap mounts include LXD which a basic server shouldn't need. Except....
    • Note the core18 snap mount. What it's doing is loading a core 18.04 snap module and then overlays local file system over it (or other way around). All that's installed are some updated kernel modules. The majority of install is from that core18, hence why the whole turning off install recommends is pointless.
      • So I removed all the snapd stuff and everything is still fine so I'm not quite sure what that core18 is used for. Or how the isntaller actually installs things. Perhaps it just copies a prebuilt image over the system
  • So looks like I'll basically need to run install and then remove all the extra packages I don't want
  • The autoinstall options are appended to boot command. It doesn't appear to keep checking in on every boot though
$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               952M     0  952M   0% /dev
tmpfs                              199M  1.1M  198M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  3.9G  2.1G  1.7G  56% /
tmpfs                              994M     0  994M   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              994M     0  994M   0% /sys/fs/cgroup
/dev/sda2                          976M  103M  806M  12% /boot
/dev/loop0                          28M   28M     0 100% /snap/snapd/7264
/dev/loop1                          55M   55M     0 100% /snap/core18/1705
/dev/loop2                          69M   69M     0 100% /snap/lxd/14804
tmpfs                              199M     0  199M   0% /run/user/1000
$ free -h
              total        used        free      shared  buff/cache   available
Mem:          1.9Gi       166Mi       1.3Gi       1.0Mi       440Mi       1.6Gi
Swap:            0B          0B          0B
# snap list
Name    Version   Rev    Tracking         Publisher   Notes
core18  20200311  1705   latest/stable    canonical✓  base
lxd     4.0.1     14804  latest/stable/…  canonical✓  -
snapd   2.44.3    7264   latest/stable    canonical✓  snapd

Miscellaneous resources

Still WIP


Table of contents generated with markdown-toc