Score:1

`apt-get install` in guest unmounts all shared folders

ax flag

I am running in a weird situation after having upgraded to Virtualbox 7.0.8 yesterday, everything went fine for a while, but all of a sudden most of the time during provisioning shared folder mounts will disappear when executing an apt-get install. Sometimes when installing a first package already, sometimes only on the 2nd apt-get call, so it does not seem to be something that the packages themselves do.

The provisioning scripts have not changed in quite a while, and until today I never faced that problem. It did not happen on the first ca. 100 runs with the new Virtualbox version, only after that. Nothing else changed on the host machine in that time frame, and even after a host system reboot the same problem persists.

I have checked the systemd journal but no unmount log message or any other unusual thing can be seen at the time apt-get runs and the shared folders vanish. I also did a "strace -f" of the apt-get call, but nothing visible related to the shared folders either.

I also tried to increase the VM memory size, just in case and as I started to get desperate, but that did not make a difference either.

Pretty much lost at this point I am hoping for clues ...

Versions:

vagrant 2.3.4
virtualbox 7.0.8
host OS: Ubuntu 22.10
guest OS: Ubuntu 20.04
ckhan avatar
ph flag
What can you reliably reproduce? If you start from a state where the shared folders are present, capture the output of the `mount` command. You say "during provisioning" -- are you installing many packages with `apt-get install ...` ? If so: can you narrow it to a subset of packages that trigger the problem?
Hartmut Holzgraefe avatar
ax flag
@ckhan I did check with `mount | grep vboxsf` and found that the default `/vagrant` shared folder and the additional one I had on `/mnt` vanished on `apt-get mariadb-server mariadb-backup`. So I determined the list of packages, including dependencies, that got installed in that step and did install them one by one in a loop instead. `/vagrant` and `/mnt` mounts would silently vanish sometimes on 2nd loop iteration, sometimes on first alredy. Still present before `apt-get install`, gone right after. Nothing in syslog.
Hartmut Holzgraefe avatar
ax flag
After having reverted all of my debug output additions the original provisioning script now works fine again though, weirdly enough. Fingers crossed that it stays that way ...
Hartmut Holzgraefe avatar
ax flag
I actually even strace'd the apt-get calls, but no trace of any unmount action, or any other reference of the two shared folders, in there either :o
ckhan avatar
ph flag
Puzzling. I looked through the post-install script for mariadb-server, and while it does a lot of stuff, no mention of mount. Of course, as you note, it does a lot of other stuff, and pulls in many other deps. You have an strace that follows execs/forks _and_ it's from an instance of the mount disappearing?
Hartmut Holzgraefe avatar
ax flag
it is even stranger: it is not deterministic on the same package. And it has returned again ... I'm setting up a fresh new host machine right now to have a more clean test setup, lets see how that goes. And no, I did not preserve the strace logs, but there was definitely nothing that looked even remotely related to the two mount point paths or mount/unmount related system calls in general ... :o
ckhan avatar
ph flag
Can you wrap your whole process in script that calls `mount`, `strace -f` 's the whole show, and concludes with another `mount`? Also: what does `dmesg` say, can you see something explicitly unmounting your shares?
Hartmut Holzgraefe avatar
ax flag
Will do as soon as I have the new laptop ready with a clean setup, may not get to that before Monday though
Hartmut Holzgraefe avatar
ax flag
I have now tracked it down to the vagrant-vbguest plugin rebuilding the virtualbox kernel modules. Virtualbox is version 7.0.8, the guest additions in the ubuntu/focal64 base box I'm starting with are from 6.1.38 ...
Hartmut Holzgraefe avatar
ax flag
So `config.vbguest.auto_update = false` did the trick for now. It had worked fine in the past though, and AFAIR even with Virtualbox 7.0.4; trouble only started with 7.0.8, and even with that not right away on my work laptop, only after already having created over 100 VMs ... Now on the new machine it failed right away though. I'll now re-build the new host machine from scratch twice more, to test with Virtualbox 7.0.4 and 7.0.6 from a clean state
ckhan avatar
ph flag
Good sleuthing! Sure enough, there's a `umount -a -t vboxsf` in vagrant-vbguest : https://github.com/dotless-de/vagrant-vbguest/blob/main/lib/vagrant-vbguest/installers/ubuntu.rb#L37
ckhan avatar
ph flag
So the open questions are : 1) why did it start now? and 2) why the non-determinism?. Re #2: were any of the install or provisioning scripts running in parallel?
Hartmut Holzgraefe avatar
ax flag
The umount in vbguest should not matter though, for two reasons: #1 after rebuilding the guest additons vbguests initiates a VM reboot, so shared folders get remounted #2 I actually create VMs in two steps, first step takes the upstream Ubuntu base box, and installs packages and own scripts needed by each MariaDB release specific VM box I'm going to build later. This is where vbguest kicks in, too. 2nd step then starts with this new base box, sets up the correct MariaDB release repo URLs, installs MariaDB server, and some initial test databases form dumps in shared folders.
Hartmut Holzgraefe avatar
ax flag
So even when disabling vbguest plugin in the instances installing MariaDB, but only having it active when building the modified OS base box in the first step, it still fails. And it only started to fail recently, I've been using the same setup for over a year now, and never had this specific problem with VirtualBox 6.x. The weird part is that it worked with 7.0.8 for a day or so, too, building over 100 MariaDB 10.x.y release specific boxes, and only then started to fail; but now even on a fresh host machine fails instantly ...
Hartmut Holzgraefe avatar
ax flag
Maybe some weird interaction between 7.0.x guest addition code for vboxsf and some recent host kernel change? Anyway, we can probably consider this solved here, I'll now try to create a useful bug report for the VirtualBox bug tracker from this ...
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.