libguestfs: Live CD inspection

New in libguestfs 1.9.4, you can now run virt-inspector on some types of installer CD and live CD. The output tells you what type of operating system is on the CD:

$ virt-inspector cd.iso
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/sda</root>
    <name>windows</name>
    <arch>x86_64</arch>
    <distro>windows</distro>
    <product_name>Windows Server 2003 Enterprise x64 Edition</product_name>
    <major_version>5</major_version>
    <minor_version>2</minor_version>
    <windows_systemroot>\WINDOWS</windows_systemroot>
    <format>installer</format>
    <mountpoints>
      <mountpoint dev="/dev/sda">/</mountpoint>
    </mountpoints>
    <filesystems>
      <filesystem dev="/dev/sda">
        <type>iso9660</type>
        <label>CRMEXFPP_EN</label>
      </filesystem>
    </filesystems>
    <applications/>
  </operatingsystem>
</operatingsystems>

Update

On IRC someone asked me how long this takes. Here is the time to run the above command on my laptop:

real	0m4.736s
user	0m1.134s
sys	0m2.897s

The use case is in tools like virt-manager where we would like to detect what sort of ISO a user is installing from so that we can set the OS hints correctly. 5 seconds is just about acceptable as long as this happens in the background and doesn’t disturb the UI.

Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s