Menu="OtherSettings" Title="VM Manager" Icon="icon-virtualization" Tag="columns" --- require_once "$docroot/plugins/dynamix.vm.manager/include/libvirt_helpers.php"; // Check for Intel VT-x (vmx) or AMD-V (svm) cpu virtualization support // If either kvm_intel or kvm_amd are loaded then Intel VT-x (vmx) or AMD-V (svm) cpu virtualization support was found $hardware = !empty(shell_exec("/etc/rc.d/rc.libvirt test")); if (!$hardware) { echo "
"._('Your hardware does not have Intel VT-x or AMD-V capability').". "._('This is required to create VMs in KVM').". "._('Please disable the VM function').". "; echo " "._('Click here to see the Unraid Wiki for more information')."
"; } function scan($area, $text) { return strpos($area,$text)!==false; } function detect(&$syslinux, $key) { $size = count($syslinux); $menu = $i = 0; $value = ''; // find the default section while ($i < $size) { if (scan($syslinux[$i],'label ')) { $n = $i + 1; // find the current requested setting while (!scan($syslinux[$n],'label ') && $n < $size) { if (scan($syslinux[$n],'menu default')) $menu = 1; if (scan($syslinux[$n],'append')) foreach (explode(' ',$syslinux[$n]) as $cmd) if (scan($cmd,$key)) {$value = explode('=',$cmd)[1]; break;} $n++; } if ($menu) break; else $i = $n - 1; } $i++; } return $value; } $syslinux = file('/boot/syslinux/syslinux.cfg',FILE_IGNORE_NEW_LINES+FILE_SKIP_EMPTY_LINES); $arrValidNetworks = getValidNetworks(); $pcie_acs_override = detect($syslinux, 'pcie_acs_override'); $vfio_allow_unsafe = detect($syslinux, 'allow_unsafe_interrupts'); $bgcolor = strstr('white,azure',$display['theme']) ? '#f2f2f2' : '#1c1c1c'; $started = $var['fsState']=='Started'; $libvirt_up = $libvirt_running=='yes'; $libvirt_log = file_exists("/var/log/libvirt/libvirtd.log"); ?> :vms_libvirt_log_help:".shell_exec("btrfs filesystem show /etc/libvirt").""?>