I have had this question asked to me numerous times and some have suggested that a simple guide would be helpful to them. So here it is, a simple guide to creating a dual boot with OS X 10.6.x & Windows 7 on a single hard drive using the Chameleon bootloader. This is not the only way to achieve this goal but I am going to outline the methods I personally use which are among the simplest and easiest to duplicate.
Disclaimer: Repartitioning your hard drive can and will erase all data contained on it, resizing partitions with a utility like GParted may alter the partition table without destroying data but there is still a significant risk of failure and data loss. I strongly advise you to ensure you have backed up all important data before attempting ANY alteration of your existing partition structure. I am not liable for any data loss due to the (mis)use of this guide, I have warned you of the risks and advised you to make a backup of your data, I am not responsible for your data, you are!
Important Note: There are a lot of people who use GUID partition types for their hackintosh drive. While this arguably has some advantages when using OS X exclusively I personally advise against the use of GUID partition types, particularly when dual/multi-booting. It will only complicate matters and offers NO advantages over a standard MBR partition scheme in my opinion. This guide assumes you are using an MBR partition scheme – if you are using a GUID partition scheme I encourage you to switch it back to MBR or the instructions here may fail. (The instructions here should actually work for a GUID partitioned disk – but I have not tested them so if you choose to attempt it don’t be upset with me if it fails. If you happen to be one of those people who have their heart set on using a GUID partition scheme and you do test this method – please let me know your success/failure so I can include the information in this guide, be sure to include any additional instructions that you used (if any) so I can present the information as accurately and completely as possible.) **Important note: Older operating systems (Windows XP, older versions of linux, etc) will not function on a GUID partitioned device.
Note: This guide assumes you are using fdisk440 – NOT the standard fdisk that ships with OS X. You can find fdisk440 in the Tools bundle of the myHack app or Chameleon bootloader.
Section 1 : Basic Instructions
Step 1) Allocate space. Personally I plan in advance if I have the intention of dual-booting. So when I booted my trusty myHack USB Installer to install OS X on my system I used disk utility to create two partitions, the first being an HFS+ partition for OS X, the second being a FAT32 (MS-DOS) partition which I will later prepare for Windows 7 Installation. Since my drive is 1TB in size I just created two 500GB partitions for simplicity sake but adjust this to meet your individual needs. If you did not plan in advance you have three options, make a backup of your files and reinstall, make an image of your partition(s) and restore it after repartitioning the drive, or use a utility like GParted to resize the partition(s). Resizing partitions can take a very long time depending on how large they are so personally I’d just backup my files and reinstall but you decide what option works best for you.
Step 2) Install OS X. ( Please tell me you know how to do this by now ;p ). Yes, you can also install Windows 7 first but the methodology will be slightly different – I install OS X first so for the sake of this guide you should too. Ensure to boot to OS X and complete the post installation configuration and installation of myHack (Chameleon, pc efi, kexts, etc) to the installation drive and verify that it is booting without the USB drive attached and functioning properly before moving on to step 3.
Step 3) Install Windows 7. This should be fairly self explanatory but I will explain a few of the important details so you don’t get stuck. Boot the Windows 7 Installation DVD, begin the installation as normal. When you get to the “Which type of installation do you want” section choose “Custom (Advanced)” it will then ask you “Where do you want to install Windows” – choose the FAT32 (MS-DOS) partition we created in step 1 and click on “Drive options (advanced)”. Click format. Click OK. Click Next and proceed with the installation as normal. You have to format it with the Windows 7 installer before it will allow you to install Windows 7 on it because Windows 7 requires an NTFS formatted partition which is flagged as active. It will reboot a couple of times during the installation process, you will notice that the system will now boot directly to Windows 7 and you will no longer see the Chameleon boot prompt. After you have Windows 7 setup to your liking and are ready to fix the dual boot move on to step 4.
Step 4) Repair MBR. Windows 7 has infected your MBR… In the past you could simply set the active partition on the drive and it would boot to it but if you were to change the active partition now your system will hang at boot.We have to repair the damage Windows has done… Insert your handy dandy myHack USB Installer and use it to boot your OS X Installation (Boot to the USB Installer but at the Chameleon boot prompt select the OS X installation on the internal hard drive instead of booting to the Installer itself). Actually it doesn’t really matter if you boot the installer or the installed OS as we are only going to be using the terminal to repair the MBR but the internal hard drive boots more quickly and is more responsive in general so I choose it to save time. Once you have booted open a terminal and run the following commands (which I will guide you through step by step).
First lets get a list of the disks in your system so we target the correct one by running the “diskutil list” command.
myHack-Pro:~ Conti$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *1.0 TB disk0
1: Apple_HFS myHack 500.2 GB disk0s1
2: Windows_NTFS 500.0 GB disk0s2
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *8.0 GB disk1
1: Apple_HFS Mac OS X Install DVD 8.0 GB disk1s1
As you can see I have two disks in my system, /dev/disk0 is the 1TB with two 500GB partitions on it, one Identified as Apple_HFS type and has the name I assigned it (myHack), the other is identified as Windows_NTFS type (This is Windows 7). /dev/disk1 as you can see is the 8GB USB Installer which I used to boot the system. You’re results will be different but the important thing to identify here is the /dev/disk# that contains your OS X & Windows 7 installations and the partition number of each of them, in my case OS X being on /dev/disk0 partition #1 and Windows 7 being on /dev/disk0 partition #2.
Next we are going to write a new MBR to /dev/disk0 by running the “sudo fdisk440 -u /dev/disk0″ command. (Replacing /dev/disk0 with the /dev/disk# your dual boot is installed on if different). If this is your first time using sudo on this system it will give you a warning message, ignore it… You will be prompted for your password, enter it and continue.
myHack-Pro:~ Conti$ sudo fdisk440 -u /dev/disk0
—————————————————–
—— ATTENTION – UPDATING MASTER BOOT RECORD ——
—————————————————–Do you wish to write new MBR? [n] y
As you can see it displays a warning that it will update the MBR and it prompts you for confirmation. Enter “y” and hit enter to confirm as I have in the example above.
Now we are going to change the active partition to the one OS X (and Chameleon) is installed on. Run the “sudo fdisk440 -e /dev/disk0″ to open the disk in edit mode.
myHack-Pro:~ Conti$ sudo fdisk440 -e /dev/disk0
Enter ‘help’ for information
fdisk: 1>
You are now in edit mode, be careful here one wrong move and you’ll wipe the drive blank and be back to step1! Lets type “print” to view a list of the partitions on this drive and confirm that we are editing the correct drive and set the correct partition to active.
fdisk: 1> print
Disk: /dev/disk0 geometry: 121601/255/63 [1953523055 sectors]
Offset: 0 Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
————————————————————————
1: AF 0 1 1 – 1023 254 63 [ 63 - 977027392] HFS+
*2: 07 1023 254 63 – 1023 254 63 [ 977027499 - 976495527] NTFS
3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
fdisk: 1>
Ok so as we can see here partition 1 is HFS+, partition 2 is NTFS and that little asterisk before the 2 (*2: 07 1023 254 63 – 1023 254 63 [ 977027499 - 976495527] NTFS) means that this partition is flagged as active, if we were to reboot right now Windows 7 would boot as a result. We want that active flag to be on partition #1 so OS X / Chameleon loads and lets us then choose which of the partitions to boot from a nice graphical menu. Now that we have properly identified all the partitions lets type “flag 1″ to flag partition 1 as active. (Change the “flag #” partition number if your configuration is different!)
fdisk: 1> flag 1
Partition 1 marked active.
Done, now all we have to do is write the changes to the disk and reboot the computer. Type the “quit” command to write the current MBR to disk and exit fdisk440.
fdisk:*1> quit
Writing current MBR to disk.
Device could not be accessed exclusively.
A reboot will be needed for changes to take
Step 5) Finish. Thats it, you’ve done it! Un-mount and remove the myHack USB disk and reboot the system with the internal disk. If all has gone well you will be greeted by the Chameleon boot prompt and you can easily select between OS X (which will be the default option) and Windows 7. Congratulations! Continue onto section 2 to learn more.
Section 2 : Troubleshooting & Multi-Boots
Section 2:a – Time synchronization
This is the most common problem that will be encountered when dual booting or multi booting with OS X on a PC. OS X sets your hardware clock to UTC (Coordinated Universal Time), windows and many Linux distributions on the other hand typically default to setting your hardware clock to “Local Time”. The “time zone” you are located in is considered local time – for example I am personally located in the UTC+9 time zone so when I set my clock in OS X it sets the hardware clock to UTC time (which will be 9 hours earlier than my local time). When I reboot into Windows or Linux they will assume my hardware clock is local time thus the clock will now be displaying UTC time which is 9 hours off from my local time. Fortunately this is very easy to resolve.
Part 1) Windows
To correct this problem in Windows 7/Vista we will need to edit the registry. Note: These instructions will not work for Windows XP.
At the windows desktop do the following:
If you would rather not edit the registry manually simply download and run this utcfix.reg file I created to import the data directly into your windows registry.
- Exit all Windows-based programs.
- Click Start, type regedit in the Start Search box, and then press ENTER.
- If you receive the User Account Control dialog box, click Continue.
- Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\TimeZoneInformation- In the right pane, right click anywhere on the empty space and create a new DWORD (32-bit) Value. [NOTE: On 32-bit versions of Windows 7/Vista , you will only see D-WORD]
- Name it RealTimeIsUniversal [NOTE: This is CaSe Sensitive so make sure it is exactly as shown here.]
- In the right pane, right-click RealTimeIsUniversal in the Name column, and then click Modify.
- In the Value data box, type 1, and then click OK.
- On the File menu, click Exit to close Registry Editor.
This tells windows that your hardware clock is set to UTC and it will adjust for your time zone accordingly (the same way OS X does).
Next simply reboot into OS X and make sure your time is set correctly. The next time you reboot into Windows you should see the correct time – if not ensure that you have properly configured your time zone via the regional and language options in the control panel.
Part 2) Linux
To correct this problem in Linux requires a different process. Not all Linux distributions will be configured to set your hardware clock to a local time zone, some actually do use UTC by default but if you notice a time discrepancy do the following.
First we are going to open /etc/conf.d/clock in a text editor. In this example I will be using nano but if you do not have nano you could also use vi, pico, gedit, kate, or whatever text editor you like.
Open a terminal and type the following to open the file:
sudo nano /etc/conf.d/clock
(type your password)
Find the CLOCK= value.
It will likely appear as follows:
CLOCK=”local”
Change it to:
CLOCK=”UTC”
Save your changes and exit your text editor… (In nano it is ctrl+o to save changes and ctrl+x to exit.)
Now before we reboot we should make sure that we have set the correct local time zone. You may do this with a GUI tool… I do the following in my own flavor of Linux, it should apply to many but not all Linux distributions – consult your own distributions documentation if the following does not apply to you. I will be using my own time zone in the following example, you will have to adjust the commands to apply to your own location.
First you will want to locate your own time zone file in /usr/share/zoneinfo. I am in UTC+9 (Korean Standard Time) so my time zone file is located in /usr/share/zoneinfo/Asia/Seoul
Copy your time zone file to /etc/localtime by running the following command in a terminal.
sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
Now open the /etc/conf.d/clock file back up and locate the TIMEZONE= value and set it to your own local timezone, for example mine looks like this:
TIMEZONE=”Asia/Seoul”
Save changes and exit your text editor. Now you should be all set to reboot.
Section 2:b – Windows BSOD when AHCI mode enabled
This issue typically arises on windows installations that existed before enabling AHCI mode in the bios. The cause of this issue is the AHCI driver (Msahci.sys) in Windows 7/Vista being disabled. This driver must be enabled before you change the SATA mode of the boot drive.
Why would the Msahci.sys driver be disabled?
During the Windows 7 or Windows Vista installation process, any unused storage drivers are disabled. This behavior speeds up the operating system’s startup process. When you change the boot drive to a driver that has been disabled, you must enable the new driver before you change the hardware configuration.
How can I enable the Msahci.sys driver?
Well first you will have to disable AHCI mode in your bios temporarily to be able to get back into Windows… Go ahead and boot windows normally (it may prompt you to load recovery console because it will have detected that there was a BSOD the last time you attempted to boot the OS, you do not need to enter the recovery console so select boot windows normally and continue). After you get to the windows desktop do the following:
If you would rather not edit the registry manually simply download and run this ahci.reg file I created to import the data directly into your windows registry.
- Exit all Windows-based programs.
- Click Start, type regedit in the Start Search box, and then press ENTER.
- If you receive the User Account Control dialog box, click Continue.
- Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci- In the right pane, right-click Start in the Name column, and then click Modify.
- In the Value data box, type 0, and then click OK.
- On the File menu, click Exit to close Registry Editor.
After you have edited the registry (or imported the ahci.reg file I provided above) you will need to restart your computer, go back into your BIOS setup and re-enable AHCI. When you login to Windows again, you’ll notice the installation of drivers for AHCI. Another restart will be required to finish the driver installation.
Section 2:c – Multi-Boot Configuration
This section will eventually focus on configurations that involve more than just OS X 10.6 and Windows7. I intend to add a linux example to this section as soon as I have some more time to work on it.
Conclusion
It is my hope that this tutorial will help you to easily setup your own dual boot and that it will also help you to understand the underlying principals involved.
Cheers
- Conti
I am using BootIt NG to do multi-booting and all partition work and everything works great. I am multi-booting iAtkos v7, myhack (1.0.1)+Retail Snow Leo 10.6.3, Windows Vista 64 bit and Suse Linux 11.0
Confirmed working on GUID partition table
Steps I took:
1. Install Snow Leo making sure to leave a partition free for windows7
2. Install Windows7 boot and restart
3. Boot with Snow Leo install usb to the install not snow leo
4. open terminal and do everything stated above in this guide (after this has been done windows might not boot, where as snow leo will from chameleon)
5. If windows won’t boot from chameleon then pop in the win install disk and select repair my computer. Use command prompt to get to execute diskpart.exe
6. Make windows partition active then startup repair will recognize the windows partition. Run startup repair. Reboot & startup from win install disk again. Select repair once again and startup command prompt.
7. Set Snow Leo as active and everything should work!
Yes I have formatted the drive but it did not work so I eventually partitioned one HDD into two 500GBs then got it worked.
Thanks for your great work Conti.
By the way, I have some other curiousity which is, is there any possiblity to use rEFIt to boot several operating systems on PC? I mean instead of Chameleon boot loader.
I have seen that in my school Mac Pros load Mac OS X and Windows with rEFIt, and when we install Mac OS X on PC, it reads as Mac Pro.
If you have any idea, please share it with us ;)
Cheers
Joel K: Since rEFIt is designed to work with EFI based machines my initial thoughts are no, however some more recent PC’s do have uEFI so there may be a possibility to do so. However the setup would be a bit different since there would be a lack of an /Extra directory – I don’t believe it will load a custom dsdt.aml & you would have to use all non-vanilla kexts inside /S/L/E – so overall I don’t believe it would be equitable if even possible.
Conti,
Currently my PC has two 500GB HDD, which aren’t partitioned.
So my goal is to multi-boot Mac OS X on one HDD and Windows 7 on another HDD.
I have successfully installed Mac OS X Snow Leopard with your USB method.
As your instruction above, I have set one of the HDD which Windows 7 will be installed to MBR – MS-DOS(FAT32).
Then I booted with CD-ROM to install Windows 7 and it won’t let me.
I see from Custom(Advanced) installation progress, two disks:
disk0: partition1 (System) – Mac OS X Snow Leopard
disk1: partition1 (Primary)
It keep won’t let me install Windows 7 on disk1: partition1 saying as there is already System partition is existing.
I am guessing it requires me to setup ‘disk control’ to enabled, however I could not find any similar ones from BIOS.
Your help will be very much appreciated.
Thanks
did you format the disk?
Yes, it does work now. Using only your myHack I was able to format the disk as MBR and install Snowy succesfully.
You’ve won yet another beer mate, keep it up :)
Thanks for getting back to me so soon; I belive I used prasys’ EmpireEFI to boot, and your myHack after installing – I can’t, however, explain why I chose this setup, I just can’t remember.
I do remember that when I partitioned using Disk Util, and chose MBR instead of GUID, Snowy said it could not install on that drive, and it showed it with a yellow exclamation mark – so it did see the MBR drive. AHCI is enabled.
Will try your USB install this weekend, hope it solves my problem – it really bugs me :(
Tiberiu D: Empire EFI is unable to modify the files on the OS X installation DVD the way myHack USB Installer does, therefore no MBR support. It’ll work great with a pure myHack method.
Hi Conti, first of all massive thanks for all your work, it helped me switch from distros to vanilla instals. And could not have done it without your myHack.
But, I find myself in times of trouble: I need to set up a hackintosh on a 1Tb HDD, but when I want to set it up to use MBR, Snowy won’t install; and when I set it up to use GUID, Windows won’t install…
What gives? What am I doing wrong? What am I missing, because I remember being able to install Snowy on MBR using —— distro.
Any ideas, mate?
Thank you,
Tiberiu Dubau
Tiberiu D: If you prepared a USB installer using myHack then it does indeed enable MBR installation – I use MBR myself. Is it seeing the drive/partition at all? Have you enabled AHCI in bios? Have you created an HFS+ partition using disk utility?
Sorry to confuse you. I finally managed to successfully dual boot SL and Xp without the original usb “slinstall”. You ask me earlier if I was sure I had installed MyHack to the SL partition. I thought I had each time … the last which was successful booted into SL and only after a few reboots did it show and boot into XP. Anyway thanks for your advice.
(Thanks a lot for your answer.)
But my error was not “Fixing “BOOTMGR is missing” Error While Trying to Boot Windows Vista” and error: BOOTMGR is missing.
My error was different than that in the comment you said.
My error was a STOP ERROR 0x0000000e not a bootmgr missing.
I have MAC OS X in the first partition. W7 prof in the second one. And a FAT32 partition to share data between them.
I have done this instalation (with your tutotial) three times. All of them making everything from begining and when active the MAC OS X partition gives up an STOP error.
So, simply tried to active the partition via Windows and it worked for me.
I think is similar, isn’t it? No differences?
So if you have any problem via MAC OS X, this is the second option: making active partition via Windows.
Thanks a lot! (I have now a MAC :) )
(I’m the same than the last jorge’s comment)
I have fixed the problem making the active partition (MAC OS X) via Windows; not via MAC OS X console.
If I active the partition 1 as active via MAC OS X console, Windows 7 proffesional didn’t boot. And tell you insert Windows DVD to repear the installation.
But if you active the partition 1 via Windows DVD it has worked for me.
You can do this:
1.- Insert Windows DVD and load it.
2.- Select “repair Windows”
3.- Select teh console
4.- Write: DISKPART
-> to enter the utility
5.- Write: list disk
-> to see what are disks
6.- Write: select disk X
-> X is the number of the disk
7.- Write: list partition
-> to see the partitions of the selected disk
8.- Write: select partition X
-> X is the number of the MAC OS X partition to set it active.
9.- Write: active
-> to set that partition as active
10: Exit.
(I think you can add this to your tutorial to help people who give errors making active partition)
Thanks a lot! Great job
Jeorge: I don’t understand why you were unable to set the OS X partition as active properly with the OS X fdisk?
I posted the typical repair methods for that error here (yes, it was a different error than the one you had) http://osx86.sojugarden.com/2009/12/dual-booting-demystified/comment-page-5/#comment-611
Thanks for adding yours as well it could prove useful to someone – particularly if they can’t get back into OS X at all for some reason.
Hello.
I have donde what your tutorial said but when I select the Windows partition to load Windows 7 and error ocurs and no continue loading the SO.
I have donde the tutorial steps two times and continue without working W7. The “myHack” can select the Windows partition but allways gives up an error and tell me reinstall Windows or load the Windows CD to fix the error.
Any help?
Thanks a lot!
Just a note that earlier message today doesn’t apply as I am able to access internet now,literally but had to use usb slinstall with this drive. I did notice on other hd that dual boots sl and xp states chameleon 2.0 RC4_pcefi10.5 1.0r111 3/4/10 purple galaxy background. This particular hd states chameleon 2.0 RC3 9/20/09 snow leopard background. Also I do not leave hd not installed in case. Just swap out each time. Mb is the es2lv2.0 gigabyte. Thanks again.
doc: Could you rephrase your query? I am not completely sure what you are stating/asking here.
Hello,
I followed every step listed above and everything worked fine until I repaired the MBR to boot into the loader. I then selected the windows 7 partition and it showed a missing BOOTMGR… Any idea how to fix that? I am able to log into os x with no problem, but not 7.
Thanks!
Tony: Same instructions I gave to Ferrer, here is an article for the both of you which describes the process of repairing win7 in detail: http://www.howtogeek.com/howto/windows-vista/fixing-bootmgr-is-missing-error-while-trying-to-boot-windows-vista/
Hello, thanks a lot for your work.
I have a “small” problem.
I have instaled SL without problem, i have instaled Windows 7.
I when the computer reboot, windows start. but when a have changed the active partition on osx, when i chose to start with Windows, the computer pront i have to re-install windows?
Any idea??
thanks again
Ferrer: A similar thing used to happen with vista, I’m not sure if it’s the same here – since I’ve never seen this error with win7 (I use these exact instructions to run my own dual-boot). The solution with vista was to run a ‘repair install’ using the windows installation dvd – this does not actually wipe out your existing installation, it merely repairs the operating system files that are broken (if any). You can find instructions on how to do this thorough microsoft’s website.
Haven’t been able to boot without usb slinstall. ‘xp’ on disk0s3. Will this guide work changing mbr of xp and the ‘sl’ disk0s2 not booting on its own yet? Thanks.
doc: The information here should also apply (somewhat) to XP/SL dual booting (aside from the post installation registry fixes and differences in the way XP utilizes the MBR)… Are you sure that you have installed chameleon to disk0s2 (SL Partition) & set it to active using fdisk?
after 3 months, I had to reinstall my system and here is what I have done:
I use GUID because I have TimeMachine partition in the same physical drive and
TM gave a warning that GUID partition scheme will ensure proper backups.
install snow leopard, install chameleon, install windows 7
then, boot into win7 and run diskpart
change active partition to osx. reboot and should boot up into chameleon.
This worked when “fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory” happened after installing windows 7.
If doesn’t work, boot into osx using usb and reinstall chameleon, boot with win7 DVD
first marking win7partition active(makes win7 installed partition recognizable by
repair program) then click startup fix -> reboot->diskpart->mark osx active.
Great page, thanks. I’m about to start on my 3rd dual/triple boot machine, this time with Empire EFI and myhack, so I’ll take care with your tips.
Minor nitpick on the Linux time correction, I would use
sudo ln -s /usr/share/zoneinfo/Your/Timezone /etc/localtime
as Your/Timezone can likely be modified with updates for eg. change in boundary or more likely change in dates for Daylight Saving. The symlink keeps you locked with those changes.
Hey !
Sorry didn’t mention my config :
My Win 7 x64 installation is on a 2x1tb RAID drive setup, I have a separate SATA drive I want to use for OSX SL. I just don’t want to mess up my current Win 7 x64 install !
Plz Advise !
Steve: Simple answer here would be to use your motherboard’s boot menu. Other options include configuring Win7 to use software raid instead of the crappy pseudo ‘hardware’ raid in your bios (which is still soft raid ultimately, though without any of the benefits of soft raid) and using the other SATA device as a bootloader w/ chameleon or grub installed and/or using a small USB stick as a boot device.
Hey Again :
I know I shouldn’t ask but I will anyway …
If I already have Win 7 installed and don’t want to mess it up coz it’s on RAID, how do I go by Dual Booting with OSX ?
Sorry, i forgot to post my specs, if thats actually needed. Lenovo 3000 G530 250 GB hard drive pentium dual core. your myhack installer is wonderful and allowed me to install vanilla snow leopard on both my machines. Thank you so much.