Tracker item #3308802, was opened at 2011-05-28 09:25
Message generated for change (Comment added) made by mvanzin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=989708&aid=3308802&group_id=204462

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: checkvm
Group: None
>Status: Closed
Resolution: Later
Priority: 5
Private: No
Submitted By: Ed Swierk (eswierk)
Assigned to: Nobody/Anonymous (nobody)
Summary: VmCheck_IsVirtualWorld fails on ESXi guest

Initial Comment:
# vmware-checkvm
** Message: HOSTINFO: CPUID hypervisor bit is set, but no hypervisor vendor 
signature is present

** (process:1899): DEBUG: VmCheck_IsVirtualWorld: detected non-VMware 
hypervisor ().

Not running in a virtual machine.

---

Apparently the cpuid instruction for level 0x40000000 is not getting emulated 
correctly when invoked from userspace.

To verify this I wrote a test program that calls cpuid 0x40000000 and confirms 
that eax contains 0. However, if I modify the program to use the cpuid kernel 
module instead, eax contains 0x40000010.

I'm running a 32-bit Linux 2.6.38 guest on VMware ESXi 4.1.0. The server is an 
HP with an AMD Opteron 2214 HE CPU. Behavior is the same whether I configure 
the VM's CPU/MMU Virtualization setting to Automatic, Software or Hardware.


----------------------------------------------------------------------

>Comment By: Marcelo Vanzin (mvanzin)
Date: 2011-05-31 18:39

Message:
Well, someone trying to run any tools utility on ESXi running as a guest OS
is not an ordinary user of tools, I'd say. :-)

As I mentioned, if ESXi turns into an officially supported guest for
tools, you'll see code specifically for it show up in the tools code. But
so far that's not the case.

----------------------------------------------------------------------

Comment By: Ed Swierk (eswierk)
Date: 2011-05-31 14:15

Message:
I guess patching the source code and rebuilding is a workaround in some
sense, but it's sort of an extreme one to ask of an ordinary user.

Anyway, I tried running iopl(3) as non-root, and while it does return -1
and set errno to EPERM I don't see any bad effect as long as the caller
ignores it.


----------------------------------------------------------------------

Comment By: Marcelo Vanzin (mvanzin)
Date: 2011-05-31 13:55

Message:
Well, the iopl() call is only required when running ESX as a guest OS. And
VmCheck_GetVersion()  is not the only function that requires it.

Furthermore, iopl(3) would probably just fail if run as a regular user
(see man 2 iopl), aside from not being needed on Linux or any other guest
OS. So I'll just close this bug here since there's a known workaround. In
the future, if we start creating a tools package targeted at ESX, a more
generic fix may show up in the code.

----------------------------------------------------------------------

Comment By: Ed Swierk (eswierk)
Date: 2011-05-31 06:38

Message:
Yes, adding iopl(3) at the top of main() in checkvm.c fixes the problem.

Maybe this should be added to VmCheck_GetVersion() so that all the tools
(not just checkvm) benefit from the fix?


----------------------------------------------------------------------

Comment By: Marcelo Vanzin (mvanzin)
Date: 2011-05-28 14:04

Message:
Tools are not really tested on ESXi guests, so YMMV. But try adding this at
the top of the main() function:

   iopl(3);

And see if it helps. (you may need to #include <sys/io.h>)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=989708&aid=3308802&group_id=204462

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
open-vm-tools-devel mailing list
open-vm-tools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-vm-tools-devel

Reply via email to