Virtual Machine, can I use an existing HD image

Jan 08, 2021 28 Replies

Yes, you can use an existing partition as a VM disk image. Moreover, you can have two OSes installed on regular partitions and cross-virtualise them. I mean, you decide which OS boots up using GRUB or compatible and then virtualise the remaining one in seamless mode. One of my PCs has exactly this configuration: I can run Windows programs in VM from Linux if I decide to start the latter or Linux programs if Windows is the host. It requires some sector remapping, though. The VM will do that for you and it boils down to a text file, but finding out its content is a bit tricky.

Best regards, Piotr

He can use the old drive directly if he wants to, there is no need to create an image file. VMDK is happy working with raw devices. Along the lines of:

VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda -partitions 1,5

You can also remap selected sector ranges to mask out GRUB, etc., which is one way to resolve conflicts with the Windows bootloader.

Best regards, Piotr

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required