17

I want to boot the Windows which is installed in laptop's internal harddisk(/dev/sda1) from the VirtualBox installed in my Ubuntu. Can somebody tell me how to do this in VirtualBox.

pradeepchhetri
  • 9,859
  • 12
  • 51
  • 59

5 Answers5

10

It can be done, but it is not recommended if you don't really know what you are doing:

Warning

Raw hard disk access is for expert users only. Incorrect use or use of an outdated configuration can lead to total loss of data on the physical disk. Most importantly, do not attempt to boot the partition with the currently running host operating system in a guest. This will lead to severe data corruption.

Anyway, you should look into VirtualBox documentation, in particular in Advanced storage configuration::Using a raw host hard disk from a guest.

enzotib
  • 50,671
  • 14
  • 120
  • 105
8

You can not directly run the Windows installed physically on a harddisk partition or on a different disk.

However, you can migrate the Windows installed on your physical computer to a VirtualBox virtual machine. I can not easily summarize the procedure because it is a little bit complicated, so yo can read the official documentation here: https://www.virtualbox.org/wiki/Migrate_Windows

Patkos Csaba
  • 2,500
  • 1
  • 20
  • 15
2

It can be done. I actually reinstall Windows on my hdd from VirtualBox while running Linux and then I am able to boot it normally.
Be careful though, mount your Windows partitions on Linux as READ ONLY so you don't mess things by trying to modify files from the 2 OS-es at the same time.

Here are two useful links:

https://forums.virtualbox.org/viewtopic.php?t=33356

http://www.rajatarya.com/website/taming-windows-virtualbox-vm

Mat
  • 51,578
  • 10
  • 158
  • 140
Alex Burdusel
  • 563
  • 4
  • 8
0

I know it's an old question but I faced myself struggling with this problem during this days. After many tries I ended up with a neat and clean solution:

  1. Boot the windows partition you would like to virtualize
  2. Download Disk2VHD utility from Sysinternals
  3. If you have a UEFI partition, follow this instructions
  4. Create a VHD (not VHDX) image of your C: partition, recovery, UEFI (if any) and whatever else you want
  5. Come back to linux, open VirtualBox and create a VM accordingly to your windows operating system specifications
  6. Attach to that VM the VHD disk created at point 4
  7. That's it
  8. Profit

Troubleshooting in case of UEFI:

  1. In the VM settings, in VirtualBox, check the option "Enable EFI" under System tab
  2. If you get stuck at the EFI Shell, run the following command:

    fs0:\EFI\Boot\bkpbootx64.efi

garlix
  • 101
  • 1
  • This is not the same thing as running the physical installation, you're creating an image from an actual installation (which can be useful, but is not what has been asked here). – Joachim Sauer Apr 17 '18 at 15:40
  • Yes, you're right I've misunderstood the question. I hope that my answer can be useful to someone else. – garlix Apr 18 '18 at 07:23
0

Create extra hardware profile on Windows an use that when booting it from the VM (with raw disk access)

It would help if the VM configuration is similar to the physical hardware...

Some dangers:

  • You should unmount the Windows disk before booting (as a minimum, rwmount it read-only)
  • You should not access the running OS's partitions from within the VM...

MS removed the option to choose a hardware profile when booting in Windows Vista though, so you might be limited to Windows XP or earlier... (unless you can get almost identical hardware to the VM configuration)

Gert van den Berg
  • 1,491
  • 1
  • 10
  • 19