vagrant
vagrant copied to clipboard
Vagrant is mounting synced folder(s) twice in a Windows 10 Host/Ubuntu Guest
Vagrant version
Vagrant 2.2.19
Host operating system
Windows 10 Version 1607
Guest operating system
Ubuntu MATE 22.04 5.15.0-33-generic
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
config.vm.box = "vagrant-ubuntu-mate-gui"
# Configure Synced Folders.
config.vm.synced_folder "C:\\SharedProjects", "/home/vagrant/SharedProjects"
config.vm.synced_folder "C:\\Users\\bargerhuff\\Downloads", "/home/vagrant/Downloads"
config.vm.synced_folder "C:\\", "/home/vagrant/C"
config.vm.synced_folder "C:\\Vagrant\\Provisioning", "/home/vagrant/Provisioning"
# Provider-specific configuration.
config.vm.provider "virtualbox" do |vb|
vb.name = "RO Ubuntu MATE Development Environment"
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Customize the VM:
vb.memory = "12288"
vb.customize ["modifyvm", :id, "--memory", "12288"]
vb.customize ["modifyvm", :id, "--vram", "128"]
vb.customize ["modifyvm", :id, "--graphicscontroller", "vmsvga"]
end
end
Expected behavior
4 Synced Folders mounted with each subsequent reload.
Actual behavior
When I first raise this box up using vagrant up ... the synced folders are not duplicated. However, when I issue vagrant reload or vagrant up , the synced folders are duplicated.
Vagrant is mounting the Synced Folders even though they are already mounted. I can visually see this happening because the 4 Mounted Volumes are on the Ubuntu MATE desktop and then as Vagrant is executing and bringing the machine up, when it gets to the Synced Folders you can watch each Synced Folder mounted again causing duplicates.
grep 'Mount' /var/log/syslog*
May 27 14:22:20 localhost systemd[1]: Mounting /home/vagrant/C...
May 27 14:22:20 localhost systemd[1]: Mounting /home/vagrant/Downloads...
May 27 14:22:20 localhost systemd[1]: Mounting /home/vagrant/Provisioning...
May 27 14:22:20 localhost systemd[1]: Mounting /home/vagrant/SharedProjects...
May 27 14:22:20 localhost systemd[1]: Mounting /vagrant...
May 27 14:22:20 localhost systemd[1]: Mounted /home/vagrant/C.
May 27 14:22:20 localhost systemd[1]: Mounted /home/vagrant/Downloads.
May 27 14:22:20 localhost systemd[1]: Mounted /home/vagrant/Provisioning.
May 27 14:22:20 localhost systemd[1]: Mounted /home/vagrant/SharedProjects.
May 27 14:22:20 localhost systemd[1]: Mounted /vagrant.
Looking at Shared Folders for the Machine in VirtualBox, I see the following:
C:
\?\C:\Users\bargerhuff\Downloads
\?\C:\Vagrant\Provisioning
\?\C:\SharedProjects
\?\C:\Vagrant\X11
If I use VirtualBox to launch the machine and manually set up the "Shared" folders, it works correctly after subsequent restarts.
Things to note, in the event the Guest OS enters an unknown state, the duplication does not occur.
Though I am highly technical, I do not have the capacity or knowledge to troubleshoot this issue further at this current time. I simply do not know where to start.
Steps to reproduce
I am not able to provide steps at this time.
References
https://github.com/hashicorp/vagrant/issues/5023
Is it possible to get some eyes on this?
Hi there,
Would you please provide a gist of the debug output from running a vagrant up where you encounter this issue? Also, how are you determining that the folders are being mounted twice?
Thanks!
Hi there,
Would you please provide a gist of the debug output from running a
vagrant upwhere you encounter this issue? Also, how are you determining that the folders are being mounted twice?Thanks!
My apologies for the late reply as I was away form the office last week.
I am having many problems trying to get the information you requested. I am running Ubuntu Mate 22.04 and the duplicate clone mounting would occur when the vagrant reload was used.
This morning, vagrant reload is not working and the virtual machine is not reloading (rebooting) and instead freezing. I have have been having an issue with vagrant reload ever since moving to Ubuntu Mate 22.04 and I have stopped using Vagrant because of it.
How I confirmed that the shared folders were being mounted twice was in the log that I posted in the OP and a visual confirmation when looking at the desktop of the Virtual machine and seeing the duplicate mounted volumes.
Also, when unmounting the shared volume, having to repeat the unmount command twice for the same volume.
Hi there,
Thanks for reporting this bug. There have been multiple Vagrant releases since the original report, we recommend upgrading. I'm going to close this issue now and request you reopen the issue if you're still experiencing this problem.
Cheers!