0

I'm wondering if it's possible to specify a URL for the cdrom option on QEMU, and if so how would I go about doing that?

Normally I'd mount an iso like this:

<disk type='file' device='cdrom'>
<source file='/path/to/iso'/><target dev='hdc'/><readonly/>
</disk>

However I figure there must be a good method to mount a URL instead as frankly if it's read only it doesn't need to be on the local FS...

Ideas? I'm open to trying random suggestions...

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
Bravo Delta
  • 140
  • 1
  • 9
  • when you point to an ISO, the data is accessed directly. To use a URL, qemu must have a built-in http client – dyasny Mar 18 '14 at 02:14

1 Answers1

1

Assuming a url of: http://example.com/url_path

<disk type='network' device='cdrom'>
    <driver name='qemu' type='raw'/>
    <source protocol="http" name="url_path">
        <host name="example.com" port="80"/>
    </source>
    <target dev='hdc' bus='ide' tray='open'/>
    <readonly/>
</disk> 
devicenull
  • 5,572
  • 1
  • 25
  • 31
  • From the manual, disk type="network" requires at least 0.8.7. There's even an example: http://libvirt.org/formatdomain.html#elementsDisks – devicenull Mar 19 '14 at 03:34
  • Wow, it's buried in the examples but not actually documented as such. And the startup just seems to hang forever, spinning with 100% CPU, even with a small ISO image...I suspect this feature is buggy at best. – Michael Hampton Mar 19 '14 at 03:44
  • Well, I can tell you it works okay on qemu 1.7 / libvirt 1.2.1, but I've not tested with anything older – devicenull Mar 19 '14 at 03:46
  • Unfortunately my install comes back with: error: internal error: unknown protocol type 'http' --> (Libvirt v1.1.1 / QEMU 1.5.0) --> http://pastie.org/private/igzx0l6tr8iv1gck3wwuig (for the record I did try a few different protocols and URLs) – Bravo Delta Mar 19 '14 at 07:22
  • I'm guessing you would need qemu compiled with --enable-curl. I am not certain if that's the default (nor does qemu seem to have any way to tell) – devicenull Mar 20 '14 at 00:01
  • I've selected this as the answer (as technically it does work on newer versions of KVM... just have to wait for it to become more mainstream. – Bravo Delta Jun 07 '14 at 11:40