packer.sh 658 B

12345678910111213141516171819202122
  1. #!/usr/bin/bash -x
  2. # re-secure ssh
  3. sed -i "/^#\?PermitRootLogin/d" /etc/ssh/sshd_config
  4. echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
  5. # VirtualBox Guest Additions
  6. # https://wiki.archlinux.org/index.php/VirtualBox
  7. pacman -S --noconfirm linux-headers virtualbox-guest-utils virtualbox-guest-modules-arch nfs-utils
  8. echo -e 'vboxguest\nvboxsf\nvboxvideo' > /etc/modules-load.d/virtualbox.conf
  9. systemctl enable vboxservice.service
  10. systemctl enable rpcbind.service
  11. # Clean the pacman cache.
  12. yes | pacman -Scc
  13. # Write zeros to improve virtual disk compaction.
  14. zerofile=$(mktemp /zerofile.XXXXX)
  15. dd if=/dev/zero of="$zerofile" bs=1M
  16. rm -f "$zerofile"
  17. sync