Ubuntu Desktop Setup Notes

Some extra configuration to deal with quirks on my Lenovo M900 Tiny and also setting up multi-user authentication on Active Directory.

Custom Video Resolution

1
2
3
4
$ cvt -r 2560 1440
# 2560x1440 59.95 Hz (CVT 3.69M9-R) hsync: 88.79 kHz; pclk: 241.50 MWz Modeline "2560x1440R" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
$ xrandr --newmode "2560x1440R" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
$ xrandr --addmode HDMI-1 2560x1440R

Switch to the new mode by command:

1
$ xrandr --output HDMI-1 --mode 2560x1440R

IMPORTANT To persist the newly created screen resolution at the next reboot, add both xrandr --newmode and xrandr --addmode commands to ~/.profile.

Ref How to Set A Custom Screen Resolution in Ubuntu Desktop


Persist Audio Device Selection

Comment out the two lines in /etc/pulse/default.pa

1
2
load-module module-switch-on-port-available
load-module module-switch-on-connect

Active Directory

Login name without @DOMAIN

Edit /etc/sssd/sssd.conf to not having to type @DOMAIN. The second change with use_fully_qualified_names will also also get rid of @DOMAIN in user/group names. However this can only be used if there will ever only be one joined domain.

1
2
[sssd]
default_domain_suffix = YOURDOMAIN
1
2
[domain/ad.example]
use_fully_qualified_names = False

Specify Home Directory and Shell

Edit /etc/sssd/sssd.conf, check this is placed at domain [ad.example] and not [sssd]

1
2
override_homedir = /home/%u
default_shell = /bin/bash

If logging in with a Domain User results in system error try adding the following in the [domain] section

1
ad_gpo_access_control = permissive

Configure Auto-Home Directory Creation

To ensure that a user’s home directory is automatically created on first login, you need to configure the PAM modules (pam_mkhomedir.so) as shown below.

Edit the /etc/pam.d/common-session configuration file by add the line below just below the line, session required pam_sss.so.

1
session required        pam_mkhomedir.so skel=/etc/skel/ umask=0022

Hide a User Name at Login Screen

To hide a user named XXX, create a file named /var/lib/AccountsService/users/XXX containing two lines. Alternatively use sudo -H nautilus /var/lib/AccountsService/users/

1
2
[User]
SystemAccount=true

If the file already exists, make sure you append the SystemAccount=true line to the [User] section.


Recover / Reset GNOME Keyring

1
$ rm ~/.local/share/keyrings/login.keyring

Ref How to recover/reset forgotten Gnome Keyring Password


xRDP Installation Script for Ubuntu

The xRDP installer script streamlines the installation of xRDP packages on Ubuntu machines. The xRDP installer script perform additional post configuration actions that provides the best remote Desktop user experience.

This script also works for Pop!_OS however requiring bypassing Ubuntu version detection. Edit the section a little bit after

1
2
version=$(lsb_release -sd)
codename=$(lsb_release -sc)

and change to "$version" = *"Pop!_OS 20.10"*

Preventing spurious authentication requests over xRDP

The remote sessions are more restrictive than local sessions for the same user, resulting in large number of password verification requests.

1
2
3
sudo bash
cd /etc/polkit-1/localauthority/50-local.d
nano 46-allow-update-repo.pkla

and then put this inside the file

1
2
3
4
5
6
[Allow Package Management all Users]
Identity=unix-user:*
Action=org.freedesktop.packagekit.system-sources-refresh
ResultAny=yes
ResultInactive=yes
ResultActive=yes

Ref Authentication required to refresh system repositories


Auto updates

1
2
sudo apt install unattended-upgrades
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

Ref https://libre-software.net/ubuntu-automatic-updates/

Share