summaryrefslogtreecommitdiffstats
path: root/debian/patches/37-do-not-run-if-not-in-vm.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:17:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:17:34 +0000
commit8784fb72e8eee3d983d30ac46e0ec3709d4f0ab0 (patch)
tree041e487e60a900d7d85f57307892acb586640822 /debian/patches/37-do-not-run-if-not-in-vm.patch
parentAdding upstream version 7.0.14-dfsg. (diff)
downloadvirtualbox-8784fb72e8eee3d983d30ac46e0ec3709d4f0ab0.tar.xz
virtualbox-8784fb72e8eee3d983d30ac46e0ec3709d4f0ab0.zip
Adding debian version 7.0.14-dfsg-4.debian/7.0.14-dfsg-4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/37-do-not-run-if-not-in-vm.patch')
-rw-r--r--debian/patches/37-do-not-run-if-not-in-vm.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/debian/patches/37-do-not-run-if-not-in-vm.patch b/debian/patches/37-do-not-run-if-not-in-vm.patch
new file mode 100644
index 00000000..9ae3fcd5
--- /dev/null
+++ b/debian/patches/37-do-not-run-if-not-in-vm.patch
@@ -0,0 +1,29 @@
+Description: Check if we are running in a virtual machine before wasting time
+running virtualbox guest things
+Author: Kevin Puetz (puetzk)
+
+Origin: https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1762491/comments/9
+Last-Update: 2018-07-19
+
+Index: virtualbox/src/VBox/Additions/x11/Installer/98vboxadd-xclient
+===================================================================
+--- virtualbox.orig/src/VBox/Additions/x11/Installer/98vboxadd-xclient
++++ virtualbox/src/VBox/Additions/x11/Installer/98vboxadd-xclient
+@@ -25,6 +25,17 @@
+ # SPDX-License-Identifier: GPL-3.0-only
+ #
+
++in_virtual_machine()
++{
++ if [ -z "$(lspci -d 80ee:cafe)" ]; then
++ echo "VirtualBox Additions disabled, not in a Virtual Machine" >&2
++ return 1
++ fi
++
++ return 0
++}
++in_virtual_machine || return
++
+ # Sanity check: if non-writeable PID-files are present in the user home
+ # directory VBoxClient will fail to start.
+ for i in $HOME/.vboxclient-*.pid; do