I'm searching for a solution to boot a native OS on a hard disk as a virtual machine.
It's like what VMware Fusion did on a Mac which boots Windows in Boot Camp as a virtual machine.
In detail, I have Windows installed on /dev/sda2 and Ubuntu 11.10 on /dev/sda5.
Is there anyway to use a virtual machine software to boot the Windows on /dev/sda2 as a virtual machine while I'm using Ubuntu?
Yes, I did this long ago following this guide: Use VMWare to boot a physical Windows XP HD (Ubuntu-US-NM mailing list)
of course, always backup and be careful!
Essentially:
Used a USB 3.5 HD enclosure and connect the XP drive to it.
If the drive was shutdown uncleanly, you may need to manually mount it with the following command.
sudo mount ntfs-3g /dev/whereyourdriveis /mount/somemountpoint -o force
Once the drive is mounted under linux, continue to step 2.
Launch VMWare.
Go to File -> New -> New Virtual Machine.
Select "Custom"
Select Next
Select your operating system (i.e. Win XP)
Select Next
Give it a name like "WindowsXP"
Select Next
Specify processor One or Two
Select Next
Choose public or private (on a single-user machine this doesn't matter)
Select Next
Select the memory to devote to the virtual machine. 512 MB is a pretty useful number.
Select your network connection
Select Next.
Leave SCSI set to BusLogic
Select Next
Select Use Physical Disk
Select Next
Select Use Entire Drive
Select Next
Specify the place to save the VM
At this point you're done. Select Power On to boot the Physical drive in VMWare!
More Info: I should add, I have successfully done this, but I also had success using this method years even years before. So there are at least two known and tested ways for accomplishing this that I can tell you.