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.
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
It can be done, but it is not recommended if you don't really know what you are doing:
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.
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:
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...
- 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)
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:
- Boot the windows partition you would like to virtualize
- Download Disk2VHD utility from Sysinternals
- If you have a UEFI partition, follow this instructions
- Create a VHD (not VHDX) image of your C: partition, recovery, UEFI (if any) and whatever else you want
- Come back to linux, open VirtualBox and create a VM accordingly to your windows operating system specifications
- Attach to that VM the VHD disk created at point 4
- That's it
Troubleshooting in case of UEFI:
- In the VM settings, in VirtualBox, check the option "Enable EFI" under System tab
If you get stuck at the EFI Shell, run the following command: