Ubuntu 20.04 on OS/Scratch/Data w/ Teamviewer

This assumes you are willing to part with your data; fresh install means wiping previous data.

Step 1 - Create bootable USB and load Ubuntu 20.04 ISO

On a separate computer, with a spare USB 8GB or more that you are willing to part with, assuming Windows.

  1. If you need the ISO, download Ubuntu-Server 20.04.2 LTS ISO - https://ubuntu.com/download/server
  2. If you need the program to create bootable USB, download https://rufus.ie/
  3. Open Rufus and load the ISO onto the USB drive; select the USB you want to reformat under the 'Device' dropdown, and use 'select' to select the Ubuntu ISO file (it looks like ubuntu-20.04.2-live-server-amd64.iso)
    • Example can be found on Rufus website linked

Step 2 - Plug in bootable USB drive and boot to it

You motherboard BIOS menu may differ, but it is overall the same process. Get to your boot menu, and select the UEFI option for the bootable USB drive that has the Ubuntu ISO file on it. It will take a few minutes to load.

 Example of selecting the UEFI option for the USB drive containing the Ubuntu ISO file

There will be a very quick menu confirming to Install Ubuntu Server. If not selected, it will select it automatically and proceed to load the installer. Below shows the start of the Ubuntu installer loading; takes a few minutes.

Step 3 - Setup Ubuntu network (mostly skipping screens)

Make sure system has network. Your IT/Network Admins will know whether a network port/cable AT YOUR SITE works or not, not us. Most of this is just skipped (or pressing 'Done' at the bottom) until you reach the 'Guided Storage Configuration' section.

 Example of skipping the network setup screens

Just select 'English' and select 'Done' at the bottom of the page until you reach the 'Guided Storage Configuration' section.

Step 4 - Setup your OS, Scratch, and Data partition

Mistakes in this steps are common; if mistakes are made, use the 'reset' at the bottom to start over. Please read this first for the steps overview for Step 4:

  1. We are making one of your drives the BOOT drive, meaning the OS will use this drive to boot Ubuntu 20.04
    • Linux OS BOOT drive requires 4 partitions: efi, boot, SWAP, and root '/'; this will show you how to set them up
  2. We are making one of your drives the Scratch (/scr) partition; used as a medium or temporary data storage for quick read/write use (imagine a workbench with the tools or parts prepped for you to use for your project, but needs to be cleared by the end of the day)
  3. We are making one of your drives the Data (/data) partition; used as more permanent storage, it is slower but usually high capacity (typically a bulky hard drive, or highest capacity drive)

Step 4a - Select 'Custom Storage Layout' to proceed to partitioning your installed drives

 Example of custom storage layout option

Then use 'Done' at the bottom to proceed

Step 4b - Setup the Boot drive

  1. Select 'Use as Boot Device'

     Example of selecting 'Use as Boot Device'

  2. Add GPT Partitions for the following (after each one, go back and re-select the boot drive and do 'Add GPT Partition' until step c is completed):
    1. 500m; ext4; /boot
    2. 10g; SWAP; /(unselectable)
    3. <leave blank intentionally to fill remaining space on this drive>; ext4; / (this forward slash just means it's root; leave as-is)

       Example of boot drive partitions

Step 4c - Setup the Scratch drive

Easy, since we're using the entire capacity of one drive. In this case, I am using the 2nd M.2 drive.

  1. Select the desired drive for Scratch, and then 'add GPT partition'
  2. <leave blank intentionally to fill remaining space on this drive>; ext4; <use dropdown to select /Other>, and then name it 'scr'>
  3. Create

     Example of setting up Scratch drive

Step 4d - Setup the Data drive

Easy again, since we're using the entire capacity of this last drive. In this case, I am using the only drive that can be selected now since I have already configured the others.

  1. Select the drive for Data, and then 'add GPT partition'
  2. <leave blank intentionally to fill remaining space on this drive>; ext4; <use dropdown to select /Other>, and then name it 'data'>
  3. Create

     Example of setting up Data drive

Step 4e - Review, confirm, and 'Continue' the partition creation step

Summary of partitions according to everything instructed in Step 4 should look like this:

  • / - root
  • /boot
  • /boot/efi - automatically created when you selected your first drive to be used as the boot device
  • /data
  • /scr
  • SWAP

Now go ahead and hit Done, and then Continue, to proceed to next step.

 Example of confirming destructive action to proceed

If you had data on these drives, well you won't anymore.

Step 5 - Setup your username and password

This is really important, for you. If we setup your system, we setup the user/password in hopes you will change it for yourself or your team. This will double as your root credentials later, so don't forget it.

 Example of the user/pass setup step

Step 6 - Confirm installation of OpenSSH Server, and then proceed to Ubuntu OS installation

Also a really important step, as it will install SSH components necessary for you to remote in from another system on your network.

 Example of OpenSSH Server selection step

You can press 'space' here to mark the 'X' to confirm it will be installed when you next hit 'Done' or 'Confirm'. Proceed to next page.

Ignore these, as we install the individual components manually.

Ubuntu will start to install. It takes 2-3 minutes for the bottom option of 'cancel update and reboot' option to appear. Recommended to use this option as soon as you see it.

 Example of Ubuntu OS installation process

Remove your USB drive containing the Ubuntu-server 20.04.2 LTS ISO, and then hit 'ENTER' to allow it to reboot.

Once the system reboots, there will be no GUI at first. It will also complain or note that a network port is attempting to reconfigure (or searching for network). It can take up to 4-5 minutes per port being searched until it loads a login prompt.

 Example of what to expect after rebooting Ubuntu 20.04 for the first time after installation

On this step, I only had 1 network cable. I had to switch the cable to the other network port. The network cable is known-working network, but Ubuntu is searching for network during boot.

After messing with the network cable and ports until it was happy.


FIRST BOOT, it will look like this; just press 'enter', and it will look like normal login prompt. The SSH text is competing to appear at the same time as the login prompt.

After logging in, you will have normal Ubuntu activity, terminal-mode.


Step 7 - Setting up your Ubuntu OS for NVIDIA drivers and GUI display

After the system reboots, you will be greeted by terminal-mode/command-line only. NO GUI; we'll get to that shortly. We have to first setup the base-system and make it work nicely with NVIDIA drivers. A constant challenge for us is making sure your system's Linux OS has a functional NVIDIA driver installed; easier said than done, as Linux/header updates unlinks NVIDIA modules if local updates are ran.

I condensed these commands so you can copy/paste AFTER you can SSH into your system, OR very carefully type out.

If you want to SSH to run the next set of commands:

If you're local, and not iKVM/remote with the system (you don't have the luxury of copy/paste), it might be easier if you SSH into the system from this point to run the next set of commands. Since this is a fresh blank Ubuntu installation, it won't have the network ports setup yet. You can run 'sudo apt-get install net-tools' to get IP on the network ports.

Step 7a - Grant root access for yourself for the next set of commands during this step

FIRST, grant yourself 'root' access by using the command:

sudo bash

Use the password you setup for this system, and then you will be greeted with a 'root@<whatever>'.

Step 7b - Update base-system

apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y

Step 7c - Blacklist Nouveau in system files

Nouveau is a legacy display driver loaded by Linux, it conflicts with NVIDIA and needs to be disabled so NVIDIA driver can install properly. I put this all on one line for the sake of time, but it basically writes the blacklist-nouveau parameter so it doesn't load when Ubuntu boots. Ever.

echo "blacklist nouveau" >> /etc/modprobe.d/blacklist-nouveau.conf && echo "blacklist lbm-nouveau" >> /etc/modprobe.d/blacklist-nouveau.conf && echo "options nouveau modset=0" >> /etc/modprobe.d/blacklist-nouveau.conf && echo "alias nouveau off" >> /etc/modprobe.d/blacklist-nouveau.conf && echo "alias lbm-nouveau off" >> /etc/modprobe.d/blacklist-nouveau.conf && echo options nouveau modeset=0 | tee -a /etc/modprobe.d/nouveau-kms.conf

Step 7d - Get rid if legacy/old NVIDIA modules

apt-get remove nvidia* && apt-get autoremove -y

Step 7e - Install necessary packages for NVIDIA driver and other Docker packages

This takes 5-8 minutes

apt-get install net-tools -y && apt-get install build-essential -y && apt-get install gfortran -y && apt-get install ethtool -y && apt-get install software-properties-common -y && apt-get install curl -y && apt-get install ipmitool -y && apt-get install git -y

Step 7f - Update system files

Should take 1-2 minutes

update-initramfs -u

Step 7g - Install Ubuntu-desktop

This takes quite a bit of time (maybe 10-12 minutes)... So step away from your system after running this.

apt install ubuntu-desktop -y

Step 7h - REBOOT to allow all the changes to apply

Important: Depending on the hardware, your system may feature a primary onboard/offboard display selection. Generally, onboard is the display-port built into the motherboard, and offboard is a GPU-accelerated device. A bit more description here: Onboard/Offboard display notes by Operating System

  • If your system DOES NOT have a built-in display port to the motherboard, meaning NO onboard/offboard selection, the display will naturally default to the only option- the Graphics Card
  • If your system supports onboard/offboard display, results may vary whether the Ubuntu 20.04 login screen will loop or freeze

In the linked article, it shows no confirmed expectation for Ubuntu 20.04, this is because it really does differ depending on the hardware installed, and there are many many combinations of hardware that may or may not allow normal Ubuntu 20.04 behavior AFTER the login screen. If it hangs on the login screen, reboot the system, get to the screen again, and try 'ctrl+alt+f3' to reach a terminal-only screen again so you can resolve it when properly installing the NVIDIA drivers in step 8.

reboot

Step 8 - Installing NVIDIA driver

Once you get access to a terminal, whether getting lucky with the display as the system is locally, or SSH'ed via IP, you can install

#get root access again
sudo bash
<password>

#this downloads the NVIDIA driver .run file to whatever directory you are currently in
#for example sake, this is the latest A6000 Linux Driver file at the time of publishing this article
wget https://us.download.nvidia.com/XFree86/Linux-x86_64/460.56/NVIDIA-Linux-x86_64-460.56.run

#makes the .run file executable
chmod +x NVIDIA-Linux-x86_64-460.56.run

#disables all GUI/display
init 3

#executes the now executable .run file
./NVIDIA-Linux-x86_64-460.56.run

If all steps above were performed correctly, it will NOT complain about nouveau being loaded, ignore all questions until it asks to install or configure nvidia-xconfig for you, say no at this prompt. If it fails to install, it will clearly say that the NVIDIA Driver installation has failed. If this occurs, try running the installation file again, and provide us the LAST screen before the NVIDIA driver installation fails so we can further investigate.

If it successfully installs, you can run this command to check installed NVIDIA hardware.

#installed NVIDIA hardware
nvidia-smi

#installed NVLinks, if you have it (it can run this command even if you DON'T have them installed)
nvidia-smi nvlink -s

Step 9 - Install Teamviewer

#this is latest Linux Teamviewer install file from their website
wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
apt install ./teamviewer_amd64.deb

#to run it, you can get to GUI, open terminal, and simply type in:
teamviewer

#if the teamviewer doesnt show a join code and just shows a dash then the following needs to be ran in a terminal line by line.

sudo touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
sudo systemctl restart NetworkManager
sudo systemctl stop networkd-dispatcher
sudo systemctl disable networkd-dispatcher
sudo systemctl mask networkd-dispatcher
sudo apt-get purge nplan netplan.io -y
sudo apt-get install ifupdown

#the networkmanager file will show managed=false
cat /etc/NetworkManager/NetworkManager.conf

main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=no

#this file will need to be changed to look like this using VI or Nano
cat /etc/NetworkManager/NetworkManager.conf

main]
plugins=ifupdown,keyfile

[ifupdown]
managed=true

[device]
wifi.scan-rand-mac-address=no

#once file is changed and saved run

sudo service network-manager restart
reboot

#once system comes back up the network will then be able to be managed through the gui which will allow teamviewer to see the network cards and will then present the proper join codes. DHCP address will change

If you run into display issues on Step 8 or 9

I cannot stress enough that it is because the system has the onboard/offboard capability, and Ubuntu doesn't know what to do with it sometimes. It is more consistent with CentOS for it to work regardless what the primary display option in BIOS is, but Ubuntu has issues typically with onboard VGA. However, I haven't had issues with a Supermicro 4U with onboard with using the installation method listed above.

Useful POST-OS install commands to run

Allows quicker OS boot, and prevents automatic updates breaking NVIDIA driver.

[Ubuntu] Unable to manage Network via GUI

[Ubuntu] "A start job is running for wait for network to be configured"

[Ubuntu] Disable unattended-upgrades