# load german keyboard layout loadkeys de-latin1 # stop dhcp client daemon in case it is still running systemctl stop dh [systemctl stop dhcpcd@.service] # configure IP address ip a a x.x.x.x/x broadcast + dev # configure default route ip ro a default via x.x.x.x dev # set password for root account of setup environment passwd # sshd should already be running, so it is now possible to connect to the host via SSH. # configure DNS by either altering resolv.conf echo "nameserver x.x.x.x" >> /etc/resolv.conf # or resolved.conf nano /etc/systemd/resolved.conf ``` # /etc/systemd/resolved.conf [...] DNS=192.0.2.42#ntp.acme.local FallbackDNS=1.1.1.1#cloudflare-dns.com #FallbackDNS=1.1.1.1#cloudflare-dns.com 9.9.9.9#dns.quad9.net 8.8.8.8#dns.google 2606:4700:4700::1111#cloudflare-dn> Domains=~. #DNSSEC=no #DNSOverTLS=no MulticastDNS=no LLMNR=no Cache=yes CacheFromLocalhost=no DNSStubListener=no #DNSStubListenerExtra= ReadEtcHosts=yes ResolveUnicastSingleLabel=no ``` systemctl enable systemd-resolved.service # configure NTP settings as needed (see https://wiki.archlinux.org/title/Systemd-timesyncd ) # and enable NTP timesync nano /etc/systemd/timesyncd.conf ``` # /etc/systemd/timesyncd.conf [...] [Time] NTP=ntp.example.com FallbackNTP=0.at.pool.ntp.org 1.at.pool.ntp.org 2.at.pool.ntp.org 3.at.pool.ntp.org RootDistanceMaxSec=5 PollIntervalMinSec=368 PollIntervalMaxSec=19645 ConnectionRetrySec=43 SaveIntervalSec=53 ``` # configure timezone ln -sf /usr/share/zoneinfo/CET /etc/localtime timedatectl set-ntp 1 # show available drives lsblk # choose preferred tool to create partition table (not fdisk, as it lacks the ability to change partition names in GPT) gdisk /dev/sdx cgdisk /dev/sdx # required partitions ef00 (1) 100m EFIBOOT 8300 () 8g root # optional partitions 8200 2g swap # format and mount/use partitions mkfs.fat -F32 -n EFIBOOT /dev/sdx1 mkswap -L swap /dev/sdx2 swapon /dev/sdx2 mkfs.ext4 -L root /dev/sdx3 # or mkfs.btrfs -L root /dev/sdx3 mount -L root /mnt mkdir -p /mnt/boot mount -L EFIBOOT /mnt/boot # prepare mirrorlist cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist_original pacman -Sy pacman -S pacman-contrib rankmirrors -n 10 /etc/pacman.d/mirrorlist_original > /etc/pacman.d/mirrorlist # base installation pacstrap /mnt linux base base-devel efibootmgr openssh man-db nano # include as needed cronie open-vm-tools hyperv screen nmap arp-scan ... # minimal version: pacstrap /mnt linux base autoconf automake bash binutils bison bzip2 coreutils device-mapper efibootmgr fakeroot file filesystem findutils flex gawk gcc gcc-libs gettext glibc grep groff gzip inetutils iproute2 iputils less libtool licenses linux logrotate m4 make man-db man-pages nano pacman patch pkgconf pciutils perl procps-ng psmisc s-nail sed shadow sudo sysfsutils systemd systemd-sysvcompat tar texinfo util-linux vi which openssh open-vm-tools # generate mount information file genfstab -U /mnt >> /mnt/etc/fstab # switch to new installation context arch-chroot /mnt # configure timezone ln -sf /usr/share/zoneinfo/CET /etc/localtime # set hardware clock to UTC hwclock -w # fix numpad behavior # 'rebindkeypad' is deprecated nano /etc/nanorc set nonewlines set rawsequences include "/usr/share/nano/*.nanorc" # configure and generate locales nano /etc/locale.gen locale-gen echo "LANG=en_US.UTF-8" > /etc/locale.conf && echo "KEYMAP=de-latin1" > /etc/vconsole.conf # set hostname echo "X" > /etc/hostname nano /etc/hosts ### start of file content ### 127.0.0.1 localhost #::1 localhost 127.0.1.1 X.localdomain X ### end of file content ### # add variables and aliases to /etc/bash.bashrc as needed nano /etc/bash.bashrc ### start of added file content ### export EDITOR=/usr/bin/nano export VISUAL=$EDITOR export HISTCONTROL=ignoreboth export HISTIGNORE='history:clear' export HISTSIZE=20000 export HISTFILESIZE=20000 alias duso='printf "Make it so!" && echo -e "\n\c"' alias exot='echo "Ja, ist ja gut, du Exot..."' alias fixwin='sh /home/krom/scripts/fixwindow.sh' alias off='sudo systemctl poweroff' alias out='logout' alias qping='sudo ping -i 0.1 -W 1 -c 3 -n' alias reboot='sudo reboot' alias scan='sudo sh /scripts/scan.sh' ### end of added file content ### # configure sudo nano /etc/sudoers %wheel ALL=(ALL) NOPASSWD: ALL # set root password passwd # add non-root user useradd --create-home Y # add the new user to the wheel group gpasswd -a Y wheel # set password for new user passwd Y # configure network nano /etc/systemd/network/20-wired.network ### start of file content ### [Match] Name= [Network] Address=x.x.x.x/x Gateway=x.x.x.x ### end of file content ### # configure name resolution nano /etc/systemd/resolved.conf # enable required services systemctl enable systemd-networkd.service systemctl enable systemd-resolved.service systemctl enable sshd.service # as needed systemctl enable vmtoolsd.service systemctl enable hv_fcopy_daemon.service systemctl enable hv_kvp_daemon.service systemctl enable hv_vss_daemon.service # delete existing efiboot entries efibootmgr -Bb 0 efibootmgr -Bb 1 ... # write efistub boot entries to system EFI efibootmgr -c -d /dev/sda -p 1 -l \vmlinuz-linux -L "archlinux efistub" -u "initrd=/initramfs-linux.img root=LABEL=root rw ipv6.disable=1" efibootmgr -c -d /dev/sda -p 1 -l \vmlinuz-linux -L "archlinux fallback efistub" -u "initrd=/initramfs-linux-fallback.img root=LABEL=root rw ipv6.disable=1" # change boot order efibootmgr -o 0,1 # exit and reboot host exit umount -R /mnt reboot # check DNS and NTP after reboot