summarylogtreecommitdiffstats
path: root/101-vboxsf-automount.patch
diff options
context:
space:
mode:
authorlilac2019-02-01 05:56:42 +0800
committerlilac2019-02-01 05:56:42 +0800
commit113c989abf002279fc1ea36ea352e1c0fa204805 (patch)
tree6aa128c128aacf822ad5a10e11ef3cf95334a095 /101-vboxsf-automount.patch
parent6b347de960abe483c79a124f4326b26ce92f0cb6 (diff)
downloadaur-113c989abf002279fc1ea36ea352e1c0fa204805.tar.gz
update by lilac
Diffstat (limited to '101-vboxsf-automount.patch')
-rw-r--r--101-vboxsf-automount.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/101-vboxsf-automount.patch b/101-vboxsf-automount.patch
new file mode 100644
index 000000000000..5c665e722c83
--- /dev/null
+++ b/101-vboxsf-automount.patch
@@ -0,0 +1,20 @@
+This ghetto patch attempts to fix shared folder automounting for guests running
+Linux 4.16, and also suggests an alternative to mount.vboxsf.
+
+diff -uprb VirtualBox-5.2.8.orig/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp VirtualBox-5.2.8/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
+--- VirtualBox-5.2.8.orig/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp 2018-02-26 17:57:30.000000000 +0200
++++ VirtualBox-5.2.8/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp 2018-04-07 21:00:05.785735622 +0300
+@@ -346,6 +346,13 @@ static int vbsvcAutoMountSharedFolder(co
+ "vboxsf",
+ fFlags,
+ &mntinf);
++ if (r == -1 && errno == EINVAL)
++ {
++ /* Mainline vboxsf accepts regular mount opts. */
++ char mount_opts[1024];
++ snprintf(mount_opts, 1024, "gid=%d,dmode=0770,fmode=0770", mntinf.gid);
++ r = mount(pszShareName, pszMountPoint, "vboxsf", fFlags, mount_opts);
++ }
+ if (r == 0)
+ {
+ VGSvcVerbose(0, "vbsvcAutoMountWorker: Shared folder '%s' was mounted to '%s'\n", pszShareName, pszMountPoint);