pacman -S vagrant

两个 Vagrantfile 文件

Pure cli archlinux

    Vagrant.configure("2") do |config| = "archlinux/archlinux"

Archlinux with GUI

    # -*- mode: ruby -*-
    # vi: set ft=ruby :

    Vagrant.configure("2") do |config| = "archlinux/archlinux"
      config.vm.box_check_update = false

      config.vm.provider "virtualbox" do |vb|
        # Display the VirtualBox GUI when booting the machine
        vb.gui = true

        # Customize the amount of memory on the VM:
        vb.memory = "4096"
      # Enable provisioning with a shell script.
      config.vm.provision "shell", path: ""

      # bootstrap2 is for enabling GUI otherwise comment statement below
      config.vm.provision "shell", path: ""

      # bootstrap3 is for saving package cache on shared folder
      config.vm.provision "shell", path: ""

    #!/usr/bin/env bash

    # localisation configuration eg. en_US Shanghai
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
    mv /etc/locale.gen /etc/locale.gen.old
    echo -e "en_US.UTF-8 UTF-8" > /etc/locale.gen
    echo "LANG=en_US.UTF-8" > /etc/locale.conf

    # restore if package cache was saved from previous deployments
    if [ -e /vagrant/pkg.tgz ]
    	cd /var/cache/pacman/pkg
    	tar -xzvf /vagrant/pkg.tgz

    # update packages
    pacman -Syu --noconfirm

    #!/usr/bin/env bash

    # install X Gnome and alsa utils
    pacman -S --noconfirm xorg-server gnome alsa-utils lightdm lightdm-gtk-greeter

    # ttf-liberation fonts works well with lxde terminal emulator
    pacman -S --noconfirm ttf-liberation

    # install firefox and adblock plus
    pacman -S --noconfirm firefox firefox-adblock-plus

    # replace virtualbox guest additions with X support
    pacman -Rns --noconfirm virtualbox-guest-utils-nox
    pacman -S --noconfirm virtualbox-guest-utils

    # unmute sound and set volume to 100%
    amixer sset Master 100%+ unmute
    alsactl store

    # start lightdm at boot
    systemctl disable gdm
    systemctl enable lightdm

    # PulseAudio seems to remove crackling sound, YMMV
    pacman -S --noconfirm pulseaudio pulseaudio-alsa


    #!/usr/bin/env bash

    # save downloaded packages future deployments
    pacman -Sc --noconfirm
    cd /var/cache/pacman/pkg
    tar -czvf /vagrant/pkg.tgz *
Welcome to tell me your thoughts via "email" or click "here"