I have read several exactly same questions here, but still can not solve my problem. So I ask here again, hope someone can help:
Windows 10 host, Ubuntu 2020.04 guest
Once I run "vagrant reload", the sync folder got lost in the guest. Same as I reboot, sf also got lost
And here is config.yaml file
vagrantfile:
target: local
vm:
provider:
local:
box: bento/ubuntu-20.04
box_url: 'false'
box_version: '0'
chosen_virtualizer: virtualbox
virtualizers:
virtualbox:
modifyvm:
natdnshostresolver1: false
showgui: 0
vmware:
numvcpus: 1
parallels:
linked_clone: 0
check_guest_tools: 0
update_guest_tools: 0
machines:
machine1:
id: moon
hostname: moon
network:
private_network: 192.168.10.10
forwarded_port:
port1:
host: '8510'
guest: '22'
memory: '1536'
cpus: '1'
provision:
puppet:
manifests_path: puphpet/puppet/manifests
module_path:
- puphpet/puppet/modules
- puphpet/puppet/manifests
options:
- '--verbose'
- '--hiera_config /opt/puphpet/puppet/hiera.yaml'
synced_folder:
folder1:
owner: vagrant
group: vagrant
source: ./
target: /var/www
sync_type: default
smb:
smb_host: ''
smb_username: sidu
smb_password: ''
mount_options:
dir_mode: '0775'
file_mode: '0664'
rsync:
args:
- '--verbose'
- '--archive'
- '-z'
exclude:
- .vagrant/
- .git/
auto: 'true'
usable_port_range:
start: 10200
stop: 10500
Update #1
After so much pain, I now figured out how to fix. By downloading the latest Vagrant, the shared folders is back
Further thinking: it might be the reason that old vagrant does not support OpenSSH key
Update #2
After restart PC / OR / vagrant reload many times, works, BUT it lost again after many times later.
Thus found this: Vagrant was unable to mount VirtualBox shared folders
Now currently working as:
by nottherealironman
vagrant plugin install vagrant-vbguest
vagrant vbguest --status
vagrant ssh
sudo apt-get install virtualbox-guest-x11
exit
vagrant vbguest --do install
vagrant reload
Now everything back to normal, i will keep this updated after more testing later
Several days later confirmed above #2 works