vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Start collecting workarounds for all various unfixed problems giving people grief.

Open ladar opened this issue 3 years ago • 2 comments

My Jenkins was experiencing random failures in which, it appears Vagrant was locking itself out a box during the provisioning process. I will include two examples as text file attachments. But that was only what prompted me to try upgrading to a newer Vagrant version. The issue just described was being generated by Vagrant 2.2.14, because that is the last release to still work on CentOS 6.10.

I didn't want to report an issue until I was able to verify it is still a problem ith the latest release, 2.2.19, but the binaries, and libraries embedded provided by the 2.2.19 CentOS RPM require varius versions of GNU libc that are newer than 2.12, which is the version provided by CentOS. Hence I created a work around, which others might find useful, if they also want to use newer Vagrant releases on older that would otherwise to be too old.

Yes, it would be great if Vagrant started releasing an RPM for RHEL/CentOS 6 users, and another RPM for anybody with RHEL/CentOS 7+... but that's been a problem for ~1 year already, so I'm moving on.

That said, it seems like an obvious, and rather frustrating oversight the Vagrant download pages don't indicate minimum software requirements?

The following script builds GNU libc 2.17 and sets it up outside the normal library search path. Then modifies the files provided by the official Vagrant RPM to look in the right place libc.so.6 .. and the result old systems can up to a newer Vagrant releases.

#!/bin/bash

cd $HOME/
GLIBC_VERSION="2.17"
GLIBC_PREFIX="/usr/glibc/"
VAGRANT_VERSION="2.2.19"

# Install the basic build system utilities.
yum groupinstall -y "Development tools"
yum install -y curl patchelf

# Grab the tarball with the GNU libc source code.
curl -Lfo glibc-${GLIBC_VERSION}.tar.gz "https://ftp.gnu.org/gnu/glibc/glibc-${GLIBC_VERSION}.tar.gz"
echo "a3b2086d5414e602b4b3d5a8792213feb3be664ffc1efe783a829818d3fca37a  glibc-${GLIBC_VERSION}.tar.gz" | sha256sum -c || exit 1

# Extract the secrets and get ready to rumble.
tar xzvf glibc-${GLIBC_VERSION}.tar.gz

# The configure script requrires an independent build directory.
mkdir -p glibc-build && cd glibc-build

# Configure glibc with a GLIBC_PREFIX so it doesn't conflict with distro libc files..
../glibc-${GLIBC_VERSION}/configure --prefix="${GLIBC_PREFIX}" --libdir="${GLIBC_PREFIX}/lib" \
--libexecdir="${GLIBC_PREFIX}/lib" --enable-multi-arch

# Compile and then install GNU libc.
make -j8 && make install

# Download and install Vagrant.
curl -Lfo vagrant_${VAGRANT_VERSION}_x86_64.rpm "https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.rpm"
echo "990e8d2159032915f21c0f1ccdcbca1a394f7937e06e43dc1dabe605d208dc20  vagrant_${VAGRANT_VERSION}_x86_64.rpm" | sha256sum -c || exit 1
yum install -y vagrant_${VAGRANT_VERSION}_x86_64.rpm

# Patch the binaries and shared libraries inside the Vagrant directory, so they use the new version of GNU libc.
(find /opt/vagrant/ -type f -exec file {} \; )| grep "dynamically linked" | awk -F':' '{print $1}' | while read FILE ; do
  patchelf --set-rpath /opt/vagrant/embedded/lib:/opt/vagrant/embedded/lib64:/usr/glibc/lib:/usr/lib64:/lib64:/lib --set-interpreter /usr/glibc/lib/ld-linux-x86-64.so.2 "${FILE}"
done

vagrant-lockout-1.txt

vagrant-lockout-2.txt

ladar avatar Mar 31 '22 19:03 ladar

If anyone stumbles across the logs I attached to this issue, I decided to open up a separate issue detailing the cause. Unfortunately my attempt to make a quick, short report with details on the bug morphed into something longer. #12729

ladar avatar Apr 06 '22 15:04 ladar

@ladar Just a note here, for the 64bit rpm builds i was able to revert back to using centos 6 which I believe should resolve these issues.

chrisroberts avatar Aug 30 '22 17:08 chrisroberts

Hi there,

Vagrant installers have had a handful of updates since this issue was created and everything mentioned here should be resolved. If you are still encountering any of these issues (or similar ones), please do let me know.

Cheers!

chrisroberts avatar Jun 30 '23 21:06 chrisroberts