Skip to content

Instantly share code, notes, and snippets.

@walm
Last active October 17, 2021 19:46
Show Gist options
  • Select an option

  • Save walm/cc28aefbd14091641ecdfab6b302de8c to your computer and use it in GitHub Desktop.

Select an option

Save walm/cc28aefbd14091641ecdfab6b302de8c to your computer and use it in GitHub Desktop.
Arch Linux on VMWare

Install in VirtualBox

  1. Boot from ISO

  2. Keyboard: loadkeys sv-latin1

  3. Partitions boot, swap and root (home will use just use root)

    gdisk /dev/sda

    create boot partition

    >n

    Nr >[Enter for default 1]

    First sector >[Enter for default]

    Size >+250M

    HEX >[Enter for default 8300]

    create swap partition

    >n

    Nr >[Enter for default 2]

    First section >[Enter for default]

    Size >+2G

    HEX >8200

    create root partition

    >n

    use default for everyting to fill out the disk :)

    view partitions before write

    >p

    write partitions

    >w

  4. Format partitions

    mkfs.ext4 /dev/sda1 mkswap /dev/sda2 mkfs.ext4 /dev/sda3

  5. Mount filesystem

    swapon /dev/sda2 mount /dev/sda3 /mnt

    mkdir /mnt/boot mount /dev/sda1 /mnt/boot

  6. Install Arch

    pacstrap /mnt base base-devel genfstab -p /mnt >> /mnt/etc/fstab arch-chroot /mnt /bin/bash vi /etc/locale.conf LANG="en_US.UTF-8" vi /etc/locale.gen

    uncomment en_US.UTF-8 UTF-8

    uncomment en_US ISO-8859-1

    uncomment sv_SE.UTF-8 UTF-8

    uncomment sv_SE ISO-8859-1

    locale-gen ln -s /usr/share/zoneinfo/Europe/Stockholm /etc/localtime vi /etc/vconsole.conf KEYMAP=sv-latin1 vi /etc/hostname

    add a suitable hostname for the system, my main is HAL

    mkinitcpio -p linux

  7. Install bootloader

    pacman -S syslinux gptfdisk syslinux-install_update -i -a -m

  8. Secure root passwd

  9. Reboot

    exit umount /mnt/boot umount /mnt reboot

  10. Base config

# set keymap
vi /etc/vconsole.conf
  KEYMAP=sv-latin1

# connect to internet
dhcpcd

# autostart on boot (use ifstat to get device name like enp0s3)
systemctl enable [email protected]

# fix drivers (virtualbox)
pacman -S virtualbox-guest-utils
vi /etc/modules-load.d/virtualbox.conf
  vboxguest
  vboxsf
  vboxvideo
systemctl enable vboxservic

# fix drivers (vmware)
pacman -S open-vm-tools
 systemctl enable vmtoolsd.service

 # add non-root user
 useradd -d /home/<username> -m <username>
 gpasswd -a <username> audio
 passwd <username>

 pacman -S sudo
 vi /etc/sudoers
   # below root ALL=(ALL) ALL
   <username> ALL=(ALL) ALL

 # firewall, allow only incoming ssh
 iptables -N TCP
 iptables -N UDP
 iptables -P FORWARD DROP
 iptables -P OUTPUT ACCEPT
 iptables -P INPUT DROP
 iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
 iptables -A INPUT -i lo -j ACCEPT
 iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
 iptables -A INPUT -p icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT
 iptables -A INPUT -p udp -m conntrack --ctstate NEW -j UDP
 iptables -A INPUT -p tcp --syn -m conntrack --ctstate NEW -j TCP
 iptables -A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable
 iptables -A INPUT -p tcp -j REJECT --reject-with tcp-rst
 iptables -A INPUT -j REJECT --reject-with icmp-proto-unreachable
 iptables -A TCP -p tcp --dport 22 -j ACCEPT
 iptables-save > /etc/iptables/iptables.rules
 systemctl enable iptables.service

 reboot
  1. User "basic" setup, login with created user account

    utils

    sudo pacman -S curl git openssh tmux vim ruby htop nload

    x (vmware)

    sudo pacman -S xf86-input-vmmouse xf86-video-vmware gtkmm

    x environment

    sudo pacman -S xorg-server xorg-xinit xorg-server-utils mesa awesome rxvt-unicode chromium

    cp /etc/X11/xinit/xinitrc ~/.xinitrc vi ~/.xinitrc

    setxkbmap options:

    lv3:lalt_switch = left Alt as AltGr

    lv3:ralt_alt = right Alt as normal Alt (as it's default as AltGr)

    setxkbmap
    -layout se
    -model apple_laptop
    -variant mac
    -option lv3:lalt_switch
    -option lv3:ralt_alt

    VBoxClient-all # no, lets just activate the thing I use

    VBoxClient --clipboard VBoxClient --display

    exec awesome startx

Sound "sudo pacman -S pulseaudio-alsa lib32-libpulse lib32-alsa-plugins"

Disable PC speaker "echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment