Windows 7 on Mac OS X through Virtual Box

Using Windows 7 installed in a Bootcamp partition from Mac OS X simultaneously

This guide will help you set up access to your Windows 7 installation directly from Mac OS X.  You can follow this simple guide without technical knowledge and get your Windows 7 Virtual Box, up and running without any hassle.  What all you need to do is, “Follow the guide blindly”.

Software Required: Virtual Box 3.2.6 or later

Time Required: 30 mins

Things we will do in this guide:

  1. Prepare the Mac system for installation
  2. Configure Virtual Box for the first boot
  3. Install Virtual Box Guest Additions for seamless full screen usage
  4. Install Audio Drivers in Windows 7
  5. Use connected USB Devices in Windows 7
  6. Setup Shared Folder between Mac and Windows 7 and access it
  7. FAQs
    1. Virtual Box Errors
    2. Fatal: No Bootable Medium Found! System Halted.
    3. Windows “Blue Screen of Death”
  8. References

Read the complete post 

This entry was posted in Technology and tagged , , , . Bookmark the permalink.

66 Responses to Windows 7 on Mac OS X through Virtual Box

  1. Andre says:

    Very well-written article!

    Do you suppose this would work with Windows XP as well?

    Thanks!

    • luckyviplav says:

      It works the similar way for Widows XP, as Windows XP is pretty similar to Windows 7 for Virtual Box. If you face any problems, let me know.

      • Fastgalix says:

        Hi,

        First of all : very good post =D; congrats !
        Then the troubling part; I am running the latest version of virtualBox (3.2.12 r68302) and I am trying to make it work with my bootcamp partition. Everthing works fine up until I start it; at this moment I get a message of the type “Windows could not start becaus of a computer disk hardware configuration problem… Check boot path and disk”. My IDE controller type is set on ICH6 and my vmdk is correctly attached to my VM (in the Virtual Media Manager).

        Have you encountered this problem and/or can you help me?

        Thanks a lot

  2. Anonymous says:

    Thanks for the instructions! This succeeded at booting after I created a VM as “Windows 7 (64 bit),” which seems to set “Enable IO APIC” under Settings->System->Motherboard.

  3. jane says:

    All these issues are important, and that’s why I just started blogging a while ago and it feels great

  4. Ben says:

    This is almost working for me. I got up to the end of part 2, but when I try to start the Windows virtual box, it says “Windows is loading files…” with a progress bar that fills up twice and then it goes back the the VirtualBox bios screen and starts over with the progress bars. I am running Windows 7 64bit and Mac OS X 10.6.4 with VirtualBox 3.2.8. Any ideas?

    • luckyviplav says:

      Check whether you have completed the following steps or not.

      1. Select your “Windows 7” Virtual Machine
      2. Click on “Settings”
      3. Click on “Storage” Tab
      4. Select IDE Controller
      5. Click “Add Hard Disk” which will directly add your “win7raw.vmdk”
      6. In the “Attributes” column of “Storage” tab, set “Type” as “ICH6”
      7. Click “Ok”

      This should solve the problem. If this doesn’t solve your problem, please let me know 🙂

  5. Ben says:

    This does not fix my problem. If there are any other information I can provide, let me know.

    • Bart Masschelein says:

      I have the same problem. I have a Windows 7 RC version installed on BootCamp, that I even did not use anymore for several months. Don’t know if that has anything to do with it…

  6. Lance Huang says:

    Thanks for the article. After all these were done, can I still boot my Windows7 from BootCamp directly?

  7. Julian Sammy says:

    I get stuck in an endless reboot cycle. I’m on an SSD. When I start up the win7raw.vmdk disk, it says “Windows is loading files…” twice (progress bar goes by fast, then slow), and then back to the VirtualBox splash screen. Infinite (to my patience) loop follows.

    Help? My settings do match the screens and text above, as far as I can tell.

    • Ben says:

      That is exactly what I am getting, and I’ve still not found a solution. If anyone figures this out, please post your solution here.

      • Atreat says:

        I’m getting the same problem. Are you still in the same boat? or have you figured this out. I tried switching to 64 bit but that didn’t do anything. Sometimes I get a “starting Windows” screen but it either freezes there or goes to the loading files loop.

      • Atreat says:

        I got it going. My problem was that I removed the SATA Controller. So the setup I have that works is the IDE controller set to my win7raw.vmdk file as Primary Master Slave. I then have a SATA controller with nothing under it.

  8. Bob Williams says:

    Nice method, but I only got as far as here :

    $sudo VBoxManage internalcommands createrawvmdk -rawdisk
    /dev/disk0 -filename win7raw.vmdk -partitions 3

    I got a syntax error notice “invalid parameter” on -rawdisk/dev/disk0

    • luckyviplav says:

      The command should not be split in to 2 different lines. You might have faced the problem because you might have copied the command and pasted it in the terminal. Make sure that you type command in a single line. I have updated that section for your convenience and you can now directly copy-paste the command.

  9. Aernative says:

    those stuck in an infinite loop I have the answer for you – make sure you have chosen the correct OS type i.e. in vbox settings for os-type select 64 bit and it will boot!

    • Julian Sammy says:

      All settings conform – 64 bit Windows 7, IDE, etc. Still have the 2-cycle ‘loading files’ and restart. PIIX4 and PIIX3 don’t work either, nor does turning “Use host I/O cache” on and off. Something new, though: I get to the windows error recovery screen with two options: “Launch Startup Repair” or “Start normally”.

      I have also tried adding the vmdk as a SATA drive (host I/O cache on and off). I’m working my way through other options now.

      FRUSTRATION!

      • brockhold says:

        I don’t know if you get updates for new comments; and I hate to resurrect long-dead threads, but did you get this working? I am having the same issue.

      • brockhold says:

        I should have tested more options before posting.
        I was able to get the VM to boot (all the way to desktop, which I am assuming means everything is working so far) after changing the chipset (under system tab) to ICH9.

      • luckyviplav says:

        Hey Ben,

        Good to know that it worked for you.

        Regards,

        Viplav

    • flyNflip says:

      Using Lion and Win 7 64 bit. You tip worked for me to end this infinite loop. I realize this is an old comment, but wanted to say thanks anyway. Just as a side note: I did put my win7raw.vmdk under IDE as ICH6 as Master and deleted the win7raw.vmdk under Sata (Did not delete the Sata connector itself.) Thanks again. Now on to the important stuff 🙂

  10. Aerin says:

    Okay, so far so good, but I can only get as far as changing the Storage settings. My screen looks just like the screenshot, but I still have “Invalid settings detected” at the bottom, and the OK button is greyed out. Ideas? Is there something I’m missing?

    • Aerin says:

      Oh, and I didn’t change any of the other settings, so it should all be default. I tried deleting and recreating the VM, same deal.

      • eric says:

        I know this particular issue is from last year, but I’ve got the latest VB for the Mac (4.1.0 r4279) and am having this same “invalid settings”/greyed out problem which seemed to pop up after nothing at all; i.e., I was using the Windows 7 vm quite well and then I start seeing this error message.

        Since I can’t “OK” the dialog box, I can’t make changes like surface my USB ports/devices.

        Has anyone seen this same problem? any solutions?

      • Slim says:

        I have the solution to this problem. Boot up your VM once done, go to your locate “Devices” and look for in that list “Enable Remote Display” (I’m running Mac OS X 10.6.8 so I’m sure it is different depending on your OS, my VM is Windows 7 32bit). Uncheck the “Enable Remote Display” and then shutdown your Virtual OS and go to your VirtualBox settings and Voila, “Invalid Settings Detected” message is gone and you can now edit your settings. That solved the problem for me at least.

  11. meh says:

    I suffered the same reboot-loop, but fixed it by selecting 64-bit win 7 is the guest OS.

  12. 網路行銷 says:

    Thanks for the informative article, it was a good read and I hope its ok that I share this with some facebook friends. Thanks.

  13. chris says:

    I was able to get this to work, but I got a BSOD until I used “PIIX4” instead of “ICH6” for “Type”.

    I am using:
    VirtualBox 3.2.12
    Macbook 1,1 (late 2008)
    OS X 10.6.5

    • Adam says:

      Thanks, Chris! I was stuck for hours starting to boot and then blue-screening until I tried using IDE with PIIX4. I kept getting the blue-screen with “STOP: 0x0000007B (0x80D86B58, 0xC0000034, 0x00000000, 0x00000000)” with all other drive configurations (IDE with ICH6, SATA, etc). PIIX4 works fine though!

  14. Terry says:

    Help..
    Using VB 4
    Followed instructions.
    Once I selected the win7raw.vmdk file I had the following error

    Failed to open the hard disk.
    The medium ‘/win7raw.vmdk’ can’t be used as the requested device type.

    Result Code: NS_ERROR_FAILURE (0x80004005)
    Component: Medium
    Interface: IMedium {9edda847-1279-4b0a-9af7-9d66251ccc18}
    Callee: IVirtualBox {d2de270c-1d4b-4c9e-843f-bbb9b47269ff}

    Not sure what to do now.

    Many thanks in advance.

  15. commorancy says:

    Terry,

    I’m seeing this same error “can’t be used as the requested device type”. Looks to me like VirtualBox 4 has broken the ability to use raw devices. Looks like we need to report this as a bug. I’m hoping it gets fixed soon as I need to use a raw device with Virtualbox 4. Looks like I’ll have to roll back to Virtualbox 3 until they get this issue fixed.

    • John Karlen says:

      Hi

      yeah, I’m having the same problem. There was no option to “add”, after I clicked what I think is the “browse” button, in step 5(a) and 5(b) of “2. Configure Virtual Box for the first boot”. On the 1st try it let me select the .vmdk file, but now I am getting the “The medium ‘/Users/JK/win7raw.vmdk’ can’t be used as the requested device type.” error

      thanks

  16. Julian Sammy says:

    OMG WAITAMINITE! I think I’ve got it working with my SSD! I just changed my chipset. The options were PIIX3 and IDH9 – I can’t tell you which one I switched to, because I can’t see the settings right now. I got past the boot cycle and into ‘Startup Repair’; Windows is busy doing that right now (‘Attempting repairs…’) and I want to give it some time before I hit cancel or try to do a graceful shutdown.

    Let me know if this works for any of you SSD people out there.

  17. Julian Sammy says:

    Okay, a new question. I followed all the instructions in step 1, altering my /etc/rc.local file. The changes aren’t sticky, however; when I reboot, the BOOTCAMP volume is mounted, and I have to manually run the sudo unmount… and sudo chmod… commands.

    Also, windows seems to decide that it needs to re-authenticate itself when I reboot into BOOTCAMP native, and then back to BOOTCAMP virtualized. Any ideas about that?

  18. Pingback: phaq » Blog Archive » Sharing Windows 7 between Boot Camp and VirtualBox

  19. tune1133 says:

    I am running VB 4.0.4 right now and the settings:

    Select your “Windows 7” Virtual Machine
    Click on “Settings”
    Click on “Storage” Tab
    Select IDE Controller
    Click “Add Hard Disk” which will directly add your “win7raw.vmdk”
    In the “Attributes” column of “Storage” tab, set “Type” as “ICH6”
    Click “Ok”

    was not valid anymore. The type of Storage that I had for mine is now the original settings (IPX4 if I’m not mistaken), which I suspect might be due to the changes that I did using this instruction: http://forums.virtualbox.org/viewtopic.php?f=8&t=39174

  20. Martin says:

    Got this going, the “Win7 64-bit” was the final piece of the puzzle. Worked in SATA mode as well but kept freezing on shutdown or reset. Switching to ICH6 IDE seemed to sort it.
    Also, someone mentioned elsewhere on the net that rc.local needs to be executable, a sudo chmod +x /etc/rc.local sorts that.

    OSX 10.6.7 (running 32-bit kernel but supports 64-bit apps)
    VirtualBox 4.0.6
    Windows 7 Professional SP1 64-bit (on a second hard drive formatted with one partition).

    Just hope the Windows reactivation each time I switch between virtual and physical doesn’t cause a problem. TWO sets of hardware Microsoft, not two hundred!

  21. claudio says:

    Hi all same problem with infinite loop… after some try I got it work. Here the settings required:

    General -> OS Type on 64 bit (didn't pay attention ;p )
    System -> chipset: ICH9  with  extended features IO APIC checked
    Storage -> IDE ICH6 and  I/O cache not checked
    
  22. Terry says:

    Hi,
    Being away for a while I thought I would have another go.

    After creating the two vmdk files [which have a file size of 4 KB on disk (641 bytes) correct?]

    When I typed
    $sudo chown MYUSERNAME *.vmdk
    I got the following reply
    chown: win7raw-pt.vmdk: Operation not permitted
    chown: win7raw.vmdk: Operation not permitted

    Have I done something wrong? Should I uninstall my latest version of Virtual box and instal an earlier version? If so which version.

    Many thanks in advance, regards

    • tune1133 says:

      Did you actually write “$sudo” or “sudo”? If you did “$sudo” it won’t work, you should try using “sudo” as in: “sudo chown MYUSERNAME *.vmdk”. This will prompt the terminal to ask for your own password. Hope this will help.

      • Terry says:

        Hi Tune1133
        That worked, but when opening win7raw.vmdk in VBox I got the following
        Failed to open the hard disk
        (location of the file)

        The medium (location of the file) can’t be
        used as the requested device type.

        Should the files be stored in the root directory of C drive?
        Thank you in advance

        Kind regards

  23. Terry says:

    Here is the details if that helps…

    Result Code:
    NS_ERROR_FAILURE (0x80004005)
    Component:
    Medium
    Interface:
    IMedium {9edda847-1279-4b0a-9af7-9d66251ccc18}
    Callee:
    IVirtualBox {d2de270c-1d4b-4c9e-843f-bbb9b47269ff}

  24. Philipp says:

    Thanks a lot for this great post!

    Really helped me to get what I always dreamed of!

    🙂

  25. Ibrahim says:

    thanks slim, you saved my day

  26. Marcos Vives says:

    A note for those that are getting this error:
    Failed to open the hard disk.
    The medium ‘/win7raw.vmdk’ can’t be used as the requested device type.

    Result Code: NS_ERROR_FAILURE (0×80004005)
    Component: Medium
    Interface: IMedium {9edda847-1279-4b0a-9af7-9d66251ccc18}
    Callee: IVirtualBox {d2de270c-1d4b-4c9e-843f-bbb9b47269ff}

    As per Windows 7 limitations, you have to run VirtualBox as administrator to have access to raw devices

  27. Brian says:

    BTW, Please be aware that if you use your Bootcamp windows install in a VM such as VirtualBox, and install the DirectX part of VirtualBox, it will replace some D3D8.dll, D3D9.dll(s) 32 bit AND 64 bit on your bootcamp Win install. This got me, and wish I had known this. I boot to actual windows to play games (only) and NONE of my games would work (hadn’t been in bootcamp in a long time, but then Skyrin came out and my wife HAD to get it. Took me a while, but I found Oracle owned dll’s in my SysWOW64 and System32 folders. FIX: Use 7-zip to extract the DLLs from my Win 7 DVD and replace the Oracle ones in my system32 and sysWOW64 folders.

    Hopefully this will help someone in the future. If you run dxdiag while in bootcamp and every thing is enabled, but when you print the results, you will get a D3D error stating that it is compiled with the wrong headers.

  28. Hi there, the whole thing is going fine here and ofcourse every one is
    sharing information, that’s truly excellent, keep up writing.

  29. I am sure this post has touched all the internet visitors, its really really good post on building up new web site.

  30. Weldon says:

    Ridiculous quest there. What happened after? Take
    care!

  31. grace says:

    Hi, I had everything working fine and a friend installed a shared printer in Windows and now I get the loop. Windows tries to start and repair but nothing. I deleted the only snapshot I had and now I don’t know what to do. Can I fix this with a windows 7 cd and choose the command line when windows starts? What should I write?

  32. declanraj says:

    Hi there… when I try to add the .vmpk file I get the following error; Any ideas?

    Failed to open the hard disk /Users/decr/win7raw.vmdk.

    Permission problem accessing the file for the medium ‘/Users/decr/win7raw.vmdk’ (VERR_ACCESS_DENIED).

    Result Code: VBOX_E_FILE_ERROR (0x80BB0004)
    Component: Medium
    Interface: IMedium {29989373-b111-4654-8493-2e1176cba890}
    Callee: IVirtualBox {3b2f08eb-b810-4715-bee0-bb06b9880ad2}
    Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

Leave a reply to meh Cancel reply