tags: Public, Technical, Configuration, Linux, Ubuntu, GPD Pocket 3

Ubuntu

General Rule

  • Hostname: ${PLATFORM}-${OS}-${'[[:digit:]][[:digit:]]'}X79-Focal-00
  • Language: English

Universal

Auto Mount Disk

  • Check target disk UUID
    • sudo blkid /dev/sde1 /dev/sde1: UUID="e030f70e-3006-468e-8ca9-1c95ce63e14c" TYPE="ext4" PARTUUID="5717dfe0-01"
  • Add command to /etc/fstab UUID=e030f70e-3006-468e-8ca9-1c95ce63e14c /mnt/uv500_raid0 ext4 defaults 0 2

Git Config

  • git config --global user.email "user@gmail.com"
  • git config --global user.name "User"
  • git config --global core.editor vim

Install Docker


Ubuntu 22.04 LTS (Jammy Jellyfish)

Install Ubuntu Desktop Minimal on Ubuntu Server

  • sudo apt update
  • sudo apt install ubuntu-desktop-minimal
  • sudo reboot

Common

  • sudo apt update
  • sudo apt install bash-completion

Ubuntu 20.04 LTS (Focal Fossa)

Disk Partitions

Mount the following path to different partition. Recommended use different physical disk in virtual machine.

  • / - at least 128 GB
    • EFI System Partition - 100 MB
    • swap area - 2 GB
  • /var - at least 256 GB for Docker
  • /home - at least 128 GB
  • Total: 512GB or more

Drivers

Hyper-V

Change the Resolution of an Ubuntu Hyper-V Virtual Machine
  1. sudo vim /etc/default/grub
  2. GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" -> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1366x768"
  3. sudo update-grub
Hyper-V Linux Guest VM Enhancements
Downgrade Kernel version to compatibility with Synology Active Backup for Business
  • sudo apt install linux-image-5.4.0-1064-azure linux-headers-5.4.0-1064-azure
  • Find the list of kernels installed and the grub menu entries
    • sudo grub-mkconfig | grep -E 'submenu |menuentry '
  • sudo vim /etc/default/grub
    • Comment GRUB_DEFAULT=0
    • Add GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-1064-azure"
  • sudo update-grub
  • sudo reboot

VMware

NVIDIA

Install NVIDIA driver
  • ubuntu-drivers devices

    ​​​​WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level
    ​​​​== /sys/devices/pci0000:00/0000:00:03.0/0000:04:00.0 ==
    ​​​​modalias : pci:v000010DEd00001C03sv00001462sd00003283bc03sc00i00
    ​​​​vendor   : NVIDIA Corporation
    ​​​​model    : GP106 [GeForce GTX 1060 6GB]
    ​​​​driver   : nvidia-driver-390 - distro non-free
    ​​​​driver   : nvidia-driver-418-server - distro non-free
    ​​​​driver   : nvidia-driver-455 - third-party non-free
    ​​​​driver   : nvidia-driver-470-server - distro non-free
    ​​​​driver   : nvidia-driver-470 - third-party non-free recommended
    ​​​​driver   : nvidia-driver-450 - third-party non-free
    ​​​​driver   : nvidia-driver-450-server - distro non-free
    ​​​​driver   : nvidia-driver-460-server - distro non-free
    ​​​​driver   : nvidia-driver-460 - third-party non-free
    ​​​​driver   : nvidia-driver-465 - third-party non-free
    ​​​​driver   : xserver-xorg-video-nouveau - distro free builtin
    
  • sudo apt install nvidia-driver-470

  • sudo apt purge nvidia*

Common

  • sudo apt update
  • sudo apt install build-essential
  • Settings -> Region & Language -> Formats -> United States -> United Kingdom
  • Settings -> Power -> Blank Screen -> Never
  • sudo apt install vim htop net-tools

System Upgrade

  • sudo apt update
  • sudo apt dist-upgrade
  • reboot
  • sudo apt clean
  • sudo apt autoremove

Users

Add User
  • sudo adduser $USER
Add User to Group sudo
  • sudo adduser $USER sudo

SSH

  • sudo apt install ssh or sudo apt install openssh-server

Samba

  • Install and Configure Samba
  • sudo apt install samba
  • Add user for Samba sudo smbpasswd -a $USER
  • Setting up Samba sudo vim /etc/samba/smb.conf
[homes]
   comment = Home Directories
   path = /home/%S
   valid users = %S
   writable = yes
   browseable = yes
   create mask = 0644
   directory mask = 0755
  • sudo systemctl restart smbd

Timeshift

  • sudo apt update
  • sudo apt install timeshift

Development Tools

  • sudo apt install git tig

LAMP

Install Using Tasksel
  • Adopt
  • sudo apt update
  • sudo apt install tasksel
  • sudo tasksel install lamp-server
  • sudo mysql_secure_installation
Install Packages Separately
  • Apache
    • sudo apt update
    • sudo apt install apache2
    • sudo ufw app list
    • sudo ufw status
  • MySQL
    • sudo apt install mysql-server
    • sudo mysql_secure_installation
  • PHP
    • sudo apt install php libapache2-mod-php php-mysql

Database managemen

phpMyAdmin
  • How To Install and Secure phpMyAdmin on Ubuntu 20.04
  • Install phpMyAdmin
    • sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl
    • For the server selection, choose apache2
      • When the prompt appears, apache2 is highlighted, but not selected
      • If you do not hit SPACE to select Apache, the installer will not move the necessary files during installation
      • Hit SPACE, TAB, and then ENTER to select Apache
    • Select Yes when asked whether to use dbconfig-common to set up the database
    • You will then be asked to choose and confirm a MySQL application password for phpMyAdmin
  • Configuring password access for a dedicated MySQL user
    • NOTICE: please change the USER and PASSWORD in the following command
    • sudo mysql
    • CREATE USER 'USER'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'PASSWORD';
    • GRANT ALL PRIVILEGES ON *.* TO 'USER'@'localhost' WITH GRANT OPTION;
    • exit
Adminer

Laptop

Disable suspend

  • sudo vim /etc/systemd/logind.conf
  • HandleLidSwitch=ignore

GPD Pocket 3

Dual Boot with Windows 11

  • Hostname: G1621-02-Focal

Issue[1][2][3][4]

Wrong Direction of Gravity Sensor
  • sudo apt update
  • sudo apt install git
  • git clone https://github.com/wimpysworld/umpc-ubuntu.git
  • sudo cp ~/umpc-ubuntu/data/61-gpd-pocket3-sensor-local.hwdb /etc/udev/hwdb.d/
  • sudo systemd-hwdb update
  • sudo reboot
Wrong Direction of Touch Screen
  • sudo cp ~/umpc-ubuntu/data/99-gpd-pocket3-touch.rules /etc/udev/rules.d/
  • sudo udevadm control --reload-rules
  • sudo udevadm trigger
  • sudo reboot
  • It still does not work after following the above instructions so we delete the configuration file /etc/udev/rules.d/99-gpd-pocket3-touch.rules and reboot again. However, it works suddenly.
No Audio
  • sudo cp ~/umpc-ubuntu/data/alsa-gpd-pocket3.conf /etc/modprobe.d/
Enable Display Scaling
  • Settings -> Displays -> Enbale Fractional Scaling -> 175 %
Time Sync with Dual Boot Windows
  • sudo timedatectl set-local-rtc 1

DSM

Focal

  • sudo hostnamectl set-hostname DSM-Focal-00

Jammy

  • sudo hostnamectl set-hostname DSM-Jammy-00
  • sudo apt update && sudo apt dist-upgrade
  • sudo apt install qemu-guest-agent

MacBook

Arm

Virtualization
  • Lima[5]
  • Multipass
  • Parallels Desktop
Native

Ubuntu 18.04.5 LTS (Bionic Beaver)

Common

  • sudo apt update
  • sudo apt install build-essential
  • Settings -> Region & Language -> Formats -> United States -> United Kingdom
  • Settings -> Power -> Blank Screen -> Never
  • sudo apt install vim htop net-tools

System Upgrade

  • sudo apt upgrade
  • reboot
  • sudo apt autoclean
  • sudo apt autoremove

SSH

  • sudo apt install ssh or sudo apt install openssh-server

Samba

  • Install and Configure Samba
  • sudo apt install samba
  • Add user for Samba sudo smbpasswd -a $USER
  • Setting up Samba sudo vim /etc/samba/smb.conf
[homes]
   comment = Home Directories
   path = /home/%S
   valid users = %S
   writable = yes
   browseable = yes
   create mask = 0644
   directory mask = 0755

VMware

  • VMware Tools
    • Add CD/DVD Drive
    • VM -> Install VMware Tools
    • mkdir -p ~/vmware_tools
    • cp /media/${USER}/VMware\ Tools/* ~/vmware_tools
    • cd ~/vmware_tools
    • tar -xvf VMwareTools-10.3.22-15902021.tar.gz
    • cd vmware-tools-distrib
    • sudo ./vmware-install.pl

NVIDIA Jetson Nano

  • JetPack 4.6
  • sudo apt update
  • sudo apt upgrade
  • System Settings -> Language Support -> Regional Formats -> English (United States)
  • System Settings -> Brightness & Lock -> Turn screen off when inactive for: -> Never

Notes

Issue

Segmentation Fault with Specific URL in Ubuntu 20.04 (arm64)

  • Detected it in Ubuntu 20.04 through Parallels Desktop on MacBook Pro 2021
cliff@PD-Focal:~$ curl https://dl.yarnpkg.com/debian/pubkey.gpg
Segmentation fault (core dumped)
cliff@PD-Focal:~$ wget https://dl.yarnpkg.com/debian/pubkey.gpg
--2022-02-22 15:22:36--  https://dl.yarnpkg.com/debian/pubkey.gpg
Resolving dl.yarnpkg.com (dl.yarnpkg.com)... 104.16.171.99, 104.18.126.100
Connecting to dl.yarnpkg.com (dl.yarnpkg.com)|104.16.171.99|:443... connected.
Segmentation fault (core dumped)
  • Found issue on GitHub
  • According to the above issue, it's confirmed that it's a OpenSSL issue
cliff@PD-Focal:~$ openssl s_client -showcerts -connect graph.facebook.com:443 </dev/null
CONNECTED(00000003)
Segmentation fault (core dumped)
cliff@PD-Focal:~$ openssl version -a
OpenSSL 1.1.1f  31 Mar 2020
built on: Wed Nov 24 13:20:48 2021 UTC
platform: debian-arm64
options:  bn(64,64) rc4(char) des(int) blowfish(ptr) 
compiler: gcc -fPIC -pthread -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -fdebug-prefix-map=/build/openssl-ibbik6/openssl-1.1.1f=. -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_TLS_SECURITY_LEVEL=2 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
OPENSSLDIR: "/usr/lib/ssl"
ENGINESDIR: "/usr/lib/aarch64-linux-gnu/engines-1.1"
Seeding source: os-specific
  • Solution: upgrade OpenSSL from 1.1.1f to the latest (1.1.1m)

Upgrade OpenSSL on Ubuntu 20.04 (arm64)

  • wget https://www.openssl.org/source/openssl-1.1.1m.tar.gz
  • tar -xvf openssl-1.1.1m.tar.gz
  • cd openssl-1.1.1m
  • ./config --prefix=/usr --openssldir=/usr/lib/ssl --libdir=/usr/lib/aarch64-linux-gnu
  • make -j
  • make test
  • sudo make install
  • make install_engines
  • sudo ldconfig -v
cliff@PD-Focal:~$ openssl version -a
OpenSSL 1.1.1m  14 Dec 2021
built on: Tue Feb 22 15:00:41 2022 UTC
platform: linux-aarch64
options:  bn(64,64) rc4(char) des(int) idea(int) blowfish(ptr) 
compiler: gcc -fPIC -pthread -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DNDEBUG
OPENSSLDIR: "/usr/lib/ssl"
ENGINESDIR: "/usr/lib/aarch64-linux-gnu/engines-1.1"
Seeding source: os-specific
Undefined Symbol Issue

undefined symbol: EVP_mdc2, version OPENSSL_1_1_0

cliff@PD-Focal:~/openssl-1.1.1m$ ldd /usr/bin/openssl
	linux-vdso.so.1 (0x0000ffffa7067000)
	libssl.so.1.1 => /lib/aarch64-linux-gnu/libssl.so.1.1 (0x0000ffffa6eca000)
	libcrypto.so.1.1 => /lib/aarch64-linux-gnu/libcrypto.so.1.1 (0x0000ffffa6c3c000)
	libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000ffffa6c0c000)
	libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffffa6a99000)
	/lib/ld-linux-aarch64.so.1 (0x0000ffffa7037000)
	libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000ffffa6a85000)

  1. UMPC hardware configuration for Ubuntu ↩︎

  2. 一号本 OneMix3 Pro Ubuntu屏幕校正 ↩︎

  3. GPD pocket3(高配版)安装ubuntu 20.04并较完美运行 ↩︎

  4. GPD Pocket 3 and Ubuntu 20.04.3 - so far ↩︎

  5. jserv posted to FB at 2021/09/01 ↩︎