Using Disk Images

Discussion in 'Installation and Configuration of Parallels Desktop' started by SPelly, Oct 26, 2010.

  1. SPelly

    SPelly Member

    Messages:
    27
    Hi, Does anyone know if it's possible to use a file that contains a binary copy of a disk partition as a Parallels HDD device? I have an application where "disks" are created (essentially) using dd/mkfs on physical linux systems and then need to be modified by a windows xp guest.

    If the image file can't be used as-is, is it possible to convert the image to an HDD and after it has been used by the guest OS, convert the HDD back to a disk image?

    I'd prefer to avoid the conversion because it implies time consuming copies and extra disk space.
     
  2. SPelly

    SPelly Member

    Messages:
    27
    Not elegant but it works...

    The best-practices police would be on me in no time, but the following works for now.

    From the terminal, use prlctl to create a plain disk as big or bigger than the image file:
    prlctl set windows_XP --device-add hdd --type plain --iface ide --size image_sizeMB

    This creates a .HDD directory along with the other VM files named something like harddisk1.hdd. In that directory is a file named harddisk1.hdd.0.{some_guid}. It looks like parallels reserves the first 512 bytes of the file for their own uses. The rest is a disk image -- initially all zeroed out but ready to be partitioned. I replaced that file with my image, prefixed with 512 nulls. i.e.:

    dd if=ntfs.img of=harddisk1.hdd/harddisk1.hdd.0.\{some_guid\}.hds seek=1

    When I start the machine, the disk is available with my data on it.

    If anyone has a more robust suggestion, please share.
     
  3. joevt

    joevt Forum Maven

    Messages:
    1,208
    I think you can take your disk image and just change the file extension to .hdd. This only works with uncompressed disk images. When you try to use the disk image with Parallels Desktop, it will convert it to the new .hdd package type (a package is a folder with a special flag set so that you can't view the folder contents normally in the Finder without using "Show Package Contents" in the contextual menu).

    The .hdd file inside the folder will not have the 512 nulls. The 512 nulls are optional. The number of 512 nulls is defined by the "Padding" setting in the DiskDescriptor.xml file.
     

Share This Page