A story stuck with an error when building Vagrant + Virtulbox CentOS7.8 and creating a shared folder

Vagrant + Virtulbox CentOS7.8 + Laravel 6 series

When building an environment with the above configuration, the host OS and guest OS are often used. When setting up sharing, I got stuck with an error and took about 3 days to resolve I will write what I did.

Since Vagrant related depends on Version I will consciously post the version description as a memorandum.

In translation, it's macOS Mojave. -ProductName: Mac OS X ・ ProductVersion: 10.14.6 ・ BuildVersion: 18G6042

Centralized management of cask with Homevrew ・ Vagrant 2.2.13 ・ Virtualbox 6.1.16,140961

LAMP environment CentOS 7.8 configuration -Apache/2.4.6 (CentOS) ・ PHP 7.3.24 (cli) ・ Mysql Ver 14.14 Distrib 5.7.32

Install Composer

CentOS disables all usual security because it is a local environment ・ SELinux is disabled ・ Firewall invalid

Laravel installation

$vagrant ssh
$cd /vagrant
$composer create-project --prefer-dist laravel/laravel laravelsample "6.*"

After creating the Laravel project, go to the Apache directory

$cd /var/www/html
$sudo ln -s /vagrant/laravelsample laravelsample

Confirmation. Haste error! !! orz ....

The contents are as follows ↓

Permission denied issue when accessing by running Laravel in Vagrant environment

A phenomenon that causes an error when creating a log file

What i did

I solved it by setting the execution authority under the project created by Laravel to 777!

I see the article.

$ sudo chmod -R 777 laravelsample

... I can't solve it

It's no good because the owner of the shared folder is not the apache user!

I see the article.

config.vm.synced_folder ".", "/vagrant",
 :owner => 'apache',
 :group => 'apache',
  mount_options: ['dmode=777','fmode=755']

Add

Error when Vagrant up ... orz

... I can't solve it

But the owner and group of the Laravel project directory must be Apache I understood.

Is the version of Guest Additions incorrect?

A lot of articles "I solved it by inserting the vagrant-vbguest plugin"

This is the solution! !!

$ vagrant plugin install vagrant-vbguest

... I can't solve it

Apparently, the description rule of config.vm.synced_folder has changed when I investigate.

config.vm.synced_folder ".", "/vagrant",
     owner: "apache",
     group: "apache"

I saw it! !! !!

It took about 3 days (explosive sweat)

Lesson

First, read the details of the error carefully and think of a solution. Then reread the official reference.

Written in Japanese, avoiding it because it is in English When I browse the solution, it says It was a lesson.

Let's read English errors properly! See you!

Recommended Posts

A story stuck with an error when building Vagrant + Virtulbox CentOS7.8 and creating a shared folder
A memorandum when building an environment with Ruby3.0 x Rails6.1 x Docker x CentOS Stream
I built a CentOS 8 environment with Vagrant and tried to sync_folder, but I got an error, so I solved it.
A story that got stuck with an error during migration in docker PHP laravel
The story when the container does not start up with docker-compose up and an error occurs
Building an environment for creating apps with Rails and Vue
A story stuck with NotSerializableException
A story of connecting to a CentOS 8 server with an old Ansible
[Unauthorized Operation] A memorandum because an error occurred when creating an EC2 instance.
About virtualBox6.1.16, error resolution of shared folder when updating to CentOS Stream
When registering a new user, I got an error called ActiveRecord :: NotNullViolation and how to deal with it.
Error when building infrastructure with aws app
A reminder when an aapt.exe error occurs
When introducing JOOQ to Spring boot, a story that was dealt with because an error occurred around Liquibase
When using a list in Java, java.awt.List comes out and an error occurs
I get an error when adding a dependency
Set up a CentOS virtual server with Vagrant
A story about PKIX path building failed when trying to deploy to tomcat with Jenkins
A memo to do for the time being when building CentOS 6 series with VirtualBox
A story about an error collating checksum values after npm install with Laravel Homestead
[Review] When creating a web application with Rails, syntax error, unexpected')', expecting => ...]}% ","% # {params [: content]}% "]) ...