VirtualBox

Opened 6 years ago

Last modified 6 years ago

#17639 new defect

synced folder not working (Ubuntu 16.04 hosting debian/stretch64 9.4.0 )

Reported by: axd Owned by:
Component: guest additions Version: VirtualBox 5.2.8
Keywords: Cc:
Guest type: Linux Host type: Linux

Description

When setting up a VM via Vagrant 2.0.1 using VirtualBox 5.2.8 and guest additions 5.2.8, touching a file in the default synced folder /vagrant does not make that file appear on the host side.

a similar test works fine for a guest of type "ubuntu/xenial64 v20180215.0.0".

how to reproduce: create following Vagrantfile (also attached):

Vagrant.configure("2") do |config|

      config.vm.box = "debian/stretch64" # or generic/debian9
      config.vm.box_version = "9.4.0"
      config.ssh.insert_key = false

      config.vm.network "private_network", ip: "192.168.33.10"
end

and the run following script from the hos:

#!/usr/bin/env bash

# to run from tools/vagrant/

set -x
set -e
set -u

GUEST=${1:-"default"} #$1    # name from `vagrant status`

export VERSION=5.2.8   # must be equal to the VirtualBox version!
export URL="http://download.virtualbox.org/virtualbox/"$VERSION"/VBoxGuestAdditions_"$VERSION".iso"

time vagrant ssh $GUEST << HERE

set -e
set -x

sudo bash

apt-get update

apt-get install -y dkms build-essential

apt-get install -y linux-headers-amd64 linux-headers-4.9.0-4-amd64

apt-get install -y module-assistant

cd /opt/

wget -c $URL -O vb.iso
mount vb.iso -o loop /mnt

cd /mnt/
sh ./VBoxLinuxAdditions.run --nox11

cd /opt
sudo rm *.iso

lsmod | grep vboxguest || echo "*** something went wrong while attempting to install the guest additions"

HERE


touch a file in /vagrant

observe that the file does not appear in the host location.

Attachments (2)

Vagrantfile (1.1 KB ) - added by axd 6 years ago.
install_guest_additions.sh (829 bytes ) - added by axd 6 years ago.

Download all attachments as: .zip

Change History (4)

by axd, 6 years ago

Attachment: Vagrantfile added

by axd, 6 years ago

Attachment: install_guest_additions.sh added

comment:1 by axd, 6 years ago

problematic when running with the latest "debian/stretch64" and with or without specifying "box_version = "9.4.0""; logging in on such boxes gives

Linux node 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64

but we made an earlier custom box that was based on a (then latest) "debian/stretch64" (without specifying a version) but where syncing works; that box reports

Linux node 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3 (2017-12-03) x86_64

it looks like 4.9.82-1+deb9u3 is the culprit?

trying 9.3.0 or 9.2.0 (from https://app.vagrantup.com/debian/boxes/stretch64) does not solve the problem either

this is smelling like an issue with guest additions 5.2.8? I didn't attempt to install those versions, sorry...

Note that the shared directory does contain files from the host, but adding files does not seem to work.

Last edited 6 years ago by axd (previous) (diff)

comment:2 by axd, 6 years ago

related: when attempting to build a VM that included extra synced directories (defined in Vagrantfile), I get:

Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=1000,gid=1000 home_vagrant_lynx /home/vagrant/lynx

The error output from the command was:

mount: unknown filesystem type 'vboxsf'

this is due to Guest Additions not having been added.

the workaround seems to be to

  1. disable the extra synced folders (in Vagrantfile)
  2. apply the guest additions
  3. re-enable the extra synced folders
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use