Ubuntu checklist

This is my checklist (in progress) for installing Ubuntu.

The important thing for me right now is to get it all in one place; I’ll make it pretty and presentable later.

Notes

Ubuntu in a VM
Install the distribution
Make sure the network adapter is enabled and in bridged mode

Before installing guest additions make sure to install the following packages:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ssh net-tools
sudo apt-get install build-essential gcc make perl dkms linux-headers-$(uname -r)

and then reboot and install the guest additions.

Make df output more friendly by creating a system-wide alias for it:

echo "alias df='df -h -x squashfs -x tmpfs -x devtmpfs'" >> /etc/profile.d/aliases.sh

Make sure to set the “always_set_home” variable in the sudoers file (using visudo)

Disable IPv6:

The recommend method to disable IPv6 on Ubuntu 18.04 after reboot is to configure the GRUB boot loader to pass kernel parameter during the boot time.

To do so open the /etc/default/grub using your favorite text editor with root privileges and change/add:

FROM:
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
TO:
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
GRUB_CMDLINE_LINUX="ipv6.disable=1"

Once you have made the above change within the /etc/default/grub file execute the following commands to apply the GRUB changes:

$ sudo update-grub

To install Samba:

sudo apt-get install samba cifs-utils

To install NFS:

sudo apt-get install nfs-common nfs-kernel-server

To install mysql:

sudo apt install mysql-server
sudo mysql_secure_installation

To install Plex Media Server:

Plex Media Server installation

Helpful commands:

View video resolution capabilities – xrandr -q
List installed packages – sudo apt list –installed

Helpful Web Pages

Helpful page #1

Enable NFS

Finally!  The solution to get the “right” VNC setup

Ubuntu 18.04 switched from LightDM to GDM3. Connecting to the login screen with VNC while using GDM3 is currently not possible. The easiest way to get this VNC functionality back is to simply switch back from GDM3 to LightDM.

LightDM is still being actively developed and used by many Linux distributions including some other flavors of Ubuntu. So no worries there.

Install LightDM

apt install lightdm

Should you for some reason come to regret switching to LightDM:

dpkg-reconfigure gdm3

Once you have LightDM installed and configured as your default greeter..

Install x11vnc from packages

apt install x11vnc

Create the file /lib/systemd/system/x11vnc.service

# Description: Custom Service Unit file
# File: /lib/systemd/system/x11vnc.service
[Unit]
Description="x11vnc"
Requires=display-manager.service
After=display-manager.service

[Service]
ExecStart=/usr/bin/x11vnc -loop -nopw -shared -xkb -repeat -noxrecord -noxfixes -noxdamage -forever -rfbport 5900 -display :0 -auth guess
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
Restart-sec=2

[Install]
WantedBy=multi-user.target

Set the x11vnc service to automatically start at boot

 systemctl enable x11vnc.service

Start the x11vnc service

 systemctl start x11vnc.service

This assumes screen :0 represents your monitor and binds x11vnc to that monitor instead of a session. If you do not have a monitor (headless) I believe it is possible to install a fake monitor driver and bind x11vnc to that.

Side notes

  1. Incase you are using virt-manager (which also enables VNC on 127.0.0.1:5900) you may want to bind x11vnc to your LAN IP (-listen 10.0.0.1)
  2. The parameters used to start x11vnc tell it not to ask for an additional password (-nopw)

Lets Encrypt/OpenVPN information

Let’s Encrypt HTTPS Certificates for OpenVPN AS (Access Server)

Installing Let’s Encrypt SSL Certs

Customizing the MOTD

Put any customization data into /etc/motd

Installing apache and php

sudo apt update
sudo apt install apache2
sudo apt install php libapache2-mod-php
sudo apt install php-mysql php-gd php-xml
sudo apt install phpmyadmin php-mbstring php-gettext

Install phpmyadmin

Reference this guide.

User profile changes

  • If desired, disable the screen saver lock and screen blanking (see below)

Other things to document

Listing all installed packages
apt list –installed

Searching for available packages
apt-cache search <keyword>

Changing default editor for visudo
sudo update-alternatives –config editor

Disable screen lock
Settings -> Privacy -> Screen Lock

Disable screen blanking
Settings -> Power -> Blank Screen

Create Samba User
smbpasswd -a <username>

View Samba Users
Use pdbedit

Add domains to the DNS Search Suffix list
Edit /etc/systemd/resolved.conf and add domains after Domains=

Finding largest files/directories
du -a /dir/ | sort -n -r | head -n 20 (replace 20 with the # of lines you wish to have returned)

Disable colors in the vi editor by default
Create (or edit, if it exists) ~/.vimrc; into this file add the command syntax off, and save the file.

Overwrite the boot block on the hard drive (ONLY when you want to re-install the operating system!)
dd if=/dev/zero of=/dev/sda count=1 bs=512