better WSLg detection, still extremely slow
If you're using WSLg, consider using KVM instead of VirtualBox
This commit is contained in:
+20
-17
@@ -2,7 +2,7 @@
|
|||||||
# Push-button installer of macOS on VirtualBox
|
# Push-button installer of macOS on VirtualBox
|
||||||
# (c) myspaghetti, licensed under GPL2.0 or higher
|
# (c) myspaghetti, licensed under GPL2.0 or higher
|
||||||
# url: https://github.com/myspaghetti/macos-virtualbox
|
# url: https://github.com/myspaghetti/macos-virtualbox
|
||||||
# version 0.99.1.1
|
# version 0.99.1.2
|
||||||
|
|
||||||
# Dependencies: bash coreutils gzip unzip wget xxd dmg2img
|
# Dependencies: bash coreutils gzip unzip wget xxd dmg2img
|
||||||
# Optional features: tesseract-ocr tesseract-ocr-eng
|
# Optional features: tesseract-ocr tesseract-ocr-eng
|
||||||
@@ -280,6 +280,21 @@ if [[ -n "$(cygcheck -V 2>/dev/null)" ]]; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
# Windows Subsystem for Linux 2 (WSL2 or WSLg)
|
||||||
|
elif [[ "$(cat /proc/sys/kernel/osrelease 2>/dev/null)" =~ WSL[2Gg] ]]; then # WSL2 or WSLg
|
||||||
|
if [[ -n "$(VBoxManage -v 2>/dev/null)" ]]; then
|
||||||
|
if [[ ! "$(lsmod)" =~ vboxdrv ]]; then # if the vboxdrv kernel module is not present
|
||||||
|
echo "The script appears to be executed on WSL2 or WSLg."
|
||||||
|
echo "Mind that WSL2 and WSLg require kernel module compilation and"
|
||||||
|
echo "custom configuration that is not supported by the script."
|
||||||
|
echo "If the script does not detect the ${highlight_color}vboxdrv${default_color} kernel module, it exits."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Please make sure VirtualBox version 5.2 or higher is installed,"
|
||||||
|
echo "and that the path to the VBoxManage executable is in the PATH variable."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
# Windows Subsystem for Linux (WSL "1")
|
# Windows Subsystem for Linux (WSL "1")
|
||||||
elif [[ "$(cat /proc/sys/kernel/osrelease 2>/dev/null)" =~ [Mm]icrosoft ]]; then
|
elif [[ "$(cat /proc/sys/kernel/osrelease 2>/dev/null)" =~ [Mm]icrosoft ]]; then
|
||||||
if [[ -n "$(VBoxManage.exe -v 2>/dev/null)" ]]; then
|
if [[ -n "$(VBoxManage.exe -v 2>/dev/null)" ]]; then
|
||||||
@@ -297,22 +312,10 @@ elif [[ "$(cat /proc/sys/kernel/osrelease 2>/dev/null)" =~ [Mm]icrosoft ]]; then
|
|||||||
}
|
}
|
||||||
echo "Found VBoxManage"
|
echo "Found VBoxManage"
|
||||||
else
|
else
|
||||||
if [[ "$(cat /proc/sys/kernel/osrelease 2>/dev/null)" =~ WSL[2Gg] ]]; then # WSL2 or WSLg
|
echo "Please make sure VirtualBox is installed on Windows, and that the path to the"
|
||||||
if [[ -n "$(VBoxManage -v 2>/dev/null)" ]]; then
|
echo "VBoxManage.exe executable is in the PATH variable, or assigned in the script"
|
||||||
true # do nothing
|
echo -e "to the variable \"${highlight_color}wsl_path_VBoxManage${default_color}\" including the name of the executable."
|
||||||
else
|
exit
|
||||||
echo "Please make sure VirtualBox version 5.2 or higher is installed,"
|
|
||||||
echo "and that the path to the VBoxManage executable is in the PATH variable."
|
|
||||||
echo "Mind that WSL2 and WSLg require kernel module compilation and custom"
|
|
||||||
echo "configuration that is not supported by the script."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Please make sure VirtualBox is installed on Windows, and that the path to the"
|
|
||||||
echo "VBoxManage.exe executable is in the PATH variable, or assigned in the script"
|
|
||||||
echo -e "to the variable \"${highlight_color}wsl_path_VBoxManage${default_color}\" including the name of the executable."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# everything else (not cygwin and not wsl)
|
# everything else (not cygwin and not wsl)
|
||||||
|
|||||||
Reference in New Issue
Block a user