15

I have a separate Windows10 partition courtesy of Boot Camp Assistant.

I would like the option of cranking it up inside my OS X session using VirtualBox, as there are times I would like to use some Windows apps without doing a reboot.

I have found a few guides:

..but everything is rather out of date, referring to Windows 7.

I wonder whether maybe now the process is simpler?

Could anyone either detail or link to an updated process for Windows 10? (Or alternatively confirm one of the above as a best solution path...)


EDIT: putting up further research as I find it. Once I dig through it all I will upload my findings as an answer.

https://forums.virtualbox.org/viewtopic.php?f=8&t=19866&start=90#p290527 ^ (mid-2014)

http://danielphil.github.io/windows/virtualbox/osx/2015/08/25/virtualbox-boot-camp.html <-- better! Win10!

However following this guide I hit up against: enter image description here

Maybe ...

https://forums.virtualbox.org/viewtopic.php?f=8&t=58821&start=15#p343017 says: "I finally got this working for my Windows 10 Boot Camp install. You have to disable System Integrity Protection under recovery mode in order to get a write lock on /dev/disk0s1 (the EFI partition)."

?

http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/ <-- this didn't fix it

https://www.virtualbox.org/ticket/7811 <-- this did! But now I am here:

enter image description here

Googling gives https://askubuntu.com/questions/162148/virtualbox-machine-boots-to-efi-shell but turning off EFI as directed, now I get:

FATAL: No bootable medium loaded. System halted!

π


TODO: http://engineer.john-whittington.co.uk/2013/03/bootcamp-partition-virtual-boot-with-virtualbox/ ?

I've started a thread here: https://forums.virtualbox.org/viewtopic.php?f=8&t=75360

  • VMware Fusion does a better job and it's easier then VirtualBox in virtualizing the Boot Camp Partition, however I'd choose to just run Windows 10 as a normal file based VM, not using the BCP. It's far less problematic in the long run. – user3439894 Dec 23 '15 at 14:08
  • @user3439894 why is it less problematic in the long run? – ihake Apr 28 '16 at 17:26
  • @ihake, The problem with answering in a comment is the 600 character limit and I could easily go well over that answering that question. Suffice it to say, that I've been using VMware products for over 15 years and in particular VMware Fusion for 9 years, starting with the betas from before version one was release. As such I could probably write a book on it and a whole chapter alone based on my previous comment. IMO, when software manufactures provide product support and also host discussion forums for their product then these conversations are better carried out there, not necessarily here. – user3439894 May 4 '16 at 11:21
  • 2
    Did you ever get this working? – pat o. May 9 '16 at 18:43
  • If you’re willing to purchase Parallels Desktop, this is dead simple: you just create a virtual machine using your Boot Camp partition as the source. Might be worth it to avoid the hassle. – daGUY Jan 1 at 15:56
10

I also followed the guide at http://web.archive.org/web/20181103074214/http://danielphil.github.io/windows/virtualbox/osx/2015/08/25/virtualbox-boot-camp.html

I will add what challenges I had following that guide, but I was able to run my BOOTCAMP partition using VirtualBox, which is free, so I'm happy.

First, you should have installed:

  • Windows 10 x64 using the OS X Boot Camp assistant
  • VirtualBox 5.0.26 r108824

I also downloaded:

  • VBoxGuestAdditions_5.0.26.iso (I don't think this is necessary, but I did it just to be safe)

As far as Disabling SIP or System Integrity Protection on El Capitan (OS X 10.11), I skipped that part. It was not necessary in my case.

As far as setting drive permissions:

  1. I ran diskutil list to get a list of drives on my system, taking note of the drive number of the drive named EFI and the other one named BOOTCAMP, which in my case, the EFI drive was 1 and the BOOTCAMP drive was 4.
  2. I then ran the instructions to unmount my Bootcamp drive and set permissions so that VirtualBox could access the drive. According to danielphil, this needs to be performed each time one reboots.

    diskutil unmount /Volumes/BOOTCAMP

    sudo chmod 777 /dev/disk0s1 <--- This is the drive no. of the EFI disk

    sudo chmod 777 /dev/disk0s4 <--- This is the drive no. of the BOOTCAMP disk

As far as creating the VirtualBox image, the instructions are:

Run the following commands to create a VirtualBox disk image wrapper for >your HD. Substitute the 1,4 with the numbers of your EFI and BOOTCAMP >partitions as appropriate and put your OS X username in for >your_username_here. Make sure you are in the directory where you want to store the VirtualBox image, or you will have to move it later.

sudo VBoxManage internalcommands createrawvmdk -rawdisk /dev/disk0 -filename win10raw.vmdk -partitions 1,4
sudo chown your_username_here *.vmdk

As far as creating the VM, the guide was not so clear. Before I followed the instructions from the screenshots, I created a new virtual machine in VirtualBox, checking "Do not add a virtual hard disk".

creating the new virtual machine

Once created, I selected it and clicked on "Settings". At this point, I followed the screenshots in the guide. The only difference was that:

  • I did NOT check "Enable EFI (special OS only)"
  • I did NOT have the option to check "Enable VT-x/AMD-V"
  • I used the recommended base memory of 2048 MB, as I only have 8GB of memory
  • In the "Storage" tab under "Storage Tree", I had to:
    • click the "adds optical drive" icon under Controller:SATA to add the "VBoxGuestAdditions_5.0.26.iso" file I downloaded.
    • remove the "empty" image under Controller:SATA
    • Select the "Add IDE Controller" icon at the bottom
    • click the "adds hard disk" icon under Controller:IDE to add the vmdk file created
  • macOS Sierra 10.12.1, MacBook Pro Retina 13", Early 2015 model: I had to enable EFI to get this to work with Windows Server 2016 Essentials x64. Just putting that out there. Otherwise, step-for-step, this worked great. Thanks! – eckza Dec 9 '16 at 3:15
  • I've disabled EFI and SIP, but I always get VBoxManage: error: Cannot read the partition information from '/dev/disk0', any ideas? – drye Jan 29 '17 at 8:35
  • drye, not sure, cuz I'm no expert. If I had to guess, I'd say you're specifying the wrong partition. Mine was /dev/disk0s1 and /dev/disk0s4 when I ran diskutil list to get my EFI and BOOTCAMP partition. You specify /dev/disk0 which makes me think that's what's wrong. – David Herrera Jan 30 '17 at 18:57
  • @drye the problem seems to be related to recent Macbook Pros. See this thread: forums.virtualbox.org/viewtopic.php?f=8&t=82508 – TheNextman Jul 6 '17 at 17:35
  • I was able to boot my Boot Camp partition after a couple of tries; I had to disable SIP just to create raw vmdk and then re-enabled it. One serious issue, though: after installing VirtualBox guest additions in VM, I'm no longer able to boot Windows natively. Uninstalling them, everything starts working again. Is there a way to disable VirtualBox guest additions when booting windows partition in Boot Camp? – mzf Apr 4 '18 at 17:02
3

For the benefit of others, I managed to get this working. This is on Mojave by the way.

  1. I had to disable SIP in order to create the VMDK. It just wouldn't create the VMDK until I had disabled SIP (to disable SIP you have to boot your Mac in recovery mode by holding Command+R on start up, then when you're in recovery you open a Terminal - the option is within one of the Menu Bar drop-downs - then you type in csrutil disable).
  2. When I created the VMDK it actually created two of them. The one without the "-t" extension is the one that VirtualBox seems to understand.
  3. I could only get the VM to boot by enabling EFI within VirtualBox's settings (go into the settings for your Windows 10 VM, select the "System" tab which is the second along the top row, and at the bottom of the "Motherboard" pane there is a checkbox saying "Enable EFI (Special OSes only)".

After this, it did boot. Whether it still boots after re-enabling SIP I don't know, but I think it would going by the comments here. I think disabling SIP is only necessary for creating the VMDK. But I haven't tested running the VM after re-enabling SIP.

And I probably won't test that, because unfortunately the VM performance is pretty terrible. The reason I did this whole thing was to try and play Halo (a relatively old game released in 2003 on the PC, but still a 3D game) from my Windows partition inside the VM. So that I wouldn't have to reboot into my Windows partition to play it. Halo does have a Mac version, but it won't work on Catalina since Catalina has dropped support for 32-bit apps, which is why I was trying this. But yeah, the performance was... terrible. About 1 frame per second or even less. Maybe if I tweaked the settings it might work better but it seems pretty rubbish. I even managed to run this game using Wine and it gave me perfectly smooth performance, even though it made my CPU run at a constant 80+C even with fans manually set to full speed. So Wine, for this, seems to be better than VirtualBox.

But if you need to get your Windows Boot Camp partition running with Virtual Box just for maybe testing a website in IE or something then this solution could work. I was able to boot Windows and while Halo ran very badly, the OS itself didn't run that badly.

2

I followed this guide: http://web.archive.org/web/20181103074214/http://danielphil.github.io/windows/virtualbox/osx/2015/08/25/virtualbox-boot-camp.html

I did not follow the instructions to disable SIP, and kept EFI mode on. It worked fine.

  • 2
    Welcome to Ask Different. We like answers to be more than just a single line. Ideally, you want to explain why your answer is *right." It also helps to provide links, citations, and/or screen shots. Please review our help section How to Answer on writing good answers to questions – Allan Jun 29 '16 at 22:58
1

Had the same issue and found a solution: just uncheck "Enable EFI" in the VM settings (OS X 10.11.3 / Windows 10 / VBox 5.0.14). Disabling SIP was not necessary.

1

Just in addition, I use this kind of script placed in /usr/local/bin to start Boot Camp in VirtualBox:

#!/bin/bash
diskutil umount disk0s3
sudo chmod 777 /dev/disk0s3
sudo chmod 777 /dev/disk0s1
VBoxManage startvm "Win10"

And this to power it off:

VBoxManage controlvm "Win10" poweroff
sudo chmod 640 /dev/disk0s3
sudo chmod 640 /dev/disk0s1
diskutil mount disk0s3
  • Welcome to Ask Different! You might want to take a look at this Help Center article for some tips on how to format your post. – Glorfindel Jan 1 at 12:32
0

I also followed the guide at http://danielphil.github.io/windows/virtualbox/osx/2015/08/25/virtualbox-boot-camp.html, but unlike the top answer, I had to disable SIP and enable EFI on the VM to get it to run okay.

However, it's worth noting that although you have to do sudo chmod 777 /dev/disk0sX every time, you can disable SIP after setting up the VM and it will continue to work fine. I was a bit dubious about permanently disabling SIP, and I'm glad that I don't actually have to.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .