How to Fix General Protection Fault in module WIN87EM.DLL while running Windows 7 in VMWare

Recently ran into an issue with a Windows 7 32-bit VM running in VMware Fusion on Mac OSX 10.9 (Mavericks) when running a Point of Sale application would receive a Application has caused a general protection fault in module WIN87EM.DLL. Starting doing some digging and found this thread discussing the issue at

Basically the issue is that when you try to run a legacy 16-bit application in Windows XP and above you will receive the GPF (General Protection Fault).

The Windows 80×87 emulator library, WIN87EM.DLL, works at the 16-bit-Windows level to virtualize the coprocessor among multiple Windows-based applications that run inside the system VM.

It appears to me that, with the Virtual Machine using a Virtualized Processor (not related to the above reference to “virtualized coprocessor”) as opposed to an emulated processor, the Virtual Math Coprocessor Device (VMCPD) and/or WIN87EM.DLL generate an error from the virtualized processor.

So how do we fix it. Simple enough you just have to to “hiding” the math coprocessor from the Virtual Machine, so it doesn’t go to the processor. This apparently can be achieved by using a program called WinFloat which includes a tool called HIDE87, which is suppose to hide the math coprocessor from the kernel.

Lucky for us you can download winfloat from

  • Click on winfloat.exe to download to a directory. Once downloaded double-click to extract the files.
  • Copy to c:\windows\system32 directory
  • Add lh c:\windows\system32\  as the first line to the c:\windows\system32\autoexec.nt file.
  • Reboot virtual machine

The error should now be gone. This will work with virtual machines running on Virtualbox and VMWare.




46 Responses to “How to Fix General Protection Fault in module WIN87EM.DLL while running Windows 7 in VMWare”

  1. Anish says:

    hello !
    i cannot find the file “”, after extraction process

  2. Karel van Vliet says:

    Good morning,

    I don’t understand this line. Can you explain?

    Add to lh c:\windows\system32\autoexec.nt file for the first line:

    • newlife007 says:

      I had a typo in there, thanks for bringing that up. Here is what it should say.
      Add lh c:\windows\system32\ as the first line to the c:\windows\system32\autoexec.nt file.
      The lh stands for load in high memory.

      • J.K. van Vliet says:

        Hi newlife007,
        It works great. Now I can use my old software in Virtual Box.
        I thank you very very much.

      • riki says:

        i still strugle in this line Add lh c:\windows\system32\ as the first line to the c:\windows\system32\autoexec.nt file. , what should i do actually?

        • newlife007 says:

          Find the file called c:\windows\system32\autoexec.nt on your Windows 7 install and add the line lh c:\windows\system32\ to it. Save the file and reboot the Windows 7 virtual machine. The line is telling Windows to load the file in high memory and will get rid of the error.

  3. Tanner says:

    Thanks for your steps. My issue was not with a VM whatsoever so these steps can also be used for win87em.dll exceptions running natively in win7 x86.

  4. Jignesh says:

    Thanks for the help. It worked successfully.

  5. Rafael says:

    How To Fix Win87em.dll – STEPS

    1. Download winfloat.exe from

    2. Open winfloat.exe with 7zip. Find and extract it to desktop.

    3. Copy to C:\Windows\System32\

    4. Open c:\windows\system32\autoexec.nt with notepad

    5. At top of file, after first group of comments add the following

    lh %SystemRoot%\system32\

    6. Add a comment above your last line

    REM Fix for Gen. Protection Fault in win87em.dll

    7. Save changes to autoexec.nt and reboot pc.

  6. Jadawyn says:

    Really thank you, you saved my day

  7. Adam says:

    That saved my day! Thank you!!!

  8. Masai says:

    Excellent solution!
    Thank you so much for help us saving 20000USD !

  9. James says:

    Bless you.

  10. Branden says:

    That was a really easy fix. Thank you for sharing!

  11. Pumpernickle says:

    I am so grateful for this thread! Thank you!!! I am just curious if anyone else is encountering dramatically slower responses after going through this process. The CAD program 16 bit that we have to run on an XP virtual machine is now lagging big time for each operation. Just wondering if there is a way around that.

    • newlife007 says:

      You are the first to say anything about slowness issue. Personally I have not seen it after I corrected it on a few clients.

      • Pumpernickle says:

        It is so strange. I have one Parallels Virtual Machine running Windows XP on my 2013 iMac OS SIERRA and I get not general protection fault errors…but when I moved the Virtual Machine to any other Mac in my network I get the error. Before I go through these “fix” steps everything functions lightening fast. Once I do these steps at every single step I take in the CAD program I get the hourglass and hanging? So strange.

        Do I have the pieces of code in the right areas of the auto exec file?

        @echo off

        REM AUTOEXEC.BAT is not used to initialize the MS-DOS environment.
        REM AUTOEXEC.NT is used to initialize the MS-DOS environment unless a
        REM different startup file is specified in an application’s PIF.

        lh %SystemRoot%\system32\

        REM Install CD ROM extensions
        lh %SystemRoot%\system32\mscdexnt.exe

        REM Install network redirector (load before dosx.exe)
        lh %SystemRoot%\system32\redir

        REM Install DPMI support
        lh %SystemRoot%\system32\dosx

        REM The following line enables Sound Blaster 2.0 support on NTVDM.
        REM The command for setting the BLASTER environment is as follows:
        REM SET BLASTER=A220 I5 D1 P330
        REM where:
        REM A specifies the sound blaster’s base I/O port
        REM I specifies the interrupt request line
        REM D specifies the 8-bit DMA channel
        REM P specifies the MPU-401 base I/O port
        REM T specifies the type of sound blaster card
        REM 1 – Sound Blaster 1.5
        REM 2 – Sound Blaster Pro I
        REM 3 – Sound Blaster 2.0
        REM 4 – Sound Blaster Pro II
        REM 6 – SOund Blaster 16/AWE 32/32/64
        REM The default value is A220 I5 D1 T3 and P330. If any of the switches is
        REM left unspecified, the default value will be used. (NOTE, since all the
        REM ports are virtualized, the information provided here does not have to
        REM match the real hardware setting.) NTVDM supports Sound Blaster 2.0 only.
        REM The T switch must be set to 3, if specified.
        SET BLASTER=A220 I5 D1 P330 T3

        REM To disable the sound blaster 2.0 support on NTVDM, specify an invalid
        REM SB base I/O port address. For example:
        REM Fix for Gen. Protection Fault in win87em.dll

        • newlife007 says:

          HIDE87 is a really old file from Windows 3.1 days and is possible, I have not tried Parallels on OS X Sierra, don’t have them to test. But I have done this on VirtualBox and VMware Fusion and not any issues. Your config looks correct with HIDE87 loading high first, does the CD driver need to load high? Try making it load normal.

          • Cmontcour says:

            Hi, I used your solution in order to be able to operate my 16-bit program on my two computers. It worked perfectly on my Windows Seven 32 bits.

            Alas, when I try the same thing on my VirtualBox in Windows XP 32 bits mode on my other computer (Windows 10), the solution works but at the cost of speed. My program (Autosketch 3.1) is almost unusable, just like for Pumpernickle.

            Would you know a workaround ?

            Thank you very much.

  12. Jerry Daveline says:

    I downloaded the winfloat.exe file from with no problems but their is not a file.
    Their is HIDE87.ASM,HIDE87 MS DOS Appl, HIDE87.OBJ and HIDE87.MAK files. Which one should I use.

    • newlife007 says:

      Sounds like you may have the box checked on the view in Explorer. Organize > Folder and search options > View tab > un-check Hide extensions for known file types. The downloaded file has not changed and it is in there, the HIDE87 (MS Dos application) is he file you want.

  13. Trave8290 says:

    Thank you. Worked perfectly.

  14. stanleyDomínguez says:

    WE had the same problem using virtualBox
    so, we only uncheck in
    Configuration, system, Procesor: PAE/NX
    and fix the problem running old applications

  15. xoypox says:

    Tried this for the game “Welcome to the Future” it loads up, but as soon as you move your head left or right, there is a divide by zero error. This is certainly not meant to be run on modern machines. I wonder if using a real 32 bit windows 10 installation would fix it?

  16. kong says:

    the software I use requires a math processor. after I apply the changes the software cannot open. if there is another solution>_< thx

  17. Sagar Padekar says:

    Could any one help me to fix general protection fault in module WIN 1340.EXT at 006C:58E7.

  18. Ayhan says:

    Thank you, its worked.

  19. Zuxy says: will force software emulation of x87 instructions. It’s fine as long as the actual 16-bit program uses little floating point arithmetic. If not, probably a better solution would be masking SSE and FXSAVE from the guest VM.

  20. Iani says:

    Thanks !!!
    It works fine on windows XP VMware Virtual Machine

  21. benga says:

    Made short, my story is this: my game worked fine up to Windows XP included. On Windows 7 is my problem: whatever I type on “autoexec.nt”, the system asks me if I wanna save it, click “save”, it tells me “the autoexec.nt already exists, do I want to replace it?” I click “yes” and the answer is always “ACCESS IS DENIED”. Will you please tell me what should I do in this case ? The system doesn’t want to let me try any modifications !!! Thank you for your answer.

  22. Marten says:

    the server for “winfloat.exe” seems to be done.

    Can somebody help me to get this .exe?

  23. Frédéric says:

    Thanks you. I was blocked for 1 month with this problem on my virtualbox in xp sp3. Now i can use pp2000 without problem. Thanks you so much.
    I m sorry for my english but i m french guy and i don t wrote for a long Times.

  24. Vaitheeswaran says:

    Hey I don’t have a file named autoexec.nt in my System32 Directory. What can i do? And I had also created the file autoexec.nt by myself (in a new notepad i had typed as lh SystemRoot%\system32\ but the same error is showing for me. Please suggest some solution for this.

  25. José Confessor says:

    Thank you very much!

  26. Mathams says:

    Worked great on a Win 10 1909 non VM machine.

    Thank you!

  27. petra says:

    It works. Thank you so much.

  28. LtFelici says:

    It worked on Win XP running in VB.

    Greetings from Argentina!

  29. Shymrock says:

    Thank you so much

  30. amin says:

    works well thank you

  31. Oliver says:

    Brilliant! My old Toolbook apps from ’99 and earlier are all 16 Bit. It took some time to find your post, but thanks to you, 5 minutes later everything worked like a charm! You helped bringing old memories back to life!

    (VMWare 17 Player, Win XP SP3)


  1. Failing to Fail | OS/2 Museum - […] Around 2013, users of several virtualization products (VMware, VirtualBox, KVM, XP mode in Windows 7) complained of crashes in…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.