Boot Windows 10 from SSD drive

Discussions related to using VirtualBox on Mac OS X hosts.
Osmack
Posts: 4
Joined: 29. Jul 2018, 11:10

Boot Windows 10 from SSD drive

Post by Osmack »


ModEdit; see the utility mentioned in "VBoxRawdisk - a macOS utility to generate rawdisk VMDKs"
Hi,

recently I prepared SSD with Windows 10, bootable via BootCamp according to this instruction:
https://9to5mac.com/2017/08/31/how-wind ... ive-video/

Now I would like to have an option to boot the same Windows via VirtualBox from macOS. I tried to create VMDK according to:
https://www.serverwatch.com/server-tuto ... ox-vm.html

however when I try to run it, "No bootable medium" is dispalyed in VirtualBox. I also tried to create a VDI image from SSD drive but with the same result.
My SSD drive boots properly when I run it through BootCamp.

Could anybody help with that? I run out of ideas.

I even tried to repair boot sector using Windows 10 ISO, but it doesn't work either.

Code: Select all

bootrec /fixmbr
works

but

Code: Select all

bootrec /fixboot
returns "Access denied" even though it shows that command line runs in administrator mode.

after that:

Code: Select all

00:00:04.609840 VMMDev: Guest Log: BIOS: Booting from Hard Disk...
00:00:04.610309 VMMDev: Guest Log: INT18: BOOT FAILURE
Last edited by Osmack on 31. Jul 2018, 18:26, edited 2 times in total.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Boot Windows 10 from SSD drive

Post by socratis »

Just to be clear, I'm not going to be searching for 3rd party URLs to see what they suggest. I want you to tell me what you did. Exactly.

For example the specific command for creating the VMDK makes the difference between night and day. And if we're talking about an external Win10 disk or a partition in your internal HD.

Do NOT mess with the MBR unless you know what you're doing. Otherwise I see in your near future a re-installation of Win10...;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX
Location: U S of A

Re: Boot Windows 10 from SSD drive

Post by ChipMcK »

socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Boot Windows 10 from SSD drive

Post by socratis »

ChipMcK, I'm willing to bet that these instructions will not work with today's OSX > 10.1x.y and the Win10 filesystem setups.

But, let's wait and see what the OP has to say, because I have the feeling that he's talking about an external "BootCamp" setup, just like I have.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Osmack
Posts: 4
Joined: 29. Jul 2018, 11:10

Re: Boot Windows 10 from SSD drive

Post by Osmack »

I have Windows 10 on external SSD (created using WinToUSB). I also made VDI from the hard disk, but the result is the same.

Command used to create VMDK:

Code: Select all

VBoxManage internalcommands createrawvmdk -filename "</path/to/file>.vmdk" -rawdisk /dev/disk2
Then I just created Windows 10 (64 bit) in VirtualBox using VMDK file.
I also tried this one, with the same result:

Code: Select all

FATAL: No bootable medium found! System halted!
Last edited by Osmack on 1. Aug 2018, 00:33, edited 2 times in total.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Boot Windows 10 from SSD drive

Post by socratis »

So, to recap:
  • You have an external HD in which you installed Win10 with WinToUSB. The latter requires Windows to run. How did you do it? In a VM? (that's how I did it)
  • You use this HD to also boot your Mac? If so, the Win10 uses EFI, or actually it should use EFI if you set it up properly. Did you?
  • I'll need to see the contents of the VMDK.
In my case, I have an external HD with Win10-64, EFI based, which can boot my MBP, but can also run as a VM with the VMDK rawdisk option.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Osmack
Posts: 4
Joined: 29. Jul 2018, 11:10

Re: Boot Windows 10 from SSD drive

Post by Osmack »

socratis wrote:You have an external HD in which you installed Win10 with WinToUSB. The latter requires Windows to run. How did you do it? In a VM? (that's how I did it)
Yes, I used VM.
socratis wrote:You use this HD to also boot your Mac? If so, the Win10 uses EFI, or actually it should use EFI if you set it up properly.
Yes, I boot it from Mac by setting this HD in "Startup Disk" application. I'm not sure about EFI part. According to tutorial I set "200MB EFI partition".
socratis wrote:I'll need to see the contents of the VMDK
I tried to create VMD for /dev/disk2 and /dev/disk2s

Code: Select all

MacBook-Pro:~ my$ sudo vboxmanage internalcommands listpartitions -rawdisk /dev/disk2
Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
1       0x00  0   /0  /0   0   /0  /0            200           40
2       0x00  0   /0  /0   0   /0  /0         243997       411648 

MacBook-Pro:~ my$ sudo vboxmanage internalcommands listpartitions -rawdisk /dev/disk2s1
Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)

MacBook-Pro:~ my$ sudo vboxmanage internalcommands listpartitions -rawdisk /dev/disk2s2
VBoxManage: error: Overlapping MBR partitions
Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
1       0x72  80  /13 /10  371 /101/51        886821   1920221984
2       0x6c  357 /43 /4   367 /32 /52        953932   1936028192

/dev/disk2:

Code: Select all

sudo VBoxManage internalcommands createrawvmdk -filename "/Users/my/Documents/Windows10.vmdk" -rawdisk /dev/disk2

Code: Select all

# Disk DescriptorFile
version=1
CID=437ec59f
parentCID=ffffffff
createType="fullDevice"

# Extent description
RW 500118192 FLAT "/dev/disk2" 0

# The disk Data Base 
#DDB

ddb.virtualHWVersion = "4"
ddb.adapterType="ide"
ddb.geometry.cylinders="16383"
ddb.geometry.heads="16"
ddb.geometry.sectors="63"
ddb.uuid.image="0489d5da-48dd-4008-b5f7-835dc0c2f6c4"
ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
ddb.uuid.modification="00000000-0000-0000-0000-000000000000"
ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"
and /dev/disk2s2:

Code: Select all

sudo VBoxManage internalcommands createrawvmdk -filename "/Users/my/Documents/Windows10.vmdk" -rawdisk /dev/disk2s2

Code: Select all

# Disk DescriptorFile
version=1
CID=da71997e
parentCID=ffffffff
createType="fullDevice"

# Extent description
RW 499705856 FLAT "/dev/disk2s2" 0

# The disk Data Base 
#DDB

ddb.virtualHWVersion = "4"
ddb.adapterType="ide"
ddb.geometry.cylinders="16383"
ddb.geometry.heads="16"
ddb.geometry.sectors="63"
ddb.uuid.image="bfd65a3d-9545-42ee-b975-b6533d65fa14"
ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
ddb.uuid.modification="00000000-0000-0000-0000-000000000000"
ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"
ddb.geometry.biosCylinders="1024"
ddb.geometry.biosHeads="255"
ddb.geometry.biosSectors="63"
Then I set chmod 777 for /dev/disk2* and my VMDK file. When I try to run VMDK for /dev/disk2s2 I get this error:

Code: Select all

VD: error VERR_NOT_SUPPORTED opening image file '/Users/my/Documents/Windows10.vmdk' (VERR_NOT_SUPPORTED).
VD: error VERR_ACCESS_DENIED opening image file '/Users/my/Documents/Windows10.vmdk' (VERR_ACCESS_DENIED).
Failed to open image '/Users/my/Documents/Windows10.vmdk' in read-write mode (VERR_ACCESS_DENIED).
AHCI: Failed to attach drive to Port0 (VERR_ACCESS_DENIED).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
And when I change controller from SATA to IDE, it starts, I see blinking underscore and that's it. The last entry in logs:

Code: Select all

00:00:04.149517 VMMDev: Guest Log: BIOS: Booting from Hard Disk...
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Boot Windows 10 from SSD drive

Post by socratis »

You need to create the VMDK for the whole disk /dev/disk2. You already have that. Great!

Now, your problem is that you most probably you're not creating the VM around the VMDK correctly. The primary change that you got to make is to enable EFI, because that's what your HD is set to boot with. You should also change the chipset from PIIX3 to ICH9.

Next you need to change the disk permissions:

Code: Select all

sudo chmod og+rw /dev/disk2
And you need to eject the disk from the desktop.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Osmack
Posts: 4
Joined: 29. Jul 2018, 11:10

Re: Boot Windows 10 from SSD drive

Post by Osmack »

Wow! It worked, thank you very much, you saved my life :) I was fighting with it for over one week!

One more question: is it possible to achieve the same level of clarity (sharpness) as if booted via BootCamp? When I boot via BootCamp fonts quality is really good. When using VirtualBox it's not so impressing, even with installed Guest Additions.
Last edited by Osmack on 1. Aug 2018, 01:48, edited 1 time in total.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Boot Windows 10 from SSD drive

Post by socratis »

Osmack wrote:the same level of clarify (sharpness)
I'm not sure what you refer to. I got the same sharpness in native and in VM mode. Maybe you need to adjust something in Windows?

Actually, scratch the maybe. I'm positive. My 2880x1800 (native resolution) is too small for me. So, I adjusted Win10 to be 1920x1200 (native) and I get the same sharpness, as when booted in VM mode where Win10 is 1280x1024.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Tesla1856
Posts: 11
Joined: 17. Aug 2018, 00:52
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows-10 64bit
Location: Texas, USA

Re: Boot Windows 10 from SSD drive

Post by Tesla1856 »

Osmack wrote:
is it possible to achieve the same level of clarity (sharpness) as if booted via BootCamp? When I boot via BootCamp fonts quality is really good. When using VirtualBox it's not so impressing, even with installed Guest Additions.
No, not seeing that here. It looks perfect. However, I just run my BootCamped Windows-10 in a VirtualBox window on my macOS desktop. I don't use Full-Screen or Scaled Modes.

Seems to me that the final window-size is determined by the screen resolution selected inside Windows. My scaling in Windows is set to 100%.
Mac-Mini (Late 2012) Intel-i5, 4gb RAM, SSD
Running macOS High-Sierra 10.13.x
BootCamp Windows-10 Pro 64bit (as a native "Option-Key" boot, directly against Apple hardware)
- Using VirtualBox v5.2.x to access this same Windows-10 install as macOS-Guest via RawDisk (sometimes, for lite uses)
Ninad
Posts: 16
Joined: 29. Feb 2016, 15:58

Re: Boot Windows 10 from SSD drive

Post by Ninad »

Hi socratis,

Thanks for your inputs. I am in a similar situation. I have same config for external drive as you mentioned in this post : viewtopic.php?f=8&t=88898#p426292

My host is windows 10 home. The vm chipset is ICH9. I could use WinPE to boot the vm and used a sata vmdk to create partitions and install/deploy windows. All went through fine. But after booting the vm goes into an indefinite pause state. Despite of that my pm boots fine (after removing guest additions). I tried with host I/O enabled and disabled. No luck. Am I missing something obvious here?

How do I interpret the logs? Are there any other logs apart from the local ones?

Thanks!
-Ninad
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Boot Windows 10 from SSD drive

Post by socratis »

Ninad wrote:I could use WinPE to boot the vm
I don't know what that is, I've never used it. All I used was the WinToUSB one.
Ninad wrote:the vm goes into an indefinite pause state
Have you managed to actually boot the Mac from this external hard drive? That should be your first priority, then you should start looking at the HD being used as a VM. And what does "infinite pause" mean? Maybe you didn't wait enough? It takes quite some time to boot a VM from an external USB3 HD.
Ninad wrote:How do I interpret the logs?
After years of practice and several thousands of logs, there's no "manual"... ;)
Ninad wrote:Are there any other logs apart from the local ones?
Apart from your local ones? Sure, I have some logs, but I'm not sure that they're going to help in your situation! :D

As I told the OP, you need to describe the procedure step-by-step, and I need to know your complete setup and the contents of the VMDK file.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Ninad
Posts: 16
Joined: 29. Feb 2016, 15:58

Re: Boot Windows 10 from SSD drive

Post by Ninad »

Hi socratis,

Thank you for your prompt and detailed response. Let me clarify each point :

1.
I don't know what that is, I've never used it. All I used was the WinToUSB one.
WinPE is Windows Preinstallation Environment. It's a Microsoft recommended tool just like WinToUSB, but far more versatile. I deployed all my windows vms images using WinPE.

2.
Have you managed to actually boot the Mac from this external hard drive? That should be your first priority, then you should start looking at the HD being used as a VM. And what does "infinite pause" mean? Maybe you didn't wait enough? It takes quite some time to boot a VM from an external USB3 HD.
I don't have a mac. It's a windows host. And yes, it's booting fine. The image is working perfect with the physical machine.

3.
As I told the OP, you need to describe the procedure step-by-step, and I need to know your complete setup and the contents of the VMDK file.
There you go! While writing first step I realised that I am using an ssd over usb. I think I should use a proper usb flash drive. Will work it out and let you know.

Thanks!

-Ninad
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Boot Windows 10 from SSD drive

Post by socratis »

Ninad wrote:I don't have a mac. It's a windows host.
Oops, you're right, you did mention that at some earlier post. :shock:
But, did you notice the section that you're in? "OSX hosts"? ;)

I'm a little bit hesitant to move the whole thread to the "Windows Guests", mainly because of the differences in the boot process between a Mac and a PC. Yes, in theory they should be similar. Maybe not so in practice. For the moment I'll keep the whole thread here and we'll see how it plays out...
Ninad wrote:While writing first step I realised that I am using an ssd over usb. I think I should use a proper usb flash drive.
Why would the medium kind be an issue? I don't think it is. I don't think that the bootloader cares particularly if you're booting from a flash, a HD, or a SSD. In fact, it couldn't care less, the interface is the same in all cases; USB.

Still haven't seen the VMDK or a VBox.log. ZIPPED of course...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply