Differences between revisions 7 and 8
Revision 7 as of 2015-08-27 16:47:28
Size: 926
Editor: JensReyer
Comment: Replace non-existing "Packer" wiki link by "Teams/Cloud/RebuildVagrantBaseBoxes"
Revision 8 as of 2018-08-15 08:23:31
Size: 2200
Comment: adding a troubleshooting zone and an NFS fix
Deletions are marked like this. Additions are marked like this.
Line 25: Line 25:

== Troubleshooting ==

On `vagrant up` various errors can happen:

=== Errors on NFS mount ===

During the `vagrant up` process you can get this error:

{{{
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=4 192.168.121.1:/home/jhon/projects/foo /vagrant
result=$?
if test $result -eq 0; then
if test -x /sbin/initctl && command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
fi
else
exit $result
fi

Stdout from the command:

Stderr from the command:

mount.nfs: access denied by server while mounting 192.168.121.1:/home/jhon/projects/foo
}}}

First of all ensure that your NFS daemon is running:

{{{
sudo systemctl status nfs-common
sudo systemctl status nfs-kernel-server
}}}

Then copy from the above error the `mount` command and try running it on yourself, but downgrading the NFS version (the `vers`):

{{{
vagrant ssh
sudo mount -o vers=3 192.168.121.1:/home/jhon/projects/foo /vagrant
}}}

If it works manually, than you can fix it adding this line into your `Vagrantfile`:

{{{
config.vm.synced_folder ".", "/vagrant", nfs_version: "3"
}}}

Vagrant is an application that manages virtualized environments (boxes) allowing to control the creation and provisionning of virtual machines, which may share some resources (folders) with the host.

Vagrant supports different virtualization engines (providers), among which VirtualBox is historically the most popular.

Debian Vagrant base box

There is an ongoing effort to provide official Teams/Cloud/VagrantBaseBoxes, hosted in Atlas, Vagrant's cloud product. Although not yet official, you can already use these boxes

vagrant init debian/jessie64
vagrant up
vagrant ssh

Creating Debian vagrant boxes

You also may wish to create your own Debian boxes, instead of relying on ones provided by a third party.

Several tools may be used to do so :

Troubleshooting

On vagrant up various errors can happen:

Errors on NFS mount

During the vagrant up process you can get this error:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=4 192.168.121.1:/home/jhon/projects/foo /vagrant
result=$?
if test $result -eq 0; then
if test -x /sbin/initctl && command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant
fi
else
exit $result
fi

Stdout from the command:

Stderr from the command:

mount.nfs: access denied by server while mounting 192.168.121.1:/home/jhon/projects/foo

First of all ensure that your NFS daemon is running:

sudo systemctl status nfs-common
sudo systemctl status nfs-kernel-server

Then copy from the above error the mount command and try running it on yourself, but downgrading the NFS version (the vers):

vagrant ssh
sudo mount -o vers=3 192.168.121.1:/home/jhon/projects/foo /vagrant

If it works manually, than you can fix it adding this line into your Vagrantfile:

config.vm.synced_folder ".", "/vagrant", nfs_version: "3"