hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.05k stars 4.42k forks source link

Vagrant AppImage is Broken #13253

Open viktor76525 opened 11 months ago

viktor76525 commented 11 months ago

Awk is used by Vagrant but is not included in the App Image, therefore it depends on the system's awk to be compatible with your provided library.

Debug output

While doing vagrant up

==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "15202f84-079e-432c-8834-ee120de63e85", "--type", "headless"]

Stderr: awk: symbol lookup error: /tmp/.mount_vagranrfeXQ3/usr/lib/libreadline.so.8: undefined symbol: UP

Issue is pretty clear and can be seen by setting the library path inside the extracted App Image.

cd /tmp/.mount_vagrandlqlN7/usr/lib
LD_LIBRARY_PATH=. awk --help
awk: symbol lookup error: ./libreadline.so.8: undefined symbol: UP

Expected behavior

Vagrant should include the awk binary in the AppImage, maybe use busybox? Or at least reset the library path before running commands which are expected to be on the system.

Actual behavior

Vagrant does not provide the awk binary, it assumes the system awk binary is compatible with the provided libreadline.so.

Reproduction information

Vagrant version

2.3.4 and 2.3.7 tried. Downloaded from the AMD64 link on the downloads page https://www.vagrantup.com/downloads.html.

Host operating system

Gentoo Linux

Guest operating system

Ubuntu

Steps to reproduce

  1. vagrant up in setup repo.
  2. Doesn't work.
  3. Have to remove port forwarding from Vagrantfile or restart the system because vagrant doesn't shutdown cleanly.

Vagrantfile

Vagrant.require_version ">= 2.2.0"

Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/bionic64"
  config.vm.hostname = "vagrant-random"

  # sample
  #config.vm.network "forwarded_port", guest: 12345, host: 112345, host_ip: "0.0.0.0"
  # sample
  #config.vm.network "forwarded_port", guest: 12346, host: 112346, host_ip: "0.0.0.0"

  config.vm.synced_folder ".", "/vagrant/env/"

  config.vm.provider "virtualbox" do |vb|
    vb.gui = false
    vb.memory = 1200
    vb.cpus = 2
    vb.customize ["storagectl", :id, "--name", "SATA Controller", "--hostiocache", "on"]
  end

  config.vm.post_up_message = %{
  }

  config.vm.provision :shell, path: "vagrant/scripts.sh"
end
DanHugoDanHugo commented 9 months ago

This still occurs with vagrant v2.4.0, Debian unstable host, simply running vagrant without arguments.

Tried the busybox (static) suggestion

  1. extract vagrant appimage
  2. cp busybox-static v1.36.1 to squashfs-root/usr/bin/awk
  3. rebuild appimage with appimagekit

avoids awk symbol lookup error. Unfortunately I also run into a symbol lookup error (before and after this workaround test) so I can´t say that this worked explicitly to a useful conclusion, but might be useful in a pinch otherwise…

Stderr: /usr/lib/virtualbox/VBoxManage: symbol lookup error: /lib/x86_64-linux-gnu/libcurl-gnutls.so.4: undefined symbol: libssh2_session_set_read_timeout

fwiw and ymmv