Sha256: 43dfbeaf81a72a6c791bbb73fa421a189aa9fe48b5f25a10766a61f579b1b78b

Contents?: true

Size: 1.31 KB

Versions: 5

Compression:

Stored size: 1.31 KB

Contents

---
page_title: "Basic Usage - Synced Folders"
sidebar_current: "syncedfolder-basic"
---

# Basic Usage

## Configuration

Synced folders are configured within your Vagrantfile using the
`config.vm.synced_folder` method. Usage of the configuration directive
is very simple:

```ruby
Vagrant.configure("2") do |config|
  # other config here

  config.vm.synced_folder "src/", "/srv/website"
end
```

The first parameter is a path to a directory on the host machine. If
the path is relative, it is relative to the project root. The second
parameter must be an absolute path of where to share the folder within
the guest machine. This folder will be created (recursively, if it must)
if it doesn't exist.

## Enabling

Synced folders are automatically setup during `vagrant up` and
`vagrant reload`.

## Disabling

Shared folders can be disabled by adding the `disabled` option to
any definition:

```ruby
Vagrant.configure("2") do |config|
  config.vm.synced_folder "src/", "/srv/website", disabled: true
end
```

## Modifying the Owner/Group

By default, Vagrant mounts the synced folders with the owner/group set
to the SSH user. Sometimes it is preferable to mount folders with a different
owner and group. It is possible to set these options:

```ruby
config.vm.synced_folder "src/", "/srv/website",
  owner: "root", group: "root"
```

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/website/docs/source/v2/synced-folders/basic_usage.html.md
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/website/docs/source/v2/synced-folders/basic_usage.html.md
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/website/docs/source/v2/synced-folders/basic_usage.html.md
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/website/docs/source/v2/synced-folders/basic_usage.html.md
tnargav-1.3.3 website/docs/source/v2/synced-folders/basic_usage.html.md