packer.sh 537 B

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