{"id":15603221,"url":"https://github.com/gael-ian/vagrant-bindfs","last_synced_at":"2025-05-14T09:07:20.333Z","repository":{"id":1197351,"uuid":"1104271","full_name":"gael-ian/vagrant-bindfs","owner":"gael-ian","description":"A Vagrant plugin to automate bindfs mount in the VM","archived":false,"fork":false,"pushed_at":"2025-02-20T21:41:32.000Z","size":370,"stargazers_count":489,"open_issues_count":0,"forks_count":37,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-06T04:46:04.041Z","etag":null,"topics":["bindfs-mount","nfs","vagrant-plugin"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gael-ian.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"notus-sh"}},"created_at":"2010-11-23T02:04:31.000Z","updated_at":"2025-03-15T09:25:18.000Z","dependencies_parsed_at":"2024-02-12T22:42:57.884Z","dependency_job_id":"75397de0-291a-4b42-92f1-f1081f4d5b7b","html_url":"https://github.com/gael-ian/vagrant-bindfs","commit_stats":{"total_commits":326,"total_committers":29,"mean_commits":"11.241379310344827","dds":0.3957055214723927,"last_synced_commit":"fdb395ade3f4862a9838d5931bebd35012785896"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gael-ian%2Fvagrant-bindfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gael-ian%2Fvagrant-bindfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gael-ian%2Fvagrant-bindfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gael-ian%2Fvagrant-bindfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gael-ian","download_url":"https://codeload.github.com/gael-ian/vagrant-bindfs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253708789,"owners_count":21951056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindfs-mount","nfs","vagrant-plugin"],"created_at":"2024-10-03T03:02:02.912Z","updated_at":"2025-05-14T09:07:20.289Z","avatar_url":"https://github.com/gael-ian.png","language":"Ruby","funding_links":["https://opencollective.com/notus-sh"],"categories":[],"sub_categories":[],"readme":"# vagrant-bindfs\n\n[![Unit tests](https://github.com/gael-ian/vagrant-bindfs/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/gael-ian/vagrant-bindfs/actions/workflows/unit-tests.yml)\n\nA Vagrant plugin to automate [bindfs](http://bindfs.org/) mounts in the VM. This allow you to change owner, group and permissions on files and, for example, work around NFS share permissions issues.\n\n## Some Background: Why `vagrant-bindfs`\n\nThe default vagrant provider is [virtualbox](https://www.virtualbox.org/).\nIt's free and works well but has some [performance problems](http://snippets.aktagon.com/snippets/609-Slow-IO-performance-with-Vagrant-and-VirtualBox-).\n\nPeople often recommend switching to [vagrant's VMWare-fusion provider](http://www.vagrantup.com/vmware).\nThis reportedly has better performance, but shares with symlinks [won't work](http://communities.vmware.com/thread/428199?start=0\u0026tstart=0).\nYou also have to buy both the plugin and VMware Fusion.\n\nThe final recommendation, at least on Linux/OSX hosts, is to [use NFS](http://docs.vagrantup.com/v2/synced-folders/nfs.html).\nHowever, an NFS mount has the same numeric permissions in the guest as in the host.\nIf you're on OSX, for instance, a folder owned by the default OSX user will appear to be [owned by `501:20`](https://groups.google.com/forum/?fromgroups#!topic/vagrant-up/qXXJ-AQuKQM) in the guest.\n\nThis is where `vagrant-bindfs` comes in!\n\nSimply:\n\n- mount your share over NFS into a temporary location in the guest\n- re-mount the share to the actual destination with `vagrant-bindfs`, setting the correct permissions\n\n_Note that `map_uid` and `map_gid` NFS options can be used to set the identity used to read/write files on the host side._\n\n## Installation\n\nvagrant-bindfs is distributed as a Ruby gem. \nYou can install it as any other Vagrant plugin with:\n\n```bash\nvagrant plugin install vagrant-bindfs\n```\n\n## Usage\n\nIn your `Vagrantfile`, use `config.bindfs.bind_folder` to configure folders that will be bound on VM startup.\nThe format is:\n\n```ruby\nconfig.bindfs.bind_folder \"/path/to/source\", \"/path/to/destination\", options\n```\n\nBy default, all folders are bound after folders syncing between host and guest machines.\nYou can pass a special `:after` option to the bind_folder method to choose when a folder should be bound.\nSupported values are :\n\n* `:synced_folders` (default)\n* `:provision`, to bind a folder after provisioning occured.\n\n### Example\n\n```ruby\nVagrant.configure(\"2\") do |config|\n\n  [...] # Your VM configuration\n\n  ## Basic usage\n  config.bindfs.bind_folder \"source/dir\", \"mount/point\"\n\n\n  ## Advanced options\n  config.bindfs.bind_folder \"source/dir\", \"mount/point\",\n    perms: \"u=rw:g=r:o=r\", # http://bindfs.org/docs/bindfs.1.html#sect12\n    create_as_user: true\n\n\n  ## Complete example for a NFS shared folder\n\n  # Static IP is required to use NFS shared folder,\n  # this is only required for Virtualbox provider\n  config.vm.network \"private_network\", ip: \"192.168.50.4\"\n\n  # Declare shared folder with Vagrant syntax\n  config.vm.synced_folder \"host/source/dir\", \"/vagrant-nfs\", type: :nfs\n\n  # Use vagrant-bindfs to re-mount folder\n  config.bindfs.bind_folder \"/vagrant-nfs\", \"guest/mount/point\"\n\n  # Bind a folder after provisioning\n  config.bindfs.bind_folder \"/vagrant-after-provision\", \"another/guest/mount/point\", after: :provision\n\nend\n```\n\nRemember that Vagrant use `/vagrant` on guest side to automatically share your project directory (the one with the Vagrantfile), in particular for provisioning and configuration purposes. Binding a folder to `/vagrant` or one of its subfolders may expose unexpected behaviors.\n\n### bindfs support\n\nThe `bind_folder` config accept any option you can pass to bindfs.\nvagrant-bindfs is compatible with bindfs from version 1.9 to 1.14.7.\nCheck [lib/vagrant-bindfs/bindfs/option_definitions.json](https://github.com/gael-ian/vagrant-bindfs/blob/master/lib/vagrant-bindfs/bindfs/option_definitions.json) for a complete list of supported options and default values and read the [bindfs man page](http://bindfs.org/docs/bindfs.1.html) for full documentation.\n\nBoth long arguments and shorthand are supported.\nIf you set both, shorthand will prevail.\nLong arguments can be written indifferently with underscore ('force_user') or dash ('force-user') and as strings ('force-user') or symbols (:force_user or :'force-user').\n\nOption arguments values can be anything that can be casted to a string _via_ `to_s`.\nThe plugin will try to detect flag arguments values as true or false from common notations.  \n\nvagrant-bindfs detects installed version of bindfs, translates option names when needed and ignores an option if it is not supported.\nAs we may have missed something, it will warn you when a binding command fail.\n\nOn Debian (and Ubuntu), SUSE, Fedora, CentOS, Gentoo and OS X guest systems, vagrant-bindfs will try to install bindfs automatically if it is not installed.\nOn other system, you'll get warned.\n\nOS X guests may need some specific options. See [bindfs README](https://github.com/mpartel/bindfs#os-x-note) for details.\n\n## Configuration\n\nThis plugin supports the following configuration options:\n\n### `debug`\n\nSetting `config.bindfs.debug` to true will increase the verbosity level of this plugin in Vagrant output.\n\n### `default_options`\n\nYou can overwrite default bindfs options _via_ `config.bindfs.default_options=`.\n\n```ruby\nVagrant.configure(\"2\") do |config|\n\n  # These values are the default options \n  config.bindfs.default_options = {\n    force_user:   'vagrant',\n    force_group:  'vagrant',\n    perms:        'u=rwX:g=rD:o=rD'\n  }\n\nend\n```\n\n### `skip_validations`\n\nBy default, `vagrant-bindfs` will check if the user and the group set for a bound folder exists on the virtual machine.\nIf either one, the other or both of them are missing, it will warn you and not execute any bindfs command for this folder.\n\nTo skip these validations, you can add `:user` and/or `:group` to the `config.bindfs.skip_validations` array.\n\n\n```ruby\nVagrant.configure(\"2\") do |config|\n  \n  config.bindfs.skip_validations \u003c\u003c :user\n  \nend\n```\n\n### `bindfs_version` and `install_bindfs_from_source`\n\nBy default, if `bindfs` needs to be installed on the virtual machine, `vagrant-bindfs` will install the most recent release available in repositories (_via_ `homebrew` for OS X guests).\nIf no version of `bindfs` is found, it will try to install the most recent supported version of `bindfs` from source. (See [lib/vagrant-bindfs/bindfs.rb](https://github.com/gael-ian/vagrant-bindfs/blob/master/lib/vagrant-bindfs/bindfs.rb#L4) for the exact version number).\n\nYou can force the plugin to install the version of `bindfs` of your choice with the `bindfs_version` configuration option.\nIt will then look for the specified version in repositories and install it if available. If not, it will install it from sources.\n\nYou can also force installation from sources with the `install_bindfs_from_source` configuration option.\nThis will skip any repositories look up.\n\n```ruby\nVagrant.configure(\"2\") do |config|\n  \n  # This will force the plugin to install bindfs-1.12.2 from sources\n  config.bindfs.bindfs_version = \"1.12.2\"\n  config.bindfs.install_bindfs_from_source = true\n  \nend\n```\n\n**This feature only works with exact version match and does not try to resolve dependencies.**\nIn particular, Fuse will always be installed from the latest version available in repositories (_via_ Homebrew Cask for OS X guests).\n\n### `force_empty_mountpoints`\n\nBy default, `vagrant-bindfs` won't try to empty an existing mount point before mount. Hence, if you try to bind a folder to a non-empty directory without explicitly allowing Fuse to do so (with the `nonempty` Fuse option), mount will fail.\n\nYou can ask `vagrant-bindfs` to make sure the mount points are empty with the `config.bindfs.force_empty_mountpoints` option.\nMount poitns will then be destroyed (with `rm -rf`) prior to mount, unless you allow Fuse to not mind (with the `nonempty` Fuse option).\n\n\n```ruby\nVagrant.configure(\"2\") do |config|\n  \n  config.bindfs.force_empty_mountpoints = true\n  \n  # This exemple assume two directories exist in your VM:\n  # - `a/non/empty/mount/point/and/its/content`\n  # - `another/non/empty/mount/point/and/its/content` \n  \n  # `a/non/empty/mount/point` will be destroyed before mount and\n  #  all its content will be lost.\n  config.bindfs.bind_folder \"/vagrant\", \"a/non/empty/mount/point\"\n  \n  # `a/non/empty/mount/point` will not be destroyed before mount\n  # but its content will not be accessible while in use by bindfs.\n  config.bindfs.bind_folder \"/vagrant\", \"a/non/empty/mount/point\", o: :nonempty\n  \nend\n```\n\n## Contributing\n\nIf you find this plugin useful, we could use a few enhancements!\nIn particular, capabilities files for installing vagrant-bindfs on other systems would be useful.\nWe could also use some more specs…\n\n\n### How to Test Changes\n\nIf you've made changes to this plugin, you can easily test it locally in Vagrant.\n\nEdit `Vagrantfile` and uncomment one or more of the selected test boxes.\nThen, from the root of the repo, do:\n\n    bundle install\n    bundle exec vagrant up\n\nThis will spin up one or more VM and try to bindfs-mount some shares in it.\nFeel free to modify the included `Vagrantfile` or test helpers (in `test/test_helpers.rb`) to add additional boxes and test cases.\nIf you add a new test machine, please ensure that it will stay available and regularly updated for future tests.\nWe recommend to use [officialy supported boxes](https://goo.gl/LbkPVF). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgael-ian%2Fvagrant-bindfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgael-ian%2Fvagrant-bindfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgael-ian%2Fvagrant-bindfs/lists"}