Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8888237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:59:11+00:00 2026-06-14T21:59:11+00:00

I use vagrant and chef to develop my own blog in a virtual machine.

  • 0

I use vagrant and chef to develop my own blog in a virtual machine. To have easy access to the wordpress folder I created a shared folder.

Basically the wordpress folder is on my host and gets mounted as shared folder in /var/www/wordpress in the VM. The configuration is similar to:

config.vm.share_folder "foo", "/guest/path", "/host/path"

My problem is that the ownership in my VM is always vagrant:vagrant even if I change it on my host. Ownership changes in the VM get ignored.

I cannot use chown to set the ownership of the upload directory to www-data:www-data.

It is possible to use chmod and change the access restrictions to 777, but this is a really ugly hack.

Here is what I actually want. Is this possible?:

  • Development: Access to the shared folder from my host.
  • Access Restriction: On the VM all files and folders should have proper and secure ownership and access restrictions.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:59:12+00:00Added an answer on June 14, 2026 at 9:59 pm

    As @StephenKing suggests you can change the options of the whole directory.

    The relevant function is not documented but the source tells us:

    # File 'lib/vagrant/config/vm.rb', line 53
    
    def share_folder(name, guestpath, hostpath, opts=nil)
      @shared_folders[name] = {
        :guestpath => guestpath.to_s,
        :hostpath => hostpath.to_s,
        :create => false,
        :owner => nil,
        :group => nil,
        :nfs   => false,
        :transient => false,
        :extra => nil
      }.merge(opts || {})
    end 
    

    Basically you can set group, owner and acl for the whole folder which is way better than setting everything to world writable on the host. I have not found any method to change the ownership of a nested directory.

    Here is a quickfix:

    config.vm.share_folder "v-wordpress", "/var/www/wordpress", "/host/path", :owner => "www-data", :group => "www-data"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Vagrant with Chef to build a Ubuntu 12.04 virtual machine. I'm using
I use vagrant to test my chef recipes. The issue is that I have
I'm getting an error when I am trying to use Vagrant/Chef for setting up
I use Vagrant and Chef to create new servers when I am developing. I
Use Elixir and have two entities -- Voter and Candidate -- with many to
I'm creating a virtual machine to mimic our production web server so that I
use javascript or other method ? have any recommendation?
Use case is to have a server connect to thousands of users email accounts
use case example I have a servlet that is receiving login requests. If a
Running Ubuntu 11.04 on vagrant, mac os x 10.7.2. Running chef server. Trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.