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 14, 2006, 10:06 AM
#7  

AtariAge
Junior Member


Join: Apr 2006
Posts: 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
Apr 15, 2006, 01:42 PM
#8  

dstranathan
Junior Member


Join: Apr 2006
Posts: 1
Why cant I download your binaries? I have a registered forum account...
Apr 15, 2006, 07:54 PM
#9  

bill.french
Junior Member


Join: Apr 2006
Posts: 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/r...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
Apr 15, 2006, 11:51 PM
#10  

harshbh
Junior Member


Join: Apr 2006
Posts: 1
why cant i download that file
Apr 16, 2006, 12:22 AM
#11  

stompbox
Junior Member


Join: Apr 2006
Posts: 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.
Apr 16, 2006, 12:52 AM
#12  

stompbox
Junior Member


Join: Apr 2006
Posts: 14
OK, I can confirm failure with Mac Mini Intel Core Solo. Bummer...

It doesn't work.
Apr 16, 2006, 02:05 AM
#13  

stompbox
Junior Member


Join: Apr 2006
Posts: 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.
Apr 16, 2006, 03:48 PM
#14  

Joshua LeVasseur
Junior Member


Join: Apr 2006
Posts: 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.
Apr 16, 2006, 09:27 PM
#15  

rthelen
Junior Member


Join: Apr 2006
Posts: 6
I don't know. I can't download it either. I'm logged in:

Quote:
Welcome, rthelen.
You last visited: Today at 05:44 PM
When I click on the vmx.zip link I get the message:

Quote:
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

You are not logged in. Fill in the form at the bottom of this page and try again.

You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?

If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Is there something else I have to do to access this file?
Apr 16, 2006, 10:21 PM
#16  

stompbox
Junior Member


Join: Apr 2006
Posts: 14
If you had email enabled I could email it to you.
Apr 17, 2006, 01:07 AM
#17  

rthelen
Junior Member


Join: Apr 2006
Posts: 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).
Apr 17, 2006, 03:34 AM
#18  

stompbox
Junior Member


Join: Apr 2006
Posts: 14
Quote:
Originally Posted by rthelen
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).
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.
Apr 17, 2006, 04:09 PM
#19  

fibtastic
Junior Member


Join: Apr 2006
Posts: 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)
Apr 17, 2006, 07:29 PM
#20  

jaketraynham
Junior Member


Join: Apr 2006
Posts: 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!
 


123>

Thread tools Display modes
Linear Mode