[Libguestfs] Convert bootable raw hdd image to bootable iso?

Richard W.M. Jones rjones at redhat.com
Sun Dec 15 00:05:17 UTC 2013


On Sat, Dec 14, 2013 at 10:57:16PM +0000, adrelanos wrote:
> Hi,
> 
> is it possible to convert a bootable raw hdd image including grub
> (originally created with grml-debootstrap) to a bootable iso somehow?

Creating a bootable ISO is tricky.  You'll probably want to use
'genisoimage'.  That's outside the scope of libguestfs, but there are
lots of documents online about using mkisofs/genisoimage to create
bootable ISOs.  Note that AFAIK grub is not involved with bootable
ISOs.  They usually use ISOLINUX.

Libguestfs may help to extract the files from the HDD image however:

  http://libguestfs.org/guestfs-recipes.1.html#export-any-directory-from-a-vm

eg:

mkdir /tmp/files
cd /tmp/files
virt-copy-out -a /tmp/disk.img / .

(Note the final '.')

Then you could use genisoimage on this directory.

You might be better off seeing if there's a direct way to use
debootstrap to create bootable ISOs.  Whatever Debian uses to create
installer CDs would be a good starting point.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org




More information about the Libguestfs mailing list