Ubuntu – Booting into a Windows10 Virtual Machine using physical disc from Ubuntu Virtualbox host

bootvirtualbox

I've Ubuntu 14.04 Host machine with Virtualbox installed.

I've a SATA hard disc with windows 10 installed. I want to boot into the windows OS via a virtual machine created in my Ubuntu server.

parted -l output is as below:

Model: ATA ST1000LM024 HN-M (scsi)
Disk /dev/sdc: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags
 1      2097kB  1050MB  1048MB  ntfs         Basic data partition          hidden, diag
 2      1050MB  1322MB  273MB   fat32        EFI system partition          boot, hidden
 3      1322MB  2371MB  1049MB  fat32        Basic data partition          hidden
 4      2371MB  2505MB  134MB                Microsoft reserved partition  msftres
 5      2505MB  959GB   956GB   ntfs         Basic data partition          msftdata
 6      959GB   959GB   523MB   ntfs                                       hidden, diag
 7      959GB   986GB   26.8GB  ntfs         Basic data partition          msftdata
 8      986GB   1000GB  14.3GB  ntfs         Basic data partition          hidden, diag

I've created the rawvmdk file using the following:

VBoxManage internalcommands createrawvmdk -filename "/media/wde/VirtualBox VMs/Lenovo_Org_Win10.vmdk" -rawdisk /dev/sdc -partitions 2,4,5,7

As per the askubuntu question, I mounted the EFI partition and created the ISO image as follows

mount -t vfat /dev/sdc2 /media/winhd/
grub-mkrescue -o boot.iso winhd/*

EFI drive has following things:

root@p:/media/winhd# ls
BOOT  BOOTSECT.BAK  EFI  snapshots
root@p:/media/winhd# ls BOOT
boot.sdi
root@p:/media/winhd# ls EFI/
Boot  Microsoft  ubuntu
root@p:/media/winhd# ls EFI/Boot/
bkpbootx64.efi  bootx64.efi
root@p:/media/winhd# ls EFI/Boot/b
bkpbootx64.efi  bootx64.efi     
root@p:/media/winhd# ls EFI/Microsoft/
Boot  Recovery
root@p:/media/winhd# ls snapshots/
control_{00000000-0000-0000-0000-000000000000}.dat  layout_{00000000-0000-0000-0000-000000000000}.dat  snapshot_{00000000-0000-0000-0000-000000000000}.dat
root@phanuis1:/media/winhd# 

I added the ISO image in CD of the VM, added vmdk file as the harddisc, and when tried to boot, I am getting a screen with following message:"Minimal Bash like line editing supported…" and grub command prompt is displayed!

Best Answer

I don't know why that happens, but you should be able to boot Windows by running these commands in order:

        chainloader (hd0,2)/efi/Microsoft/Boot/bootmgfw.efi
        boot

(hd0,2) here is the refferer to the EFI partition Also make sure to enable EFI boot, but from your Question I can see, that you probably do.

Related Question