mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-31 10:58:06 +08:00
在windows下识别更多虚拟机
This commit is contained in:
parent
09b3111d2b
commit
ef6c5f7aec
@ -92,9 +92,12 @@ add_community_repo_for_alpine() {
|
||||
|
||||
is_virt() {
|
||||
if is_in_windows; then
|
||||
vmstr='VMware|Virtual|BOCHS|QEMU'
|
||||
wmic ComputerSystem | grep -Eiw $vmstr && return 0
|
||||
wmic bios | grep -Eiw $vmstr && return 0
|
||||
# https://github.com/systemd/systemd/blob/main/src/basic/virt.c
|
||||
# https://sources.debian.org/src/hw-detect/1.159/hw-detect.finish-install.d/08hw-detect/
|
||||
vmstr='VMware|Virtual|Virtualization|VirtualBox|VMW|Hyper-V|Bochs|QEMU|KVM|OpenStack|KubeVirt|innotek|Xen|Parallels|BHYVE'
|
||||
for name in ComputerSystem BIOS BaseBoard; do
|
||||
wmic $name | grep -Eiw $vmstr && return 0
|
||||
done
|
||||
wmic /namespace:'\\root\cimv2' PATH Win32_Fan | head -1 | grep -q -v Name
|
||||
else
|
||||
if command -v systemd-detect-virt; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user