-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to configure vagrant so that it doesn't try to create shared folders #1004
Comments
+1 |
Vagrant.actions[:start].delete(Vagrant::Action::VM::ShareFolders) |
Hi Andrew, can you elaborate where to put this line? Michael On 8/7/2012 2:06 PM, W. Andrew Loe III wrote:
Michael Atighetchi |
Pretty much anywhere? I put it above my config block: # Remove Shared Folders, we're not using them and do not have the Virtualbox
# Tools.
Vagrant.actions[:start].delete(Vagrant::Action::VM::ShareFolders)
Vagrant::Config.run do |config|
end |
I just wanted to chime in and add a +1 for this feature. For me this is really useful for VMs I use to test development builds of the Linux kernel. If I don't disable shared folders then "vagrant up" fails at the shared folder stage, and none of my provisioning runs. As a workaround, adding the line loe mentioned above to my Vagrantfile works well, but I worry slightly that it's poking at Vagrant's internals and that as such it might well stop working in the future. I'd really like to see an "official" way of disabling shared folders, even if it were just a matter of documenting the workaround. |
+1 for this feature |
It appears this no longer works in v1.1.0. Does anyone have any recommendations for 1.1.0? |
If you're using VMware Fusion you can actually disable the shared folders: config.vm.synced_folder ".". "/vagrant", id: "vagrant-root", disabled: true Core doesn't yet have this feature but I will add it soon. |
Actually already committed and added. This will be part of 1.2. It already works with VMware, for now, though. |
I've been able to disable the auto mounting of /vagrant by using this specific line:
You may want to give this workaround try to see if it solves your problems until 1.2 is released. |
@swieton For v 1.x of vagrant your command won't work - I used this to disabled shared folders successfully on virtualbox:
|
I'm running Vagrant version 1.1.5 with VirtualBox, and I tried the following things in my Vagrantfile: config.vm.synced_folder ".", nil, :disabled => true, :id => "vagrant-root" config.vm.share_folder "vagrant-root", nil, ".", guestpath: nil and has anyone got anything else I can try? |
@kirmn The first one is fine, but you ran it in an old V1 configuratin block. Run it in a V2 block. |
thanks for pointing that out @mitchellh. when i switched from so i tried: this would be a lot easier if it were pointing to lines in my file |
@swieton's and @petecheslock's solutions didn't work for me. What works for me on Vagrant 1.2.2 with VirtualBox 4.2.14 is the following:
So @mitchellh's solution works, unsurprisingly, I guess I was thrown off by the VMware reference. (The Thanks to tscanausa and UForgotten for their help with figuring this one out. @mitchellh: I think it would be good if one of the doc pages around http://docs.vagrantup.com/v2/synced-folders/index.html could mention this so people don't have to dive into github tickets to figure this one out. |
Hello, The following correctly prevents the sharing of the vagrant folder: config.vm.synced_folder ".", "/vagrant", :disabled => true However, the following folder is still shared: /tmp/vagrant-chef-1/chef-solo-1/cookbooks. Is there any way to disable this? I am using Vagrant 1.3.3. Thanks! |
I believe that the solution to that is to not use chef. Vagrant runs chef_solo on the box, so it needs to have the cookbooks available to it, so it uses a synced folder to make that happen. |
This caused a great deal of confusion e.g. as seen in hashicorp#1004
This caused a great deal of confusion e.g. as seen in hashicorp#1004
Is there a possible regression!? It no longer disables shared folders although the following config is set:
|
I'm seeing the same issue with Vagrant 1.7.2 and VirtualBox
|
+1 |
I seem to only have problems with synced folders after my initial build and boot. Since they aren't really supported/useful for cloud environments (e.g., aws, digital ocean), I don't really want/need them locally. I do, however, need my vagrant folder itself to sync to /vagrant, but it can happen using rsync, as happens for the cloud. Is there a clean way to disable synced/shared/mounted /vagrant folder but continue to be able to rsync its contents once on build? I'm running the latest vagrant and vbox. Thanks! |
When I did |
Sorry for bumping this thread once again. This fix (adding |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
The shared folders are creating issues with my VMs right now, most likely because I don't have VirtualBox tools installed.
However, I don't really need shared folders, so ideally would like to disable that feature for my VMs.
Is there a way to disable shared folders in Vagrantfile?
Here is the error I'm getting:
{{{
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -t vboxsf -o uid=
id -u proxyuser
,gid=id -g proxyuser
v-root /vagrant}}}
The text was updated successfully, but these errors were encountered: