Parallels Forums
> Archives > Parallels Desktop for Mac  
Enable VT on the Mac Mini.  
  

Enable VT on the Mac Mini.

Apr 13, 2006, 06:36 PM
#1  

Joshua LeVasseur
Junior Member


Join: Apr 2006
Posts: 6
Enable VT on the Mac Mini.
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.
Apr 13, 2006, 07:37 PM
#2  

Cereal
Junior Member


Join: Apr 2006
Posts: 19
Awesome post!

Thanks!
Apr 13, 2006, 11:17 PM
#3  

mattham
Junior Member


Join: Apr 2006
Posts: 9
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 :-)
Apr 14, 2006, 12:55 AM
#4  

JakePratt
Junior Member


Join: Apr 2006
Posts: 12
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.
Apr 14, 2006, 08:39 AM
#5  

Joshua LeVasseur
Junior Member


Join: Apr 2006
Posts: 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
File Type: zip vmx.zip (34.1 KB, 103 views)
Apr 14, 2006, 10:00 AM
#6  

daveschroeder
Member


Join: Apr 2006
Posts: 67
This still doesn't explain why some minis seem to spontaneously enable (or disable) VT...

__________________
Dave Schroeder
University of Wisconsin - Madison
das@doit.wisc.edu
http://das.doit.wisc.edu
Apr 15, 2006, 01:42 PM
#7  

dstranathan
Junior Member


Join: Apr 2006
Posts: 1
Why cant I download your binaries? I have a registered forum account...
Apr 15, 2006, 11:51 PM
#8  

harshbh
Junior Member


Join: Apr 2006
Posts: 1
why cant i download that file
Apr 24, 2006, 02:58 AM
#9  

dcrobinson1965
Junior Member


Join: Apr 2006
Posts: 1
Quote:
Originally Posted by Joshua LeVasseur
**** Use at your own risk! *****
Joshua,

Your solution looks great, seems to make sense, and people are having a lot of success with it. Well done!

I've owned my MacMini for 2 weeks, and I'm scared of breaking it! I've been a PC owner for a long time, and I don't know much about Macs and EFI. Is there any real possibility that I could completely break my Mac if this update goes wrong? Can any "issues" be corrected by reapplying the factory firmware off the CD-ROM?
Apr 27, 2006, 11:31 AM
#10  

Joshua LeVasseur
Junior Member


Join: Apr 2006
Posts: 6
dcrobinson, worst case is that you lose electricity sometime during the process, but since my update changes a single byte, it shouldn't be possible to make the configuration inconsistent. The other possible harm is that you misconfigure rEFIt. But I'm pretty sure that anything you do can be fixed by reapplying the factory firmware from the CDROM, and by performing a disk repair to make your system bootable again.

-Josh
Apr 27, 2006, 12:03 PM
#11  

Joshua LeVasseur
Junior Member


Join: Apr 2006
Posts: 6
Another download location
These Parallels forums seem to have a bug regarding attachments. So here is an external location for the file:

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

-Josh
Apr 27, 2006, 12:11 PM
#12  
Andrew @ Parallels's Avatar

Andrew @ Parallels
Parallels Team


Join: Apr 2006
Posts: 1,557
Attachment is fixed - thanks for reporting!

__________________
Best Regards,
Andrew @ Parallels
May 2, 2006, 10:05 AM
#13  

bogg
Junior Member


Join: Apr 2006
Posts: 3
this "hack" worked fine on my Core Duo mini.

Thanks!
Jun 2, 2006, 10:57 AM
#14  

jamiefiedler
Junior Member


Join: May 2006
Posts: 1
i can confirm the vmx-var-set.efi procedure was successful on my core duo mini.

not sure if it made a difference, but after running the restart, console, vmx-ser-var.efi, exit procedure, i booted into os x and put the mini to sleep for 60 seconds. woke it up, and then ran parallels. i now show "Virtualization Mode: Intel VT-x" as intended.

screenshot:
http://www.auralogic.com/osx/img/mini_parallels.png

Hardware Overview:
Machine Name: Mac mini
Machine Model: Macmini1,1
CPU Type: Intel Core Duo
Number Of Cores: 2
CPU Speed: 1.66 GHz
L2 Cache (shared): 2 MB
Memory: 1 GB
Bus Speed: 667 MHz
Boot ROM Version: MM11.004B.B00
Serial Number: G86177HEU39
SMC Version: 1.3f4
 


Thread tools Display modes
Hybrid Mode