Page 1 of 1

Dual boot Ubuntu/Win10. Booting Win10 with rawdisk hangs with underscore

Posted: 21. Nov 2019, 04:20
by jkane13
I have a new Dell Inspiron 17 7791 2 in 1 laptop. I have gotten Ubuntu and the existing Win 10 to dual boot. Now I want to run the Win 10 partition as a guest in Ubuntu.

I have a desktop I did this with a couple of years ago. Although, that is plain old bios and not EFI. I did that because I was having problems getting EFI to work! Maybe that is my problem here too. Also, that was 2 SSD cards, and not 1 with separate partitions. So there were less moving pieces.

When I try to start the guest, it starts and only gets to an underscore and nothing more. The last thing in the log is:
00:00:03.292538 VMMDev: Guest Log: BIOS: Boot : bseqnr=1, bootseq=0002
00:00:03.297532 VMMDev: Guest Log: BIOS: Booting from Hard Disk...
I got this far doing this:
sudo VBoxManage internalcommands createrawvmdk -filename "/home/jeff/VirtualBox VMs/Windows/Windows.vmdk" -rawdisk /dev/nvme0n1p3
chown jeff:jeff Windows.vmdk
sudo usermod -a -G disk jeff
Reboot
A note: It seems like every other boot of the Ubuntu host, the device changes from nvme0n to nvem1n. Grrr. I keep editing the vdmk to set it right. That will be another thread later.
sudo parted -l
Model: H10 HBRPEKNX0202A NVMe INTEL 512GB (nvme)
Disk /dev/nvme0n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system  Name                          Flags
 1      1049kB  683MB  682MB   fat32        EFI system partition          boot, esp
 2      683MB   817MB  134MB                Microsoft reserved partition  msftres
 3      817MB   107GB  107GB   ntfs         Basic data partition          msftdata
 7      107GB   495GB  388GB   ext4
 4      495GB   496GB  1038MB  ntfs                                       hidden, diag
 5      496GB   511GB  14.4GB  ntfs                                       hidden, diag
 6      511GB   512GB  1319MB  ntfs                                       hidden, diag
I confirmed virtualization is on in the BIOS. I have tried using EFI in VirtualBox, but it boots to an EFI prompt only. Do I need to add other partitions to the vmdk for Dell Windows?

If you suggest using dd to make a mbr, I want to now what that is really doing. Will it break the existing dual boot?

So ,., any ideas around what do I need to do?

Re: Dual boot Ubuntu/Win10. Booting Win10 with rawdisk hangs with underscore

Posted: 21. Nov 2019, 19:14
by jkane13
Reading a bit more and trying to figure out the manual, it looks like I need to do this:
VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/nvme0n1 -partitions 1,3
My question is how to know which partitions I need. I assume 1 and 3? Do I need 2, 4, 5, and 6 also?

Then is going to be my next problem. It looks like Ubuntu keeps changing the device number between boots! :-O It swaps NMVe0 and NMVe1. I will have to figure out how to stop that.

Re: Dual boot Ubuntu/Win10. Booting Win10 with rawdisk hangs with underscore

Posted: 21. Nov 2019, 20:17
by scottgus1
Not having done raw disk on a Linux host, I wouldn't know much to advise.

BIOS or EFI in the guest is not related to whether the host PC is BIOS or EFI, The only thing defining whether the guest gets BIOS or EFI is what the guest OS wants or is already set up for.

Further, when folks have tried a P2V on a Windows PC, they've needed to take all the partitions that are used to boot the OS, usually the whole disk. I suspect such might be necessary with this raw-disk case: you'd need every partition that goes into booting the Windows OS. Since the boot loader for Windows has been changed to now point to Ubuntu's boot loader, I wonder if this is still possible. If you had two disks, it might have been easier. (Note this paragraph is probably balderdash, so some web searching with "site:forums.virtualbox.org" added to see what others here have done.)

One other thing: your Windows OS will see new "hardware" and need a reactivation. There may be ways to fake the DMI codes so the Windows OS thinks it's still booting on its physical hardware, this will need research too. See " Configuring the BIOS DMI Information" in the Virtualbox manual.

Raw-disk is an "expert" feature, which requires careful handling so the accessed data is preserved. Take good backups.

Re: Dual boot Ubuntu/Win10. Booting Win10 with rawdisk hangs with underscore

Posted: 21. Nov 2019, 21:19
by jkane13
All great points! My current desktop was with 2 separate SSD's, so the boot record was not a problem.

I am concerned that somehow what I am now trying to do will send me to the Grub that Ubuntu installed. Not sure how it will react. I don't need to have it get corrupted. Of course, I don't want to tell it to boot the Ubuntu host partition!

I went through the activation thing with my desk top a couple of years ago. I have comments in a thread here about that. Time was the only way to get the activation moved from the direct boot version vs the VirtualBox one. This time, I have not activated windows yet. I am waiting until I settle on what I have after all of this experimentation. My last time around, forcing the DMI codes did not work. Windows wasn't falling for it. ;-) It seemed to still know something changed enough to not all the activation key to work. Now I use Windows in a VM almost all the time, so that is activated. In the rare occasion that I need to boot directly to it, I let it complain about the activation key not being right.

I am not doing backups, yet. I have all fresh installs, and am re-installing when it gets hosed.

I hate to say this ... but for the first time I am thinking about using Windows as the host and running Ubuntu in a guest session. I want to exhaust all my options first though.

Re: Dual boot Ubuntu/Win10. Booting Win10 with rawdisk hangs with underscore

Posted: 21. Nov 2019, 21:23
by scottgus1
One thing I did discover is that the Grub loader is editable, so if you do have to go through Grub to get to Windows, you might be able to change the settings. Unless this Grub is also the loader that starts your host OS... :shock:

FWIW as a quick guess it's possible you'd need partition 2 as well.

Re: Dual boot Ubuntu/Win10. Booting Win10 with rawdisk hangs with underscore

Posted: 21. Nov 2019, 22:29
by socratis
jkane13 wrote:virtualization is on in the BIOS. I have tried using EFI in VirtualBox, but it boots to an EFI prompt only
That's to be expected. You can't take a hard drive that's meant to boot from BIOS, stick it in a EFI computer and expect it to work. Naganna Happen™...

If you use XYZ in real life, use XYZ in the VM Settings. Anything else is doomed to fail. Just like Scott said:
scottgus1 wrote:... what the guest OS wants or is already set up for.
jkane13 wrote:
-rawdisk /dev/nvme0n1 -partitions 1,3
I would personally try with:
-rawdisk /dev/nvme0n1 -partitions 1,2,3
Obviously "4" is your Ubuntu, stay away from that, and "5", "6", and "7" seem to be diagnostic partitions, I don't think that they are needed. They're most probably the OEM's partitions to restore order in the Universe if something goes really wrong.

Of course minus the HD going belly up, nobody thinks about this case these days, no "restoration" media anymore... :(
jkane13 wrote:I am not doing backups, yet. I have all fresh installs, and am re-installing when it gets hosed.
That was my plan too! Fresh larger disk, fresh installs, nothing to lose! Experimentation galore!!! :D
scottgus1 wrote:Unless this Grub is also the loader that starts your host OS
Yes it is. It is not a good idea to mess with your bootloader, unless you know what you're doing. I don't... ;)

Re: Dual boot Ubuntu/Win10. Booting Win10 with rawdisk hangs with underscore

Posted: 22. Nov 2019, 16:55
by jkane13
I tried partitions 1,2,3. Says no bootable media.

I think I am done. Going to give up. Too many problems this way. I am about to do the unthinkable. I will use Windows as the host O/S and run Ubuntu in a VirtualBox. I know that works. Already tested it. Although, it is slow when I do it. But, realistically, in this scenario, I am using Windows more than Ubuntu. Sadly, the things I plan to do with this 2 in 1 are mostly only supported in Windows.

It was a fun test. Wasting too much time on it though.