qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] Is it possible to write to a QEMU CDROM device?


From: Steve Ross
Subject: Re: [Qemu-discuss] Is it possible to write to a QEMU CDROM device?
Date: Wed, 25 Mar 2015 17:20:45 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

> The result of executing the above command was errors...

I talked to a knowledgeable user and he told me that "libvirt" sets up
an environment and also adds some options to the "qemu" command-line. 
So, in general, I should not expect the command line options that
"virt-manager" produces to work correctly when added to the "qemu"
command line and executed directly.

On 03/25/2015 01:51 PM, Steve Ross wrote:
> Hi Pavel,
>
> Sorry for my late response (I was out for a couple of days.)  Thanks
> very much for your suggestion; I have couple of questions.
>
> Is your suggestion to simply verify that the CD-ROM hardware device on
> my host machine can both read from and write to CDs?  (I know that it
> can write because I've used it previously to successfully burn a CD from
> the host desktop.)
>
> Second, what command-line should I use to start the VM directly from the
> command line using "qemu"?  (I may need a tutorial.)  I tried the
> following approach (among others) but was unsuccessful.
>
> When the "virt-manager" executes the command line, I see that the
> process is owned by "qemu".  So, I tried the following command as "root"
> on my host machine in an attempt to run as the "qemu" user.  I copied
> everything between the single-quote marks, below, from the output of the
> "ps -ef" command from the successfully running "qemu--system-x86_64"
> process as started by the "virt-manager".  The only difference is that I
> removed the ",readonly=on" text from the command line, as you suggested.
>
>     # su -s /bin/bash -c '/usr/bin/qemu-system-x86_64  \
>         ...<very long set of options without "readonly">...' qemu
>
> The result of executing the above command was errors like:
>
>     2015-03-25T18:00:51.823548Z qemu-system-x86_64: -drive
> file=/data/images/dc-rhel6.img,if=none,id=drive-ide0-0-0,format=qcow2:
> could not open disk image /data/images/dc-rhel6.img: Could not open
> '/data/images/dc-rhel6.img': Permission denied
>
> and no virtual machine running.
>
> Thank you,
> -- Steve
>
> On 03/21/2015 01:13 AM, Pavel Troller wrote:
>> Hello Steve!
>>   Maybe a stupid question, but did you try to start the VM manually just
>> by entering the command exactly as virt-manager does but with readonly=on
>> option omitted ? It would be an easy experiment, how to verify, whether the
>> machine itself can write the CD or not. 
>>   With regards,
>>     Pavel
>>
>>> Hello all,
>>>
>>> I'm a new-comer to the list (and my apologies if this is not the
>>> appropriate place to ask my question).
>>>
>>> My goal is to *write* from the guest OS to a CD or DVD reader/writer on
>>> my host system.  Currently, the write operation is failing.  I believe
>>> it is because the virtual CD-ROM device is set to be "readonly".  Is it
>>> possible to write to a QEMU CDROM device and, if so, how?
>>>
>>> I'm using the "virt-manager" GUI to start the virtual machine.  Once
>>> started, the "qemu" command line from my virtual machine process
>>> includes the following, where the host's built-in CD reader/writer is
>>> "/dev/sr0".
>>>
>>> /usr/bin/qemu-system-x86_64 ... -drive
>>> file=/dev/sr0,if=none,id=drive-ide0-0-1,readonly=on,format=raw
>>>
>>> This obviously says that the device is "readonly".
>>>
>>> A snippet of XML from my virtual machine from the CDROM is:
>>>
>>> <domain type='kvm'>
>>> ...
>>>   <devices>
>>>     <disk type='block' device='cdrom'>
>>>       <driver name='qemu' type='raw'/>
>>>       <source dev='/dev/sr0'/>
>>>       <target dev='hdb' bus='ide'/>
>>>       <readonly/>
>>>       <address type='drive' controller='0' bus='0' target='0' unit='1'/>
>>>     </disk>
>>>
>>>
>>> I've tried removing the <readonly/> tag from the above VM definition,
>>> and then running the VM, but the tag magically reappears in the VM
>>> definition when it runs.
>>>
>>> Also, the "virt-manager" GUI shows the CDROM device as having the option
>>> of "Readonly" being checked (and the GUI does not allow me to uncheck it.)
>>>
>>> Other details:
>>>
>>>   * qemu version 2.1.3 on Fedora 21.
>>>   * libvirt version 1.2.0.2
>>>
>>>
>>> Thanks for any help or pointers you can provide,
>>> -- Steve
>>>
>>>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]