Is there an interface to get information whether a VM runs with HW-Virtualization (blue "V" in status bar") or in NEM mode ("green turtle with V" in status bar)?
I run VirtualBox VMs in headless mode and therefore I need a possibility to detect that mode, eg. by means of VBoxManage.exe.
Interface to get info if VM runs with HW-Virtualization or in NEM mode
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Interface to get info if VM runs with HW-Virtualization or in NEM mode
This is a really good question! The only method I know of is to read through the VM's log for a line containing these words:
Attempting fall back to NEM
These words show up within a few seconds of the VM starting. If they are present, the green turtle is showing. Notepad is able to open a VM log while the VM is running, but VBscript cannot. Other programming languages might be able to.
Also possibly check these lines in vboxmanage showvminfo "VM name"
Attempting fall back to NEM
These words show up within a few seconds of the VM starting. If they are present, the green turtle is showing. Notepad is able to open a VM log while the VM is running, but VBscript cannot. Other programming languages might be able to.
Also possibly check these lines in vboxmanage showvminfo "VM name"
I don't know what they might read on a green turtle host, but they're all 'enabled' on a blue V host.Hardware Virtualization:
VT-x VPID:
VT-x Unrestricted Exec.:
Re: Interface to get info if VM runs with HW-Virtualization or in NEM mode
Yes, I know that VBox.log file contains some extra output ("Attempting fall back to NEM") in case of "green-turtle" mode. But I would like to avoid parsing the VBox.log file for that information.
Now I also checked the output of vboxmanage showvminfo "VM name" command. Unfortunately there is no difference in command output in case of "green-turtle" mode, it also contains:
VT-x VPID: enabled
VT-x Unrestricted Exec.: enabled
Now I also checked the output of vboxmanage showvminfo "VM name" command. Unfortunately there is no difference in command output in case of "green-turtle" mode, it also contains:
VT-x VPID: enabled
VT-x Unrestricted Exec.: enabled
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Interface to get info if VM runs with HW-Virtualization or in NEM mode
FWIW, parsing the vbox.log file is not hard
basic pseudocode:
or
DOS batch file:
BTW, regarding this:
basic pseudocode:
Code: Select all
turtlefound = false
do while not vboxlog.atendofstream
linein = vboxlog.readline
if instr(linein,"Attempting fall back to NEM")<>0 then
turtlefound = true
exit do
end if
loop
DOS batch file:
But I'm sure there's something somewhere. Will have to wait for the gurus to show us.find /i /n "Attempting fall back to NEM" vbox.log > nul
rem errorlevel from find: 0, text found; 1, text missing
if "%Errorlevel%"=="0" goto handleturtle
BTW, regarding this:
what does this show:Tom79 wrote:in case of "green-turtle" mode, it also contains:
VT-x VPID: enabled
VT-x Unrestricted Exec.: enabled
scottgus1 wrote:possibly check these linesHardware Virtualization:
-
- Volunteer
- Posts: 5677
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Interface to get info if VM runs with HW-Virtualization or in NEM mode
Unfortunately, the VM Execution Engine seems to be only available programmatically and visually (in the VM window > Machine > Session Information... > Runtime information dialog and in the status line icon).Tom79 wrote:Is there an interface to get information whether a VM runs with HW-Virtualization (blue "V" in status bar") or in NEM mode ("green turtle with V" in status bar)?
Fortunately, that cannot stop a Linux hacker from obtaining it with a quick and dirty one-liner:
Code: Select all
python2 /usr/lib/virtualbox/vboxshell.py -c "guest 'Linux Mint' 'print(\"VM Execution Engine: \" + {0: \"Not set\", 1: \"Raw mode\", 2: \"VT-x/AMD-V\", 3: \"Native API\"}.get(console.debugger.executionEngine))'" | grep "VM Execution Engine: " | sed "s/VM Execution Engine: //"
Code: Select all
grep -c "NEM: NEMR3Init: Active." VBox.log
-
- Site Moderator
- Posts: 5229
- Joined: 13. Jan 2012, 11:14
- Primary OS: Debian other
- VBox Version: OSE Debian
- Guest OSses: Debian, Win 2k8, Win 7
- Contact:
Re: Interface to get info if VM runs with HW-Virtualization or in NEM mode
Relocated topic to the right forum.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Manage your VirtualBox infrastructure the free way!
-
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: Interface to get info if VM runs with HW-Virtualization or in NEM mode
NEM is Windows Host only, so it belongs better in Windows Hosts.