Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want create a image of my PC Laptop and run the image as a virtual machine on Mac OS.

I have already VirtualBox installed.

What can I do now?

share|improve this question

migrated from stackoverflow.com Jun 12 '11 at 3:00

This question came from our site for professional and enthusiast programmers.

    
I don't think it's possible to just create an image of a real hard disc and convert it to a VHD. –  IDWMaster Jun 12 '11 at 2:35

3 Answers 3

Not quite a straightforward answer, but one that's likely to work is to create a live/installer disk off remastersys - in your case probably with the full system backup option, grab the ISO that generates and use that to do a 'fresh' install on your VM.

This should ensure your software, settings, users and files are moved over , while installing any additional HW that's needed, as well as other things.

share|improve this answer

OK. Never mind, I was wrong. Apparently it IS possible to clone a real hard disk by mounting a Ubuntu ISO in the virtual machine, then booting from it. After that:

  1. Attach the physical drive as a USB device to the virtual machine (this method only works if it's a USB device).
  2. Copy the contents of the device (usually /dev/sdb for example) to your VHD (usually /dev/sda). It would be relatively simple to write a program that does this. You probably wouldn't want to do it with cp /dev/sdb /dev/sda though. That could take a while, and you'd probably want some kind of buffering function.
share|improve this answer

Using rsync would let you clone the drive to an external, probably something like:

sudo rsync -avrogx / /path/to/volume

Can someone check me on this?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.