From 000d4b0e6b14cc7ebcdaa691d2ae8070e0e51c69 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Wed, 19 Aug 2015 12:36:12 +0200
Subject: [PATCH 1/1] start VBoxClient inside virtualbox guest only
The guest additions can be installed on systems that do not necessarily
start as a virtualbox guest, for example (but not limited to) on live
media (bootable CD/USB, PXE, ...).
Check whether or not we can detect virtualization, exit gracefully if we
detect non virtualbox system.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
src/VBox/Additions/x11/Installer/98vboxadd-xclient | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/VBox/Additions/x11/Installer/98vboxadd-xclient b/src/VBox/Additions/x11/Installer/98vboxadd-xclient
index f0d4236..481d589 100755
|
a
|
b
|
|
| 15 | 15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. |
| 16 | 16 | # |
| 17 | 17 | |
| | 18 | # Check if systemd-detect-virt (from systemd) is available. |
| | 19 | if type systemd-detect-virt >/dev/null 2>/dev/null; then |
| | 20 | # Check if this is a virtualbox guest. Exit if it is not. |
| | 21 | if ! systemd-detect-virt | grep -q 'oracle'; then |
| | 22 | exit 0 |
| | 23 | fi |
| | 24 | fi |
| | 25 | |
| 18 | 26 | # Sanity check: if non-writeable PID-files are present in the user home |
| 19 | 27 | # directory VBoxClient will fail to start. |
| 20 | 28 | for i in $HOME/.vboxclient-*.pid; do |