Skip to content

Fix Ubuntu 24.04 shutdown hang with synced folders#13804

Merged
taru-garg-2000 merged 1 commit into
hashicorp:mainfrom
giner:stas/fix_shutdown_hang_2
May 30, 2026
Merged

Fix Ubuntu 24.04 shutdown hang with synced folders#13804
taru-garg-2000 merged 1 commit into
hashicorp:mainfrom
giner:stas/fix_shutdown_hang_2

Conversation

@giner

@giner giner commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Fix Ubuntu 24.04 shutdown hang by preventing vagrant from mounting already mounted synced folders. Fixes #13795.

Before:

vagrant ssh
mount | grep vagrant
vagrant on /vagrant type vboxsf (rw,nodev,relatime,iocharset=utf8,uid=1000,gid=1000)
vagrant on /vagrant type vboxsf (rw,nodev,relatime,iocharset=utf8,uid=1000,gid=1000,_netdev)
exit

time vagrant halt
==> default: Attempting graceful shutdown of VM...
==> default: Forcing shutdown of VM...

real	1m5.500s
user	0m3.900s
sys		0m4.279s

After:

vagrant ssh
mount | grep vagrant
vagrant on /vagrant type vboxsf (rw,nodev,relatime,iocharset=utf8,uid=1000,gid=1000,_netdev)
exit

time vagrant halt
==> default: Attempting graceful shutdown of VM...

real	0m5.210s
user	0m1.657s
sys		0m0.966s

@giner

giner commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

@taru-garg-hashicorp friendly ping

@giner

giner commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

@taru-garg-hashicorp would you take a look at this PR?

@taru-garg-2000

Copy link
Copy Markdown
Contributor

Hi @giner,
Apologies for the delay, will get back on this very soon.

@taru-garg-2000

Copy link
Copy Markdown
Contributor

Hi @giner ,

Not sure why the tests have not run, I tried looking around in github but couldn't find any re-trigger, wondering if you could do a push without any edits to trigger the tests

Thanks

Fix Ubuntu 24.04 shutdown hang by preventing vagrant from mounting
already mounted synced folders. Fixes hashicorp#13795.

Before:
```
vagrant ssh
mount | grep vagrant
vagrant on /vagrant type vboxsf (rw,nodev,relatime,iocharset=utf8,uid=1000,gid=1000)
vagrant on /vagrant type vboxsf (rw,nodev,relatime,iocharset=utf8,uid=1000,gid=1000,_netdev)
exit

time vagrant halt
==> default: Attempting graceful shutdown of VM...
==> default: Forcing shutdown of VM...

real	1m5.500s
user	0m3.900s
sys	0m4.279s
```

After:
```
vagrant ssh
mount | grep vagrant
vagrant on /vagrant type vboxsf (rw,nodev,relatime,iocharset=utf8,uid=1000,gid=1000,_netdev)
exit

time vagrant halt
==> default: Attempting graceful shutdown of VM...

real	0m5.210s
user	0m1.657s
sys	0m0.966s
```
@giner
giner force-pushed the stas/fix_shutdown_hang_2 branch from 1a8c8b5 to cf21f45 Compare May 29, 2026 12:48
@giner

giner commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

@taru-garg-hashicorp pushed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes duplicate VirtualBox synced-folder mounts on Linux guests by skipping mount attempts when the target guest path is already mounted, addressing Ubuntu 24.04 shutdown hangs caused by duplicate /vagrant mounts.

Changes:

  • Adds a Linux VirtualBox synced-folder mountpoint check before invoking mount.
  • Adds unit coverage for the already-mounted path.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb Skips mounting when the guest path is already a mountpoint.
test/unit/plugins/guests/linux/cap/mount_virtual_box_shared_folder_test.rb Verifies no mount command is run for an already-mounted guest path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@taru-garg-2000
taru-garg-2000 merged commit 7995fa4 into hashicorp:main May 30, 2026
10 checks passed
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ubuntu 24.04 hangs on shutdown when using VirtualBox synced folders

3 participants