First off, you can't do this with the system running, or at least, you can't do this safely and expect to get a proper, coherent disk image from doing it with the system running. That's probably the big argument against the
dd approach, though it's hard to say without reference to the specific recommendations against it.
Given this, there are a couple of approaches you can take here, but they all require two things:
- The ability to boot to an alternative OS running from a separate storage device (not just a different partition, but a different disk). For most of the below methods, I would suggest using System Rescue CD for this.
- Somewhere where you can store the whole disk image. If you're using a Live USB drive, it could be used for this storage if it's big enough, but you'll probably need a big disk to pull this off.
Once you have that, you've got a couple of options:
Partimage is disk backup software for Linux that can efficiently store disk images. It does this by only copying sectors that are in-use, and compressing the resultant image file. It's included on most system recovery Live CD's, and even has support for saving and restoring images across the network. The downside is that it has to support the filesystems you have on the disk you're backing up, and it notably does not include support for ext4 or BTRFS. Provided that that's not a limitation, this is what I would suggest using. I'll not go into specifics here of how to use it as there are numerous good tutorials out there.
dd for this type of thing isn't as much of an issue if you're doing it from a live system, but it still ahs limitations in that it's a pain to restart a partial copy, it fails if there are any failed reads or writes, and it doesn't give nice progress info. That's where GNU ddrescue comes in. It can do some things similar to
dd, but it provides a bunch of features that are extremely useful for copying or cloning disks. The process of using it is essentially the same as for
dd, but the command line syntax is different. They have good documentation, so I won't waste space here explaining how to use it, except to comment that you almost always want to use a log file so it can resume partial transfers. Like Partimage,
ddrescue is included on most system recovery Live CD's.
qemu-img is a special tool included with the QEMU virtualization software that is used to convert between disk image formats supported by QEMU. QEMU helpfully supports both raw disk images and VDI images, so you can use
qemu-img to produce a VDI image from a regular physical disk, which means you can just skip the process of restoring the image inside VirtualBox. The exact command you want looks something like:
qemu-img -O vdi /dev/sda /path/to/image.vdi
/dev/sda is whatever disk you're copying from, and
/path/to/image.vdi is the intended file name for the disk image. This approach has two downsides though, namely that it can't be resumed if interrupted part way through, and that
qemu-img isn't included in most Live CD's (let alone most system recovery focused ones).
If you intend to run the VM on a different system than the one that you're copying the disk from and can establish a network connection between the two systems, you have a lot more flexibility, and can completely remove the need for temporary storage. In this case, you should set up the VM other than copying the disk in, and boot both it and the source system into a Live CD environment. You can then use either NBD or iSCSI between the two systems to directly copy the disk over the network using either