User:BoneTone

From ArchWiki
Jump to: navigation, search

I am BoneTone. I am still fairly new to Arch, the first time I installed Arch was in the middle of 2017. However I have lots of experience in operating systems, systems & enterprise management, software development, etc. I hope to contribute to this Wiki and the Arch project as a whole in a positive and meaningful way.

Please see my Discussion page if you want to leave a comment about edits I have made to the regular Arch Wiki pages, or to leave a comment, suggestion, or ask a question about this personal user page.

Cheers!


REFERENCE SECTION

Intro

This is the very beginning of a "quick reference sheet," if you will, for Arch Linux. Initially this is just a project for myself, to give me a page I can use to find a piece of information quickly, or execute a task I do frequently, etc. Regardless of whether I'm using my browser with all my bookmarks, or just logged into my account from a friend's computer, I can get at the Arch resources that matter to me. Perhaps it will grow into something useful for others, perhaps not. Among other things, I'll be learning how to use this wiki, the various formatting & page modification methods.

Note: If you do find this page useful, please drop me a note on my Discussion page and let me know how it has benefited you, as well as any ways I can improve it. Thanks!
Warning: It is very important that all commands, code snippets, or *any* advice given in this page be verified elsewhere (even the linked pages could be out-of-date and no longer relevant). Software changes quickly, and this was initially written by a user new to Arch who was very rusty on Linux in general. It had been over half a decade since I had used Linux as a daily OS before I first installed Arch. So please, I will do my best to link to sources, and you do your best to learn the tools you are using before using them. I, in no way, implied or express, am liable for anything anyone does after reading this page.

Useful System Commands

lspci - list pci devices like NICs

lsblk - list block devices (drives)

blkid - locate/print block device attributes

id - gives info about a user & group

findmnt - find a filesystem & options of mounted device

pkgfile -u - update pkgfil database to find missing packages

cat /proc/cmdline - display the kernel parameters in effect

Important Configuration Files

~/.Xresources
urxvt*scrollBar: false
urxvt*background: #111111
urxvt*foreground: #55cc77
urxvt*font: xft:Source Code Pro:pixelsize=14
Xft*antialias: true
Xft*hinting: full
/etc/pacman.conf - pacman config including repositories

/boot/EFI/refind/refind.conf - boot manager configuration

/etc/hosts - network friendly names

/etc/hostname - this computer's hostname

/etc/fstab - rules & specifications for mounting drives

/etc/pacman.d/mirrorlist - mirrors used by pacman

/etc/locale.conf - set locale


/etc/sudoers - must edit with visudo or EDITOR=nano visudo
/etc/systemd/netowrk/networkname.network - defines netowrk over NICs

.NTFS-3G/UserMapping - ntfsusermap create Windows <-> Linux permissions

/etc/sddm.conf - display manager configuration

/etc/sddm.conf.d/hidpi.conf - enable HiDPI in display manager

/etc/samba/smb.conf - file share over the network with Windows

/etc/xdg - conf defaults for stuff like openbox, compton, pcmanfm

~/.bashrc - individual interactive shell startup file

~/.config/openbox/ - 4 files to configure Openbox (menu, keys, startup, env, etc)

INSTALLATION NOTES

Foreward

This section is a place for me to reproduce my notepad that I used before, during, and after clean installing Arch on my primary machine. This is basically a recipe to get you to a point where you have a working system. It is not a generic guide for installation, but rather the steps needed specific to my configuration. It is useful for myself and some of my friends, and it may be useful for you as well.

Note: To first time users of the Arch distribution, the Installation Guide is *not* a direct guide to installing Arch Linux; rather it is a guide to the Arch Wiki pages that you need to read in order to install Arch successfully. When reading through the Installation Guide, it is important to follow the links provided to other pages that are relevant to your system and preferences for detailed information on those steps of the process. You should follow those links a minimum of one deep. For certain topics you may need to dig even deeper into the wiki to fully understand what steps you need to take in terms of installation and configuration. The Arch Way deeply values a DIY (Do It Yourself) approach, and that requires quite a bit of reading. Where necessary you should also follow the off-site links (for example with rEFInd) where you can find more documentation of high quality. I recommend spending at least a weekend reading the installation guide and following the links pertinent to you, so you can get a firm grasp of the entire process before you begin doing any actual work installing Arch.

Preparation

This guide assumes you're going to be dual-booting with an already installed and working Windows system. In Windows we need to create the partition onto which we'll install Arch, and create the install media and boot into it:

  1. Download the ISO from a mirror and verify the file.
  2. Create a USB live system to install using Rufus on a Windows system.
  3. Run diskmgmt.msc and create the partition where you intend to install Arch. This is just much faster now than dealing with it after booting the archiso.
  4. Boot into firmware with the USB attached and change the boot order such that the USB system is first.
    1. Disable Secure Boot if necessary.
  5. Reboot and select the Arch Live system

Arch Installation

These steps will walk through installing Arch onto the new root partition, install and configure the boot manager, and do some minimal configuration to allow you to boot into the new system with your non-root user:

  1. Verify you've booted with UEFI instead of BIOS, the following command should have output, if blank you're not in UEFI mode. # ls /sys/firmware/efi/efivars
  2. Verify internet access # ping archlinux.org
  3. Update clock # timedatectl set-ntp true
  4. List partitions and find the one you want to use (assuming the partition was already created under Windows) # fdisk -l -o NAME,UUID
  5. Format the partition # makfs.ext4 /dev/nvme0n1p2 using the correct device for your system of course
  6. Mount the newly formatted partition to /mnt # mount /dev/nvme0n1p2 /mnt
  7. Create a place to mount the boot partition # mkdir /mnt/boot
  8. Mount the EFI System Partition using the correct device for your system which you made note of during the fdisk listing # mount /dev/nvme1n1p2 /mnt/boot
  9. Edit the list of mirrors and select the ones you want to use # nano /etc/pacman.d/mirrorlist
  10. Install the base package group onto the new system root # pacstrap /mnt base
  11. Generate an fstab file on the new system using UUIDs # genfstab -U /mnt >> /mnt/etc/fstab
  12. Edit the fstab file to make sure its correct, add 'discard' to enable TRIM # nano /mnt/etc/fstab
  13. Change root to the new system # arch-chroot /mnt
  14. Set the time zone with # ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
  15. Set the hardware clock from system clock # hwclock --systohc and verify it worked by checking for the file # ls /etc/adjtime
  16. Prepare the locale you want by uncommenting 'en_US.UTF-8 UTF-8' and 'en_US ISO-8859-1' using # nano /etc/locale.gen
  17. Generate the locale using # locale-gen
  18. Create the new file # nano /etc/locale.conf and add LANG=en_US.UTF-8
  19. Create the new file # nano /etc/hostname and add your hostname to it
  20. Edit the file # nano /etc/hosts and append needed translations like 127.0.0.1 hostname and ::1 hostname and 127.0.1.1 hostname.domainname
  21. Set the root password using # passwd
  22. Install the rEFInd boot manager # pacman -S refind-efi
  23. Install rEFInd to the EFI System Partition # refind-install
  24. Install intel microcode # pacman -S intel-ucode
  25. Edit rEFInd's configuration file on the ESP # nano /boot/EFI/refind/refind.conf and set all the options you want for the rEFInd boot manager, and customize the manual stanzas to your liking. Be sure to use the UUID for the root partition you found with the fdisk command previously, and to add initrd=/intel-ucode.img in the options for the new Arch Linux stanza.
  26. Create your user, set the password and add it to the wheel group for sudo access.
    1. # useradd --create-home username
    2. # passwd username
    3. # usermod -aG wheel username
  27. Install sudo with # pacman -S sudo
  28. Uncomment the line for the wheel group to run all commands using a password by editing the file using # EDITOR=nano visudo
  29. Close up shop and restart the system to boot into your now working Arch Linux OS using:
    1. # exit
    2. # umount -R /mnt
    3. # reboot

System Configuration

At this point you have booted into your new Arch system and are logged in with a non-root user that has sudo privileges.

Note: It is possible some commands listed below will fail due to permissions issues. If that happens, run them with sudo in front of the command and enter your password when prompted.

Connect to the Network

Find the kernel module being used by your network interface using $ lspci -v.

Verify that network interface is up using $ ip link.

Create a network file for systemd-networkd to use for identifying the nic & settings. In the file below replace nicname with the discovered in the previous step.

$ nano /etc/systemd/network/networkname.network
[Match]
Name=nicname
[Network]
DHCP=ipv4

To pull DNS info from DHCP using systemd-resolved, we need to create the following symlink: $ ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

Then we need to enable both services via: $ sudo systemctl enable systemd-networkd $ sudo systemctl enable systemd-resolved

Test the network with $ ping archlinux.org and if it doesn't work, $ sudo reboot and it should be working assuming there were no mistakes made in these steps.

Enable File Sharing with a Windows Network

First step is to install the samba package using $ pacman -S samba

Create the samba configuration file with the following key settings:

/etc/samba/smb.conf
[global]
workgroup = WORKGROUP
server role = standalone server
log file = /usr/local/samba/var/log%m
max log size = 50
dns proxy = no

Create a shared folder by appending a section similar to what follows to the configuration file:

/etc/samba/smb.conf
[Share-Name]
path = /full/path/to/folder
valid users = username
writable = no
browseable = yes
public = no
printable = no
Note: The password for the file share is not the same as the password for the user on the system, and it must be generated separately. Create the samba password for the username in the share above using the command $ smbpasswd -a username

Install Vivaldi Browser

Although I am putting application installs in another section, I'm including my default browser here as it is such a crucial piece of software, and necessary during the system configuration.

Note: For people looking for a browser that enables extensive user customization, I cannot recommend this browser enough, created by the original author of Opera, who left after Opera dropped Presto and destroyed the design philosophy that made Opera great in the first place.

Vivaldi is available in the herecura repository, so you don't have to deal with updating the AUR package manually. It requires appending the following to the pacman configuration:

/etc/pacman.conf
[herecura]
server = https://repo.herecura.be/$repo/$arch

Then you should upgrade the system before trying to install any packages from the repo using: $ pacman -Syu

Now you can install Vivaldi $ pacman -S vivaldi without building it from the AUR.

You probably also want to get $ pacman -S vivaldi-ffmpeg-codecs from herecura as well.

For flash install pepper-flash from the official repos.

If you want to use Qt dialogs instead of GTK+ for file selections, then install kdialog.

Tip: Since version 2 of Vivaldi, this is no longer necessary if you use the Vivaldi sync. I'm just keeping this note for prosperity. When installing a new Vivaldi instance, if you aren't using the internet sync and want to transfer over a lot of settings, there are several files you will want to copy from your old profile to you new one. You can usually find you profile path by clicking Help / About, and then looking at the value displayed for Profile Path. From the folder listed there, the files I like to copy are listed below. Of special note is the Preferences file, this file will carry over the websites for which I have granted an exception to be able to set cookies or run javascript. Normally, a website is not able to do either of those tasks. Also of importance is that the file in the Profile Path named Secured Preferences would case errors when I copied it over. Other files there either were not of import to me or caused issues in the new install.
  • Bookmarks
  • Cookies
  • Custom Dictionary.txt
  • Extension Cookies
  • History
  • History Provider Cache
  • Preferences
  • Visited Links

Mounting NTFS Partitions

NTFS-3G enables both reading & writing of NTFS formatted partitions. Install using $ pacman -S ntfs-3g.

If you plan on accessing the partition from both Linux and Windows, it is important to understand that the NTFS format supports features that Windows does not, such as certain characters like ? in the filename. The ntfs-3g package has options that prevent Linux from writing those kinds of files by including the option windows_names when mounting the partition. Additionally the option streams_interface=windows allows Linux to access the named data streams of the files - metadata such as mp3 tags. Lastly, to avoid potential data loss, the norecover option prevents mounting a drive that was not properly unmounted by Windows.

Putting this all together the command to mount a partition looks like ntfs-3g -o "windows_names streams_interface=windows norecover" /dev/sdxn /mnt/mydrive where sdxn and mydrive match the appropriate locations. To mount the partition automatically make the following edit, again changing the UUID and mount location to match your configuration

/etc/fstab/
UUID=1234567890abcdef /mnt/mydrive ntfs-3g  rw,relatime,windows_names,streams_interface=windows,norecover 0 0
Note: You can find the appropriate UUID to use from the output of $ blkid. If the drive or partition you are looking for isn't displayed by that command, run it as sudo. From the output of blkid use the UUID field, not the PARTUUID!

When the partition is going to be accessed by both Windows & Linux systems, ntfsusermap will generate a file that maps between Windows accounts and Linux logins for file access rights. Creating and using this mapping file is a multi-step process:

  1. Find the user & group id for your Linux login by running $ id and take note of the number value for your user & group.
  2. Run the command $ ntfsusermap /dev/WinSystem /dev/NTFSDrive where the WinSystem is the partition on which Windows is installed and NTFSDrive is the partition you will be mounting with all the files you want access. For most of the prompts you will want to just press Enter to use the default mapping, but when you see your Windows username you will want to enter your Linux user id found in step 1. This generates a file named UserMapping in the current directory.
  3. Now you need to mount the NTFS partition and copy the {{ic|UserMapping} file into a folder named .NTFS-3G at the root of that partition.
  4. To have the mapping take effect, you must remount the partition - first unmount the partition and then every time you mount it in the future the UserMapping file will be in effect.

SDDM Display Manager

The SDDM display manager is lightweight, and the sddm package is available in the official repos. Install it easily with $ pacman -S sddm.

Create your configuration file by copying the default: cp /usr/lib/sdd/sddm.conf.d/default.conf /etc/sddm.conf. Modify this file as you like, two changes I like to use are:

/etc/sddm.conf
[General]
Numlock=on
[X11]
EnableHiDPI=true
Note: You can start the display manager simply by running the command: $ sudo sddm. However, it can be started automatically upon booting the system by enabling the service: $ sudo systemctl enable sddm.

Dislocker - Bitlocker tool

Dislocker is the tool required to access drives encrypted using the Windows technology Bitlocker. After installing, accessing the encrypted partition is actually a two-step process: first the partition is decrypted to a location (usually in /mnt), then that location is mounted like a normal NTFS block device to a different location which is used to access the contents.

The dislockerAUR package must be built & installed from the AUR. It is important to read the [https:// dislocker man page] and get a grasp on its usage. Despite the description of the package on the AUR, the regular dislocker is capable of both reading & writing to the encrypted partitions.

First, decrypt the partition using: $ sudo dislocker /dev/sdxy /mnt/decryptedLocation where sdxy matches the encrypted partition and decryptedLocation is the mount point where the decrypted block device will become available for mounting.

Next, mount the decrypted block device using something like ntfs-3g /dev/sdxy/dislocker-file /mnt/myDrive where sdxy is the same as in the previous step, and myDrive is the mount point you will use to access the actual data likea normally mounted device.

Note: The name dislocker-file will always be created by dislocker inside the specified mount point, and it is necessary to specify it when mounting to the location you will be accessing the data.
Tip: When mounting a Bitlocker encrypted partition, it's highly likely that this partition is also used in a Windows system. Therefore it would be wise to include the following options to your mount that prevent interoperability issues from using the partition in both Windows and Linux: windows_names,streams_interface=windows,norecover.

Openbox Configuration

This section will deal with my Openbox configuration. There are several standalone apps that I install to expand the user environment to include elements that are common in heavier desktop environments, and their configuration. Additionally, I will be posting important parts of my config for Openbox itself, especially the keyboard section of the rc.xml file, as i have some intricate keychain chroot keybinds that require explaining in order to understand their internet use.

You can download my Openbox configuration files from this location (coming soon) and I try my best to document the config files themselves using comments inside each file. Hopefully the comments themselves are sufficient to understanding how to use my setup, but for the sake of clarity, I have tried to explain the setup here as well.

rc.xml

menu.xml

autostart

environment

Should you have any questions about the above information, please post your questions in my Discussion page.

USEFUL PACKAGES

Here are list of tools I like to install at this point, using $ pacman -S pkgname, or can be installed from the Arch User Repository, when first you need to git clone them, then build & install with makepkg.

System

Openbox WM

  • openbox window manager
  • compton compositor
  • oblogout attractive logout dialog
  • tint2 taskbar with clock, system tray, etc
  • pypanel another taskbar, I usually have this and tint2 installed and can toggle between either with keybinds
  • rofi app launcher, I have this bound to Ctrl-Win-r
  • dmenu app launcher, I need to bind this to Alt-Win-r
  • xlunch-gitAUR another app launcher, I have this bound to Win-r
  • skippy-xd-gitAUR expose type of app switcher
  • obsetlayoutAUR for defining the layout of virtual desktops
  • openbox-xdgmenuAUR pipe menu for xdg apps
  • archlinux-xdg-menu dependency for pipe menu for xdg apps

Utilities

Internet

  • Vivaldi Is my primary browser, and is installed from the herecura repo, see the #Install Vivaldi Browser section for details. For people who liked the old Opera, before they dropped the Presto engine and all sorts of horrible crap turned it into just another browser, Vivaldi is created by the original author of Opera and embraces the same philosophy that made the original Opera great - extensive user control of a highly configurable brower.
  • Firefox just to have, not my primary browser
  • Chromium similarly, just to have when needed
  • Filezilla FTP client
  • Hexchat IRC client
  • Thunderbird eMail client
  • Private Internet Access VPN service - can be installed using the Linux client from the PIA Website

Media

  • alsa-utils to use alsamixer to unmute and turn up sound volume
  • feh feh is a fast and light imlib2-based image viewer - used for setting my background in Openbox, plus quick & easy image viewing
  • gimp gimp is the GNU Image Manipulation Program - can replace Photoshop for basic PS tasks
  • vlc vlc is the video player I use across all platforms
  • qmmp Qt audio player, similar to winamp, still deciding on my default mp3/flac player
  • darktable darktable is sort of like Lightroom, but not nearly as powerful
  • spotifyAUR native Spotify client

Office

Fonts

Chess

  • raptor-chessAUR a graphical interface for accessing FICS and analyzing positions with external engines (like stockfish)
    • jre10-openjdk is required for raptor-chess, actually, it requires jre6+ and perhaps using this later version is causing some of the problems I'm seeing
  • pychess pychess is a graphical interface for accessing FICS and analyzing positions with external engines (like stockfish)
  • stockfishAUR a strong chess engine