When I tried to develop a system using CodeIgniter of php by specifying sync_folder
in the definition of Vagrantfile, I got an error.
Below is the definition of Vagrantfile.
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "centos/8"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
end
config.vm.provision :shell, :path => "./provision.sh", :privileged => true
config.vm.synced_folder "./codeigniter", "/var/www/html/codeigniter"
end
When I vagrant up
, I got the following error in red letters near the end.
Error with vagrant up
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/usr/sbin/rcvboxadd setup
Stdout from the command:
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel
modules. This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel
4.18.0-193.19.1.el8_2.x86_64.
VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what
went wrong
Stderr from the command:
modprobe vboxguest failed
The log file /var/log/vboxadd-setup.log may contain further information.
Take a look at the contents of the /var/log/vboxadd-setup.log
file as this error message points out.
Access CentOS started with vagrant ssh
and check the log.
less /var/log/vboxadd-setup.log
Building the main Guest Additions 6.1.12 module for kernel 4.18.0-193.19.1.el8_2.x86_64.
Error building the module. Build output follows.
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/4.18.0-193.19.1.el8_2.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j1 modules
Makefile:978: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.
make: *** [/tmp/vbox.0/Makefile-footer.gmk:117: vboxguest] Error 2
Could not find the X.Org or XFree86 Window System, skipping.
modprobe vboxguest failed
The important part of this error is
please install libelf-dev, libelf-devel or elfutils-libelf-devel
So, somehow, the dependency such as libelf-dev fails to install. It seems that.
When I tried dnf -y install libelf-dev
, I was angry that there was no such thing.
When I looked it up, it seemed to change to elfutils-libelf-devel
, so I'll install it.
dnf install -y elfutils-libelf-devel
Exit CentOS and run vagrant reload
.
This solved the sync_folder error.