vm cannot access cd-rom unless run as root

Bug #196850 reported by ethana2
32
This bug affects 1 person
Affects Status Importance Assigned to Milestone
virt-manager (Ubuntu)
Fix Released
Medium
Soren Hansen
Hardy
Fix Released
Undecided
Unassigned
Intrepid
Fix Released
Medium
Soren Hansen

Bug Description

When virt-manager is run from the gnome menu in Ubuntu Hardy, one cannot create a virtual machine that uses the CD-ROM drive of the host machine. No suggestions or instructions are provided for accessing the drive without exposing one's machine to the serious security risk of running virt-manager as root. On my machine, there is no cdrom group. When I changed the permissions of the CD-ROM device, virt-manager still would not let me use it unless run as root.

The CD drive option present when creating new virtual machines should not be greyed out when the permissions are incorrect; it should provide a means of obtaining the needed permissions securely.

Revision history for this message
Brian Pitts (bpitts) wrote :

I'm also experiencing this. The options to install the virtual machine from an iso file and from pxe boot are available, but the cdrom option is grayed out. I have an Alpha 6 disk in my cdrom drive.

Revision history for this message
ethana2 (ethana2) wrote : Re: [Bug 196850] Re: vm cannot access cd-rom unless run as root

Thank you, Brian. When they fix this, it should be quite usable.
Until then, not as all.

Revision history for this message
ethana2 (ethana2) wrote :

at**
(Sorry, right next to eachother in colemak)

Revision history for this message
LordSavage (lordsavage) wrote :

Same here.

Changed in virt-manager:
status: New → Confirmed
Revision history for this message
Dave Morley (davmor2) wrote :

Confirmed only it is still greyed out as root for me on both 64bit and 32bit.

Revision history for this message
Daniel Gimpelevich (daniel-gimpelevich) wrote :

Solution:
sudo nano /usr/bin/virt-manager

Change "exec python" to "exec gksu python" and everything will work better.

Revision history for this message
tapir (cosku-bas-deactivatedaccount) wrote :

thats not a solution for me. running virt-manager as root changes nothing. cdrom-dvd option is still grayed out.

Revision history for this message
Daniel Gimpelevich (daniel-gimpelevich) wrote :

It didn't work when I simply ran it as root, either, but it did work when I edited the file to use gksu.

Revision history for this message
tapir (cosku-bas-deactivatedaccount) wrote :

I tried with gksu too, it still doesn't work for me
I have a clean 8.04 RC installation with all the current updates done

Revision history for this message
Eric Corwin (eric-corwin) wrote :

I also have the same problem on an upgraded 8.04 installation. Whether or not I run as root I cannot access the cdrom. In addition, virt-manager has grayed out the option to install directly to a partition.

Murat Gunes (mgunes)
Changed in virt-manager:
importance: Undecided → Medium
Revision history for this message
ivom (ivo-maljevic) wrote :

Not only do I have the same problem, but if I try to create Windows XP using an ISO image, it just doesn't get past the "Assigning storage space" screen. When I click "Forward", nothing happens at all.

This is not the case when I try for example openSUSE. It creates the disk, but then it fails to boot from the ISO image. I'm guessing this is not resolved until some later release of kvm, and even then it works only with some tricks, but that is beside the point. The problem is how to use virt-manager. Did anybody even test it before releasing it?

Now, kvm works fine, my previously created VM using CLIs works when I run it from the command line, and the good thing is that "-std-vga" option works.

Revision history for this message
ivom (ivo-maljevic) wrote :

Oh, well, this tool is in an early stage of development anyway, that there is not much point in using it, even if somebody fixes the CD problem. CLI way is still the way to go. At least for another year or so.

Revision history for this message
Daniel Gimpelevich (daniel-gimpelevich) wrote :
  • smime.p7s Edit (2.4 KiB, application/pkcs7-signature; name=smime.p7s)

On Apr 27, 2008, at 7:39 AM, ivom wrote:

> Oh, well, this tool is in an early stage of development anyway, that
> there is not much point in using it, even if somebody fixes the CD
> problem. CLI way is still the way to go. At least for another year or
> so.

Not really: sudo apt-get install qemulator
--
"No gnu's is good gnu's." --Gary Gnu, "The Great Space Coaster"

Revision history for this message
ivom (ivo-maljevic) wrote :

Thanks. I just installed it (with aptitude), started it for the first time, and got "Sorry, Qemulator closed unexpectedly". If I ignore this screen, I get to the main screen, and then this same message keeps popping up. Can't expect much more from 0.5 version :)

Revision history for this message
Soren Hansen (soren) wrote :

Fixed in SRU: 0.5.3-0ubuntu10.

Changed in virt-manager:
status: Confirmed → Fix Committed
Revision history for this message
Murat Gunes (mgunes) wrote :

Upon applying the debdiff to the source package and building, I can verify that the fix works. However, I get two identical entries with the title of the CD in the "Path to install media" box. The issue seems to be cosmetic; selecting either seems to work.

Revision history for this message
Murat Gunes (mgunes) wrote :

After the initial stage of guest OS installation, once it's rebooted, it cannot access the CD-ROM drive. When I try to add one, (Details -> Hardware -> Add -> Storage Device), the "Normal Disk Partition" option is grayed out. As such, it's only possible to boot with the CD-ROM drive, and not actually utilize it after booting.

Revision history for this message
Murat Gunes (mgunes) wrote :
Revision history for this message
Murat Gunes (mgunes) wrote :
Revision history for this message
Murat Gunes (mgunes) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into -proposed, please test and give feedback here

Changed in virt-manager:
status: New → Fix Committed
Revision history for this message
Eric Corwin (eric-corwin) wrote :

The cdrom issue is fixed in the -proposed version. However, the option to install directly to a partition is still grayed out.

Revision history for this message
Martin Pitt (pitti) wrote :

Eric, that should be ok. Normal users do not have permission to access internal hard disk partitions. (Well, in GNOME you can mount them through PolicyKit, but virt-manager doesn't go that far yet, and those partitions must not be mounted).

Revision history for this message
Murat Gunes (mgunes) wrote :

Can anyone not reproduce the behavior I mentioned above?

Revision history for this message
David Kaplan (dmkaplan) wrote :

I just tried the proposed fix. My results are as follows:

1) I can confirm that with 0.5.3-0ubuntu9, both the CD option and the use harddrive partition option were grayed-out when run as a normal user and when run as root (i.e., changing to root did not help in my case).

2) When using the proposed fix 0.5.3-ubuntu10, the CD option was available. Hard drive option was not, but I have not tried to run as root.

3) I can confirm that the CD (in my case, "VISTA_64_BUSINESS") appears twice in the menu, but as stated, this appears to be cosmetic and is possibly related to the fact that /media/cdrom and /media/cdrom0 both point to the CD.

4) When I selected to use the CD, the install began as normal by creating the disk image, but this ended with a mysterious error that did not occur with 0.5.3-ubuntu9 (i.e., this would seem to somehow be related to the update):

Unable to complete install '<class 'libvirt.libvirtError'> virDomainCreateLinux() failed Timed out while reading monitor startup output
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 620, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 820, in start_install
    return self._do_install(consolecb, meter)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 841, in _do_install
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib/python2.5/site-packages/libvirt.py", line 585, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: virDomainCreateLinux() failed Timed out while reading monitor startup output
'

5) This error does not appear to block continuing installation, but my personal results after this point have all failed to finish the install. Once, it failed because my processor was not set to 64bit, so I changed the processor from i686 to x86_64 (I am running a core 2 duo processor, which supports x86_64, but the Ubuntu I am running is i686). Next, it failed on some unknown windows error before starting the actual windows install, though the windows welcome screen did appear (meaning it was accessing the CD). After this time, I upped the number of CPU available to the virtual machine to 2. In this case, it wouldn't boot at all - instead it would indicate that the CD had been detected, but would do no more, though virt-manager indicated it was using CPU. This happened regardless of whether I deleted and recreated the virtual machine. At this point, I am out of options to try. As virt-manager appears to be failing at multiple point, I am not sure whether these problems have anything to do with the fix committed. I would be happy to report any or all of this in a separate bug, but I am not sure what is actually failing. Suggestions?

Revision history for this message
Martin Pitt (pitti) wrote :

Copied to hardy-updates. Please upload to intrepid ASAP.

Changed in virt-manager:
status: Fix Committed → Fix Released
assignee: nobody → soren
Revision history for this message
Wojtek Kazimierczak (w-kazimierczak) wrote :

Solution (at least on my installation):
ln -s /dev/scd0 /dev/cdrom

To be able to use disk partition I need to run virt-manager as root.

Soren Hansen (soren)
Changed in virt-manager:
status: Fix Committed → Fix Released
Revision history for this message
Klaus Heinrich Kiwi (klauskiwi) wrote :

Something is still not quite right with the Intrepid version.

If I try to create a virtual machine booting from the 'real' cdrom, I get the following message:
libvirtError: virDomainCreateLinux() failed internal error Timed out while reading monitor startup output

It works as expected if I use the ISO image at my home directory.

My user is part of the libvirtd group (128). I also tried running as root with the same result.

I saw some interesting messages on the libvirtd side:

klausk@klausk:/var/log$ sudo libvirtd -v
<...>
EVENT: Add handle 15 25 0xb7ed91b0 0x8d75590
libvir: QEMU error : internal error QEMU quit during console startup

     =======================| DirectFB 1.0.1 |=======================
          (c) 2001-2007 The DirectFB Organization (directfb.org)
          (c) 2000-2004 Convergence (integrated media) GmbH
        ------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2008-09-12 19:59)
(!) Direct/Util: opening '/dev/fb0' and '/dev/fb/0' failed
    --> No such file or directory
(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment variable.
(!) DirectFB/Core: Could not initialize 'system' core!
    --> Initialization error!
Could not initialize SDL - exiting
Shutting down VM 'OpenClient'EVENT: Remove handle 13
EVENT: mark delete 5
EVENT: Remove handle 15
<...>
EVENT: Add handle 15 25 0xb7ed91b0 0x8d75590
libvir: QEMU error : internal error Timed out while reading monitor startup output
Shutting down VM 'OpenClient'EVENT: Remove handle 13
EVENT: mark delete 5
EVENT: Remove handle 15
<...>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.