I built a CentOS 8 environment with Vagrant and tried to sync_folder, but I got an error, so I solved it.

Errors and solutions that occur with sync_folder

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.

Recommended Posts

I built a CentOS 8 environment with Vagrant and tried to sync_folder, but I got an error, so I solved it.
I built a rails environment with docker and mysql, but I got stuck
I tried to create a java8 development environment with Chocolatey
I tried to create a padrino development environment with Docker
A story stuck with an error when building Vagrant + Virtulbox CentOS7.8 and creating a shared folder
I can deploy to heroku, but I get an error and can't open it [Cause: MySQL]
I tried to build an http2 development environment with Eclipse + Tomcat
I got an error and couldn't push! !! [error: failed to push some refs to]
On jetson nano, I tried pip install xxx.whl with Dockerfile but got an error (xxx.whl is not a supported wheel on this platform.)
[Terraform] When I try to build an Azure resource on a Windows machine, it will time out, so I solved it with Docker.
Memorandum: When I tried TensorFlow with Tribuo, it didn't work, so I went on a journey to find the head family and lost.
I tried to make a machine learning application with Dash (+ Docker) part1 ~ Environment construction and operation check ~
I tried to build a Firebase application development environment with Docker in 2020
01. I tried to build an environment with SpringBoot + IntelliJ + MySQL (MyBatis) (Windows10)
When I tried to build an environment of PHP7.4 + Apache + MySQL with Docker, I got stuck [Windows & Mac]
I don't really understand the difference between swift Error and NSError, so I tried to summarize it myself.
There is LSP and I tried to create an environment to write Java with Vim (NeoVim), but after all I could not beat the IDE ...
When I tried to start GlassFish, I got an internal error while "Publishing to GlassFish 4.0 on localhost ...". What to do when it becomes
I built a Java EE environment on AWS and tried running a web application
When I tried to use a Wacom tablet with ubuntu 20.04, I didn't recognize it.
[Mockito] 3.2.4 → 3.3.x, but I got an error (Iketenai)
I tried to break a block with java (1)
I tried to use docker with jetson jetpack4.3 but got an error (docker: Error response from daemon: OCI runtime create failed: container_linux.go: 345: starting container process caused ...)
I tried to create a shopping site administrator function / screen with Java and Spring
How to quit Docker for Mac and build a Docker development environment with Ubuntu + Vagrant
I tried to read and output CSV with Outsystems
When I bcrypt with node + docker, I got an error
roman numerals (I tried to simplify it with hash)
I tried to build an environment using Docker (beginner)
[Rails 6.0, Docker] I tried to summarize the Docker environment construction and commands necessary to create a portfolio
I got an error when using nextInt, nextLine and substring.
I tried to make an introduction to PHP + MySQL with Docker
I tried to modernize a Java EE application with OpenShift.
[Rails] I tried to create a mini app with FullCalendar
I want to make a list with kotlin and java!
I want to make a function with kotlin and java!
Build a Node-RED environment with Docker to move and understand
I tried upgrading from CentOS 6.5 to CentOS 7 with the upgrade tool
I tried to express the result of before and after of Date class with a number line
I tried to take a look at the flow of Android development environment construction with Android Studio
I tried to create an API to get data from a spreadsheet in Ruby (with service account)
I can deploy to heroku, but I get an error and can't open it [Cause: MySQL]
I can't deploy! Resolve an error that can't be pushed to heroku (Rails Tutorial Chapter 1)
I get an error with bundle install and puma cannot be installed.
Where can I get OpenJDK binaries and archives?
I created a Rails post form, but I can't post it (form tag) / No error occurs
Beginner: I get an error on line 30. I don't know where to fix it.
I get an error when adding a dependency
[Mockito] 3.2.4 → 3.3.x, but I got an error (Iketenai)
I built a CentOS 8 environment with Vagrant and tried to sync_folder, but I got an error, so I solved it.
I got an error when using nextInt, nextLine and substring.
When you deploy to Heroku but it doesn't reflect well
[Rails] I can post S3 images in my local environment, but I can't switch to S3 on Heroku.
I can read it! RxJava
I got an error and couldn't push! !! [error: failed to push some refs to]
I tried printing a form with Spring MVC and JasperReports 1/3 (JasperReports settings)
[Beginner] Procedure to log in to the virtual environment built with Vagrant
I tried to build the environment of PlantUML Server with Docker
I got an IllegalAccessError when trying to use PowerMock with JUnit
I tried to create a Spring MVC development environment on Mac
I tried to make it an arbitrary URL using routing nesting
[Introduction to JSP + Servlet] I played with it for a while ♬
Steps to build a Ruby on Rails development environment with Vagrant
I tried to build a laravel operating environment while remembering Docker
I tried to make a group function (bulletin board) with Rails
I want to download a file on the Internet using Ruby and save it locally (with caution)
An error occurred in the free course of RubyOnRails Udemy, solved it, and went through to the end
What I did when I was addicted to the error "Could not find XXX in any of the sources" when I added a Gem and built it