15

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.

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

  • 4
    -1: it is not true. – enzotib Feb 9 '12 at 11:37
  • @enzotib The OS inside VirtualBox can access the host's partition. The difficulty is running Windows on hardware that's not what you installed it on. – Gilles Feb 9 '12 at 22:52
9

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.

  • Interesting, didn't know about that. – Patkos Csaba Feb 9 '12 at 11:48
  • The "Advanced" section got smaller after Oracle bought Sun. :-( But anyway - if you do so - run in "repair" mode to substitute the drivers with working versions. – Nils Feb 9 '12 at 21:30
  • I know this isn't the right site for this, but do you have experience taking a Windows installation performed on the metal and running it in a VM? – Gilles Feb 9 '12 at 22:53
  • @Gilles: not a direct one, but I've seen it done by a co-worker. – enzotib Feb 10 '12 at 13:55
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

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)

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

  • 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 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.