Wednesday, February 26, 2014

Vagrant in Arch Linux

I am using vagrant recently and come across some problems in Arch Linux.
Here I share the experience with all of you.

Before installing vagrant, you should at least have the virtualbox installed. If not, following the official instructions.

There are two important steps here, which cannot be ignored:
Step 1.
Step 2.

Install vagrant

Vagrant is not available in Arch Linux official repository for the moment. However, it can be downloaded from AUR.

The repository provides rpm version, which means we cannot install the package directly by using pacman. As suggested by Peter, using AUR helper is a better way to install the package.

Crate or download your vagrant configuration file.

to download and/or start your guest.
vagrant up

To access the server you deployed.
vagrant ssh


If you use NFS to synchronize the files between host and guest, you need to install some extra packages in your host and guest.

For arch host, the  following packages should be installed.
pacman -S nfs-utils

pacman -S net-tools

To start nfs, the following services should be start

systemctl start rpc-idmapd.service

systemctl start rpc-mountd.service

To start nfs during the bootup.

systemctl enable rpc-idmapd.service

systemctl enable rpc-mountd.service

For arch guest, the following modules should be installed.
apt-get install nfs-common portmap


  1. I would strongly recommend installing vagrant using makepkg or an AUR helper. Simply placing files into a directory like /usr/bin without pacman associating them with a package can result in some very undesirable situations later on.

    1. But when I use makepkg, it also give a rpm package.
      I can't install rpm with pacman -U something. How did you handle that?

    2. Oh, I thought makepkg was doing the extraction but it was yaourt. Use that, it's super convenient!

    3. Thank you so much!
      AUR helper is very useful! I didn't know it until you told me. I suffered a lot when the packages doesn't end up with tar.xz.