-
Notifications
You must be signed in to change notification settings - Fork 3
/
20_software_rendering_in_vms.sh
executable file
·56 lines (48 loc) · 1.47 KB
/
20_software_rendering_in_vms.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
## Copyright (C) 2020 - 2023 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
## See the file COPYING for copying conditions.
if command -v systemd-detect-virt >/dev/null ; then
result="$(systemd-detect-virt 2>&1)"
## result example:
## oracle
else
echo "$0 ERROR: systemd-detect-virt not found. Stop."
return 0
exit 0
fi
if [ "$result" = "oracle" ]; then
software_rendering_use=true
fi
if [ "$result" = "kvm" ]; then
software_rendering_use=true
fi
if [ "$result" = "xen" ]; then
software_rendering_use=true
fi
if [ ! "$software_rendering_use" = "true" ]; then
true "$0 INFO: software_rendering_use is not set to true. Stop."
return 0
exit 0
fi
if [ ! "$QMLSCENE_DEVICE" = "" ]; then
true "$0 INFO: QMLSCENE_DEVICE is already set to '$QMLSCENE_DEVICE'. Not changing. Stop."
return 0
exit 0
fi
## useful for:
## - signal-desktop
## - maybe also wire-desktop?
##
## Automatic fallback to softwarecontext renderer
##
## Not great to set this unconditionally in VirtualBox but there is no known
## tool which can find out from inside the VM if VirtualBox 3D acceleration
## is enabled from inside the VM, see:
## Test command from inside VM to detect if VirtualBox 3D acceleration is enabled or disabled?
## https://forums.virtualbox.org/viewtopic.php?f=3&t=97983
##
## https://forums.whonix.org/t/video-editing-software-fails-to-launch-on-whonix-virtualbox-kvm/17241
## Causes issues for:
## - shotcut
## - kdenlive
export QMLSCENE_DEVICE=softwarecontext