Enable VT on the Mac Mini.

Discussion in 'Parallels Desktop for Mac' started by Joshua LeVasseur, Apr 13, 2006.

  1. Joshua LeVasseur

    Joshua LeVasseur Bit poster

    Messages:
    6
    We've been using VT (for our own experiments) on the Mac Mini for a while. It is simple to enable, and involves modifying the EFI Setup variable. Potentially this modification can be made via the kernel API used by the nvram utility under Mac OS X, but we use an EFI utility.

    The solution is to change byte 0xe7 of the Setup variable from 0 to 1. This causes the firmware to configure the ia32_feature_control MSR with value 5. After you change the variable, you must reboot via a hard reset (since the MSR is a write-once register). I had to unplug my machine from the power supply to clear the prior contents of my MSR.

    Here is our EFI utility. We build it under the GNU environment, and I load it using the rEFIt boot loader on a USB stick. From our experience, it doesn't interfere with the BootCamp firmware update. We observed that Parallels Workstation successfully detects VT on the Mini.

    **** Use at your own risk! *****

    #include <efi.h>
    #include <efilib.h>

    EFI_BOOT_SERVICES *BS;
    EFI_RUNTIME_SERVICES *RS;
    EFI_HANDLE IMAGE;

    EFI_GUID guid_apple = // 4DFBBAAB-1392-4FDE-ABB8-C41CC5AD7D5D
    {0x4DFBBAAB, 0x1392, 0x4FDE, {0xAB, 0xB8, 0xC4, 0x1C, 0xC5, 0xAD, 0x7D, 0x5D}};

    EFI_STATUS
    efi_main( EFI_HANDLE image, EFI_SYSTEM_TABLE *system_table )
    {
    EFI_STATUS status;
    UINT32 attr = 0;
    unsigned char data[0xfe];
    UINTN data_size = sizeof(data);

    BS = system_table->BootServices;
    RS = system_table->RuntimeServices;
    IMAGE = image;

    InitializeLib( image, system_table ); // Initialize the EFI library.

    status = RS->GetVariable( L"Setup", &guid_apple, &attr, &data_size, data );
    if( status == EFI_SUCCESS ) {
    data[0xe7] = 1;
    status = RS->SetVariable( L"Setup", &guid_apple, attr, data_size, data )
    ;
    if( status != EFI_SUCCESS )
    Print( L"failure changing variable\n" );
    }

    BS->Exit( image, status, 0, NULL );
    return status;
    }


    -Joshua

    P.S. The Mac Mini is awesome. And EFI is so nice.
     
  2. Cereal

    Cereal Junior Member

    Messages:
    19
    Awesome post!

    Thanks!
     
  3. mattham

    mattham Bit poster

    Messages:
    8
    what you said was mostly gibberish to me (sounded good tho!!)

    Im sure the guys here
    http://forum.parallels.com/thread85.html

    would love to hear about it.
    The thread has had neary 7000 hits!!

    Matt :)
     
  4. JakePratt

    JakePratt Junior Member

    Messages:
    15
    Has anyone tried this. Also, can you pass on a binary version. I program on a PC but I am a MacOS newbie so I am not quite up on compiling etc.
     
  5. Joshua LeVasseur

    Joshua LeVasseur Bit poster

    Messages:
    6
    binaries

    Note that you should be able to build the EFI utilities under Windows and VC++ with Intel's EFI kit; you don't need to use the GNU environment.

    I've attached two binaries:

    vmx-var-set.efi - enables VT support.
    vmx-var-reset.efi - restores the firmware to its original condition

    I copy the binaries to my flash stick that has the rEFIt boot loader. I boot with the rEFIt boot loader, and execute vmx-var-set by dropping to the command line (which behaves like DOS). So just type 'vmx-var-set' at the command line to execute it. Alternatively, you may be able to execute it from rEFIt's boot menu.

    Use at your own risk!!

    http://i30www.ira.uka.de/~joshua/vmx.zip

    -Joshua
     

    Attached Files:

    • vmx.zip
      File size:
      34.1 KB
      Views:
      153
    Last edited by a moderator: Apr 27, 2006
  6. daveschroeder

    daveschroeder Member

    Messages:
    64
    This still doesn't explain why some minis seem to spontaneously enable (or disable) VT...
     
  7. AtariAge

    AtariAge Junior Member

    Messages:
    17
    It would be nice to have a detailed tutorial on how to run this binary, including information on how to setup the rEFIt boot loader. Also, would like to see indepedent confirmation that this works. And hopefully the setting does stick. I have a Mac Mini (duo) and VT is not enabled on my machine at the moment. .

    ..Al
     
  8. dstranathan

    dstranathan Bit poster

    Messages:
    1
    Why cant I download your binaries? I have a registered forum account...
     
  9. bill.french

    bill.french Bit poster

    Messages:
    1
    Hi there, mac newbie here. I'd like to confirm the above binaries worked on my 2 day old, freshly recieved compusa shipment Mac Mini. VT-x worked for a while, then stopped working. I did the above steps and it worked. Let me see if I can lay it out a little more concisely:

    0. Don't know if it's related, but i set it so that my mac mini does not go to sleep, ever.
    1. Download the rEFIt dmg file at: http://prdownloads.sourceforge.net/refit/rEFIt-0.5.dmg?download
    2. Open the DMG file and read the instructions inside the file. i followed the section for "installing on a disk volume" and installed it on "macintosh HD"
    3. Extract the binary above (efi.zip) into the "macintosh HD"
    4. Reboot
    5. On the new refit boot menu, select the console and type in vmx-var-set.efi
    6. Type in exit, that should bring you back to the boot menu
    7. Boot into OSX, and parallels should support VT-x

    The setting has survived two reboots now. I'm wondering if I can now uninstall refit ... if anyone knows if that would a) be ok and b) how i would go about doing that, it would be great!!

    Thanks, everyone, for the input on this aggravating issue! --Bill
     
  10. harshbh

    harshbh Bit poster

    Messages:
    1
    why cant i download that file
     
  11. stompbox

    stompbox Junior Member

    Messages:
    14
    Does this not work?

    Uninstalling rEFIt
    To get rid of rEFIt, open the “Startup Disk” preference pane and select “Mac OS X” as the operating system to boot. This will re-bless your Mac OS X volume and instruct the firmware to boot from it. After this, you can remove the “efi” folder.
     
  12. stompbox

    stompbox Junior Member

    Messages:
    14
    OK, I can confirm failure with Mac Mini Intel Core Solo. Bummer...

    It doesn't work.
     
  13. stompbox

    stompbox Junior Member

    Messages:
    14
    OK, this is WEIRD. After giving up, then setting OS X as the default startup and then restarting. IT WORKS!!!!! Scratch the previous post. Apparently with some voodoo, the Intel Mac Mini solo core DOES support VT and XP is very quick.
     
  14. Joshua LeVasseur

    Joshua LeVasseur Bit poster

    Messages:
    6
    Don't forget that you need a hard CPU reset after running the utility. Thus you must power off the machine, let it sit there without power for a few seconds, and then turn it back on. Otherwise the CPU retains its old configuration with VT disabled.
     
  15. rthelen

    rthelen Bit poster

    Messages:
    6
    I don't know. I can't download it either. I'm logged in:

    When I click on the vmx.zip link I get the message:

    Is there something else I have to do to access this file?
     
  16. stompbox

    stompbox Junior Member

    Messages:
    14
    If you had email enabled I could email it to you.
     
  17. rthelen

    rthelen Bit poster

    Messages:
    6
    Thanks, Stompbox. :)

    I tried the 'reload' button on my browser and the file downloaded. I hadn't tried it earlier because I figured that a PHP based web page wouldn't cache. But, apparently the 'sorry' web page was cached (in my browser).
     
  18. stompbox

    stompbox Junior Member

    Messages:
    14
    Cool!

    I did omit the hard restart of the mini. I missed it when I read about this. Instead, I chose OS X as the startup OS and it started working (and has worked since then).

    Perhaps others can do what I did and it might work for them.

    BTW: If you put "vmx-var-set.efi " right on the root of "Macintosh HD" then it can be chosen as a startup option when holding down the option key at boot. I tried that as well as the command line. After that I chose OS X as the startup OS in startup disk and it started working for me.
     
    Last edited: Apr 17, 2006
  19. fibtastic

    fibtastic Bit poster

    Messages:
    7
    tried the vmx-var-set.efi util method above off of a usb stick with REFIt.

    My parallels beta 3 reports software mode 0 sometimes and other times software mode 2. I don't know what either means and can not tell if vt is enabled or not. Also I tried vtxcheck but that fails with:

    kextload: extension /Users/billm/Desktop/vtx-check/MacOS/vtxcheck.kext is not authentic (check ownership and permissions)
     
  20. jaketraynham

    jaketraynham Bit poster

    Messages:
    2
    this worked for me

    Just thought I'd chime in and say that I was able to re-enable the VTX support using this method on my core duo mac mini. Here are the steps I took:

    1. downloaded rEFIt (from previously mentioned url)
    2. used Disk Utility to convert the rEFIt disk image to a read/write disk image
    3. unzipped the vmx.zip file and copied the vmx folder to the new read/write rEFIt disk image
    4. burned my modified rEFIt disk image to a cd-rw
    5. restarted the computer and held down alt/option until the EFI menu came up
    6. selected the rEFIt item
    7. selected the "shell" item from the rEFIt menu
    8. typed "fs0:" to get to the cd-rw drive (if this isn't your cd, try "fs1:" or "fs2:" etc..)
    9. typed "cd vmx" to get into the vmx directory
    10. typed "vmx-var-set.efi", which ran and gave me back the prompt. Apparently it only outputs any messages if there is a problem...
    11. typed "exit"
    12. turned off the computer and unplugged it for a few seconds
    13. plugged it back in and booted up, then started parallels and booted my win2k pro vm .. after it booted, the parallels' "about" dialog showed that vtx was enabled and running

    Thanks Joshua!
     

Share This Page