Vagrant 1.8.1
vagrant-vbguest (0.11.0)
VirtualBox and GuestAdditions 5.0.16
Mac OSX 10.8.5
Debian Jessie 64 bit
Vagrant.configure(2) do |config|
config.vm.box = "debian/jessie64"
end
https://gist.github.com/DanLipsitt/0958e39b3bf74b62d565
I expect to see /vagrant
mounted in the guest.
Instead there is no mount, and rsync runs.
15:29:51 [:/tmp/vagrant-sync-test] 4s $ vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'debian/jessie64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
GuestAdditions 5.0.16 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Rsyncing folder: /private/tmp/vagrant-sync-test/ => /vagrant
$ vagrant ssh -- mount | grep -c vagrant
0
Some VirtualBox kernel modules are loaded. I don't know if this is all of them:
$ vagrant ssh -- lsmod | grep vb
vboxsf 41462 0
vboxvideo 12437 0
drm 249955 2 vboxvideo
vboxguest 213005 2 vboxsf
vagrant up
vagrant ssh -- mount | grep vagrant
should list an active mount but doesn'tHi @DanLipsitt
There are a number of closed issues relating to the debian box. It looks like, at some point, the maintainers removed some core packages that are required for vbox guest additions. Instead, you have to use the debian-contrib packages. Could you try to use one of the boxes under the bento
namespace and see if the issue persists? Thanks! :smile:
OK, I was able to confirm that the regular debian/jessie64
doesn't include the VirtualBox Guest Additions by default, and this is intentional because of licensing issues. This is sort of mentioned in passing on the debian atlas page, but I didn't see it at first because that page is not linked to from the page for the debian/jessie64
box.
The debian/contrib-jessie64
box does work with synced folders. I didn't try the bento
version because it is behind the debian
one and is less official.
@sethvargo, do you know what packages are missing to support vbguest
? I looked through the packer scripts used to build the debian images and couldn't see anything obvious. The fact that syncing doesn't work even with the vbguest plugin makes me think there might still be a bug on the vagrant side.
@DanLipsitt I don't know off the top of my head, but there's a closed Vagrant thread where someone mentioned it included non-standard packages and therefore was removed from the "regular" box at some point.
It's not possible for syncing to work without the guest additions (unless you use something like rsync).
I know that sync won't work without guest additions, what's strange is when it doesn't work _with_ them.
Hi @DanLipsitt
I'm confused. I thought you said debian/contrib-jessie64
did work for you? Maybe I'm misreading? Could you please clarify your last comment? Thanks!
Sorry, yes, debian/contrib-jessie64
does work. What doesn't work is debian/jessie64
with guest additions added by the vbguest
plugin.
I have a way to use guest additions shared folders. Now I'm just trying to smooth the way for those who come after me (this all took me the better part of a day to figure out). After browsing github tickets and other info such as Stack Overflow, I see that the vbguest
plugin is often the suggested solution to problems with guest additions sync mounts. It appears that it doesn't work with the standard debian/jessie64
image, and I wonder if that is due to a bug in Vagrant.
Hi @DanLipsitt
I'm not familiar with the vbguest plugin (that's a third-party plugin that we do not maintain), but this is not a bug in Vagrant. Vagrant requires the guest additions to use synced folders, and this is very clearly discussed in the box-building documentation :smile:
All the vbguest plugin does is install the guest additions. If you follow my steps to reproduce with vbguest installed, you will get a system that a) has the guest additions installed and b) doesn't have synced folders. That's why I think it might be a bug in Vagrant.
I have the same issue that bothers me. I took debian/jessie64
box and installed guest additions manually, but mounting sync folder still broken.
I've installed the guest additions as some of you suggested but Vagrant still preferred to use rsync after that. It stopped using it only after i've added this line to the config file:
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
using type: "virtualbox"
as @thabiger worked for me 😃
Thanks for the help @thabiger. @mitchellh should this be considered a bug? It appears to be undocumented behavior and is contrary to what I'm reading here. I think this is because I have rsync
installed, however, I didn't configure this to use rsync
.
This suggests that now I need to either:
rsync
(or remove it from my PATH
), orVagrantfile
's now that I have to be explicit.Was this a regression? I'm on Windows, but never noticed this happening on a Mac.
Yeah this is confusing, im on El Capitan 10.11.6 (15G1108) the latest Vagrant 1.9.1 and Virtualbox Version 5.1.10 r112026 (Qt5.6.2) are not working out of the box.
I tried the nfs options for about 30 minutes with everything from everywhere on the net and nothing works. It seems like the default is now rsync which doesnt update either file system when a change is made, but using the above:
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
Works flawlessly. Thank you! :)
Feels like that should be the default since it works.
I ran into this issue as well. Seems to me using type: "virtualbox"
could be documented better at https://www.vagrantup.com/docs/synced-folders/virtualbox.html as it isn't mentioned there.
I landed on this trying to figure out why my Fedora 27 Cloud Base vagrant box was refusing to mount the folder (instead of syncing like it does without additions) even after very explicitly installing the VirtualBox guest additions and seeing the "no additions installed" message go away.
Adding this to my Vagrantfile fixed it for me too:
config.vm.synced_folder` ".", "/vagrant", type: "virtualbox"
When I did vagrant up
with the box centos/7 (virtualbox, 1703.01)
, ==> default: Rsyncing folder: /root/ => /vagrant
was stuck for me too, and adding
config.vm.synced_folder '.', '/vagrant', disabled: true
in Vagrantfile resolved the issue for me and rsync did not happen.
Here's the key thing that's not clicking for me:
By default, Vagrant will share your project directory (the directory with the Vagrantfile) to
/vagrant
.
and
If you are using the Vagrant VirtualBox provider, then VirtualBox shared folders are the default synced folder type.
What's confusing me is, when I didn't add anything to my Vagrantfile, I got the default directory via rsync. When I added config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
, it worked, and I got a shared folder instead of rsync.
So, should "the default synced folder type" apply to the "default [...] share[d ...] directory"? If not, I think the documentation should call this out.
I ran into this same issue today and solved it in the way described by @thabiger above. Perhaps the Vagrant VirtualBox doc page should be updated?
it doesnt work, I tried all the options mentioned above with latest trusty64 and stretch64.
The centos/7 box doesn't include guest additions (required for virtualbox shared folders) so it configures the default share to use rsync. They say in their docs that you should manually override this if you want to use virtualbox shared folders: https://blog.centos.org/2018/05/updated-centos-vagrant-images-available-v1804-02/
Perhaps this explains the behavior for some of the others too?
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.
Most helpful comment
I've installed the guest additions as some of you suggested but Vagrant still preferred to use rsync after that. It stopped using it only after i've added this line to the config file:
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"