Virtual Machine CD-ROM disappears on its own - kvm virt-manager

Bug #238692 reported by komputes on 2008-06-09
8
Affects Status Importance Assigned to Milestone
virt-manager
Won't Fix
Medium
kvm (Ubuntu)
Undecided
Unassigned
libvirt (Ubuntu)
Low
Unassigned
virt-manager (Ubuntu)
Medium
Soren Hansen

Bug Description

Binary package hint: kvm

I have tested the following on Ubuntu 8.04. I am using kvm and virt-manager. I beleive this bug to be related to the libvirt-manager package. What happens is that virt-manager disconnects the CD-ROM without user intervention and does not allow the user to reconnected through the virt-manager GUI.

Steps to reproduce:
$ sudo apt-get install kvm libvirt-bin ubuntu-vm-builder virt-manager
$ sudo adduser ubuntu kvm
# reboot
$ virt-manager
# double click on the localhost (User) to make status "Active"
# new (button)
# create a new VM using an XP CD
# after first reboot, installer asks for CD, CD disappears from VM device list

======

When creating a virtual machine you get the following options:

-ISO
-CD-ROM or DVD
-Network PXE Boot

On a VM with no CD-ROM these are the options you get when attempting to add a device:

-Normal Disk Partition (Grayed Out)
-Simple File (Works fine for ISO/Image but not for physical CD drive device)
-Device Type (Selected CD-ROM)

I would recommend that the CD-ROM or DVD option be the same in "Creating a VM" and "Add Device" so that a physical CD-ROM can be bound to a VM in a few clicks. Can the developers please try to find out why the CD drive is there (bound from host to guest) when the machine is created, but disapears after a reboot of the VM.

komputes (komputes) on 2008-06-10
description: updated
Henrik Nilsen Omma (henrik) wrote :

AFAICS, this is a missing feature (configuration option) in virt-manager but possible on the command lie with kvm with a combination of -cdrom and -boot d flags. From experience with Ubuntu installs in VMs, the system 'ejects' the CD (tested with ISO images in my case) which the VM manager remembers. Is this the case with virt-manager as well?

Søren, could you have a look at this please? Is it simply a matter of adding a configuration option to virt-manager and/or should libvirt have more sensible defaults in this case?

David, can you confirm that you can make kvm behave as you expect from the command line?

Changed in virt-manager:
assignee: nobody → soren
importance: Undecided → Medium
status: New → Confirmed
komputes (komputes) wrote :

Henrik, I am aware of the following workaround and I confirm that this works from the command line:
qemu -no-kqemu -no-acpi -m 512 -cdrom /dev/cdrom -boot d XP.img

Please note that the current bug is not to find a "workaround" (as seen above) but a fix for the bug in virt-manager (GUI) which makes the CD device disappear and that does not let the user re-bind it after it has disapeared.

Attached you will find step-by-step snapshots of the issue.

komputes (komputes) on 2008-06-10
Changed in kvm:
status: New → Invalid
komputes (komputes) wrote :

A few months have gone by without a comment on this bug. I found the following email thread (attached) which was sent to the <email address hidden> mailing list on September 13th 2007. I'm not sure if anything has been done to resolve the CD issue, but I did see that there was a newer version (0.5.4) then the one we have been using (0.5.3-0ubuntu10).

Can we please try to package the new version to see if it resolves the issue. The source could be found here:

http://virt-manager.org/download.html

jedioetzi (jedioetzi) wrote :

I can confirm that upgrading to 0.5.4 (available only for ubuntu intrepid) the bug seems fixed

komputes (komputes) wrote :

Testing virt-manager 0.5.4-2ubuntu1 in Intrepid Ibex 8.10 Alpha 5, running kernel 2.6.27-3 I got the attached error when attempting to create a machine as a common user, before even booting it up.

As the root user, I was able to start virt-manager and go through the boot from CD and first install stage of XP. Then, the second stage, it would not boot. It flashed "Console not yet active for guest" and "Guest not active" on the machine console very quickly.

Both the regular user and the root user are part of the correct groups (kvm, libvirtd, vde2-net)

Bug originally reported on launchpad against virt manager 0.5.3:
https://bugs.launchpad.net/ubuntu/+source/kvm/+bug/238692

I have tested the following on Ubuntu 8.04. I am using kvm and virt-manager. I beleive this bug to be related to the libvirt-manager package. What happens is that virt-manager disconnects the CD-ROM without user intervention and does not allow the user to reconnected through the virt-manager GUI.

Steps to reproduce:
$ sudo apt-get install kvm libvirt-bin ubuntu-vm-builder virt-manager
$ sudo adduser ubuntu kvm
# reboot
$ virt-manager
# double click on the localhost (User) to make status "Active"
# new (button)
# create a new VM using an XP CD
# after first reboot, installer asks for CD, CD disappears from VM device list

======

When creating a virtual machine you get the following options:

-ISO
-CD-ROM or DVD
-Network PXE Boot

On a VM with no CD-ROM these are the options you get when attempting to add a device:

-Normal Disk Partition (Grayed Out)
-Simple File (Works fine for ISO/Image but not for physical CD drive device)
-Device Type (Selected CD-ROM)

I would recommend that the CD-ROM or DVD option be the same in "Creating a VM" and "Add Device" so that a physical CD-ROM can be bound to a VM in a few clicks. Can the developers please try to find out why the CD drive is there (bound from host to guest) when the machine is created, but disapears after a reboot of the VM.

What version of virtinst are you using? This is where the issue will be.

Originally we would keep the CDROM device attached to the guest after install, but remove the _media_. That should be what's happening to you, but I could be wrong.

This has been fixed upstream and in virtinst-0.400.0 if you specify you are installing a windows VM, since it needs the install media to remain inserted for the second stage of the install.

The commit is here, if you guys want to pull it in.:

http://hg.et.redhat.com/virt/applications/virtinst--devel?cs=06315a1b8f70

Changed in virt-manager:
status: Unknown → Confirmed

Hmm, as stated the fix is upstream. If you are using ubuntu, file this bug with them, and provide the link to the upstream commit I gave in Comment #1. You'll want to file it against whatever package virt-install is a part of.

Closing as UPSTREAM. Thanks for the report. Please reopen if I got it wrong.

Changed in virt-manager:
status: Confirmed → Invalid
komputes (komputes) wrote :

Just an update on this bug and testing a newer version. Testing this on the latest Fedora release, I am getting errors when attempting to create a VM:

https://bugzilla.redhat.com/show_bug.cgi?id=467896

I attempted to get the latest copy of the code on the development version of Fedora. I believe that I am running virtinst >0.400.0 but I am not sure how to check this. When testing, I run into an error creating a VM. I have added the versions of the packages in the new bug.

Cannot create virtual machine in virt-manager 0.6.0-2
https://bugzilla.redhat.com/show_bug.cgi?id=467896

I am still experiencing the disappearance of the CD-ROM after a reboot, even after testing in Rawhide. As well SELinux blocks the creation of a VM.

Description of problem:

I have reported a few bugs over the use of virt-manager.

1) Bug 464829 - Virtual Machine CD-ROM disappears on its own - kvm virt-manager
https://bugzilla.redhat.com/show_bug.cgi?id=464829
Solution: Upgrade to virtinst-0.400.0

2) Bug 467896 - Cannot create virtual machine in virt-manager 0.6.0-2
https://bugzilla.redhat.com/show_bug.cgi?id=467896
Solution: Upgrade to python-virtinst-0.400.0-3.fc10

Now I am experiencing an issue where SELinux is not allowing me to create a VM unless it is turned off.

Version-Release number of selected component (if applicable):

Fedora release 9.92 (Rawhide)
Linux Kernel 2.6.27.3-27.rc1.fc10.i686

virt-manager-0.6.0-2.fc10.i386
libvirt-0.4.6-3.fc10.i386
kvm-74-4.fc10.i386
qemu-0.9.1-10.fc10.i386
python-virtinst-0.400.0-3.fc10.noarch

Steps to Reproduce:
$ virt-manager
(Enter Password)
New VM - Default/ WinXP/4G HDD/512RAM/1CPU
OK -> Error: SELinux blocks the VM from being created

Actual results:

SELinux interrupts the creation of the VM. Turning off the SELinux enforcement by running the following command:

# setenforce Permissive

Afterwards, the installation of XP from the CD-ROM works until the second portion of the installation where the CD-ROM disconnected itself and is no longer able to reconnect.

Expected results:

-SELinux should not block the action of creating a VM

-CD-ROM should be statically set to the machine. This is still a bug.

Definitely sure you specified you are installing a windows VM? Otherwise the media won't remain attached.

If so, can you attach ~/.virt-manager/virt-manager.log? Thanks.

You are correct. I am trying to create a windows VM.

The file you specified does not exist in my user's home directory.

My mistake, it was in /root/.virt-manager/virt-manager.log

Created attachment 321328
virt-manager log

Created attachment 321329
SELinux log

As well, here is an export of the SELinux alerts, if it can be helpful.

Hmm, according to the log, you had a VM named 'xxxxppppp' which was specified as windows, and appeared to keep the media around after reboot. (Bug fixed)

Later you created a guest called 'expeefromceedee' which _wasn't_ specified as windows (OS type was left as 'Generic') so the media wasn't kept connected after the first reboot, which is expected behavior. Granted there could be a bug between here and there but to me it looks like the issue was fixed.

Could you try again and make sure a windows OS is specified in the 'Choose Install Method' screen? If that doesn't work, please post the log after that attempt. Thanks.

OK, you are correct, I selected Windows and it didn't disconnect the drive in the second part of the install. Although after the first part, I tried to start the machine again and got the following error:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 532, in run_domain
    vm.startup()
  File "/usr/share/virt-manager/virtManager/domain.py", line 380, in startup
    self.vm.create()
  File "/usr/lib/python2.5/site-packages/libvirt.py", line 262, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error Timed out while reading monitor startup output

Then I tried again and, as you said, it seems to work. The second portion of the Windows install works.

I did not realize that if I did not select Windows as the OS, the CD would be disconnected (intentionally) when the machine shuts down. Why is this intentional behaviour? Seeing as we are virtualizing a machine, I don't know many machines where the CD ROM drive just disconnects itself after turning the machine off.

Although this is the case, it possible to manually reconnect the CD afterwards although it is not very user friendly.

Reconnect - Works
-Remove Device Disk hdc
-Create a new storage device (IDE CDROM) and point it to /dev/sr0

Reconnect - Does not work
-Go to hardware tab
-Click "Connect"
-Select "CD-ROM or DVD - Path to install media" (This is greyed out)

The latter will be most users first intuition.

komputes (komputes) wrote :

Tested on Fedora release 9.92 (Rawhide) - I can confirm that this bug is fixed using the following setup. Please package and test on Ubuntu.

Linux Kernel 2.6.27.3-27.rc1.fc10.i686

virt-manager-0.6.0-2.fc10.i386
libvirt-0.4.6-3.fc10.i386
kvm-74-4.fc10.i386
qemu-0.9.1-10.fc10.i386
python-virtinst-0.400.0-3.fc10.noarch

Hi David,

With it being so close to Intrepid's release it's not likely these will get packaged/updated for Intrepid's final release. This is something that will need to wait for Jaunty. After that they might be considered for inclusion in the -backports repository but that might be debatable - https://help.ubuntu.com/community/UbuntuBackports . For now it seems the command line workaround will need to be used. Thanks.

Cool, so this issue is fixed. That 'timed out' issue is a separate bug that is currently reported, though we haven't determined what is causing it yet. See bug 453491.

Larry Tate (cathect) wrote :

Hello,

I am having a similar problem where the CD is not recognized by the Windows installer.

I follow the following steps:

$ sudo apt-get install kvm libvirt-bin ubuntu-vm-builder virt-manager
$ sudo adduser ubuntu kvm
# reboot
$ virt-manager
# double click on the localhost (User) to make status "Active"
# new (button)
# create a new VM using an XP CD

However, during installation, I get the attached message (see screenshot). I'm running Ubuntu 8.10.

Larry Tate (cathect) wrote :
komputes (komputes) wrote :

strange_cathect, this is a know bug and as Leann has mentioned, the packages which include fixes for this will not be packaged for ubuntu until April 2009 (for the 9.04 Jaunty release). Until then, you will need to compile the versions I mentioned above, from source code or package it yourself to fix this bug. An alternative is to use an ISO file instead of a physical CD-ROM.

Hello David,

Thank you for your reply. The reason why I submitted my comment is because
it seems to be behaving differently than what has already been described. If
I read the other comments correctly, what has been described previously is
that the CD-Rom is unmounted when the Windows installer reboots for the
first time. However, my problem is that the installer will not even
initiate: I get the error message that "setup cannot read the CD you
inserted." So, the CD-Rom is mounted, and spinning, but the installer gives
an error message that it cannot find disk. I know this is a legitimate disk
and there is nothing physically wrong wither either it or my drive.
Curiously, this behavior persists even when I create an ISO of the disk and
point the Virtual Machine Manager to it.

Sorry if this is indeed a repetition.

Yours,

Alan

On Mon, Nov 17, 2008 at 12:11 PM, David Bensimon <
<email address hidden>> wrote:

> strange_cathect, this is a know bug and as Leann has mentioned, the
> packages which include fixes for this will not be packaged for ubuntu
> until April 2009 (for the 9.04 Jaunty release). Until then, you will
> need to compile the versions I mentioned above, from source code or
> package it yourself to fix this bug. An alternative is to use an ISO
> file instead of a physical CD-ROM.
>
> --
> Virtual Machine CD-ROM disappears on its own - kvm virt-manager
> https://bugs.launchpad.net/bugs/238692
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Virtual Machine Manager: Invalid
> Status in "kvm" source package in Ubuntu: Invalid
> Status in "libvirt" source package in Ubuntu: New
> Status in "virt-manager" source package in Ubuntu: Confirmed
>
> Bug description:
> Binary package hint: kvm
>
> I have tested the following on Ubuntu 8.04. I am using kvm and
> virt-manager. I beleive this bug to be related to the libvirt-manager
> package. What happens is that virt-manager disconnects the CD-ROM without
> user intervention and does not allow the user to reconnected through the
> virt-manager GUI.
>
> Steps to reproduce:
> $ sudo apt-get install kvm libvirt-bin ubuntu-vm-builder virt-manager
> $ sudo adduser ubuntu kvm
> # reboot
> $ virt-manager
> # double click on the localhost (User) to make status "Active"
> # new (button)
> # create a new VM using an XP CD
> # after first reboot, installer asks for CD, CD disappears from VM device
> list
>
> ======
>
> When creating a virtual machine you get the following options:
>
> -ISO
> -CD-ROM or DVD
> -Network PXE Boot
>
> On a VM with no CD-ROM these are the options you get when attempting to add
> a device:
>
> -Normal Disk Partition (Grayed Out)
> -Simple File (Works fine for ISO/Image but not for physical CD drive
> device)
> -Device Type (Selected CD-ROM)
>
> I would recommend that the CD-ROM or DVD option be the same in "Creating a
> VM" and "Add Device" so that a physical CD-ROM can be bound to a VM in a few
> clicks. Can the developers please try to find out why the CD drive is there
> (bound from host to guest) when the machine is created, but disapears after
> a reboot of the VM.
>

komputes (komputes) wrote :

strange_cathect - Alan, since you are getting the error "setup cannot read the CD you inserted." at the first boot, I beleive this is a completely separate issue. You will want to create a new bug against the package you are experiencing this issue with. From the screenshot you posted, it obviously boots from the CD but it may be possible that you have a corrupt CD-ROM. Do you get this error when using this CD attempting to install on a machine directly or just a virtual machine. Please be sure to put your answers to this in the new bug and to subscribe me.

Hi David,

Based on the package versions you listed in your previous comment - https://bugs.edge.launchpad.net/ubuntu/+source/kvm/+bug/238692/comments/8 care to give the latest pre-release of Jaunty a try - http://cdimage.ubuntu.com/daily-live/current/ ? The reason I ask is because I currently see the following packages available in Jaunty:

virt-manager=0.6.0-6ubuntu1
libvirt-bin=0.4.6-5ubuntu2
kvm=1:79+dfsg-0ubuntu4
qemu=0.9.1+svn20081112-1ubuntu1
python-virtinst=0.400.0-6ubuntu1

komputes (komputes) wrote :

Hi Leann,

I tested these packages on Jaunty. When creating a machine I am not able to select kvm virtualization (only qemu). I'm not sure if this is a bug or if I'm not doing it correctly. Do you have the same issue? I followed the following community documentation instructions to set up virt-manager and kvm: https://help.ubuntu.com/community/KVM/Installation

Changed in virt-manager:
status: Invalid → Fix Released
komputes (komputes) wrote :

Tested in Jaunty and seems to be fixed.

Thanks David. I'll go ahead and mark this Fix Released for Jaunty. This is likely not SRU worthy for Hardy, especially since a workaround exists. Thanks.

Changed in virt-manager:
status: Confirmed → Fix Released
Larry Tate (cathect) wrote :

I've updated to 9.04 which as the newest virt-manager. However, I continue to have exactly the same issue that I describe before:

I get the error message that "setup cannot read the CD you
inserted." So, the CD-Rom is mounted, and spinning, but the Windows installer gives
an error message that it cannot find disk. I know this is a legitimate disk
and there is nothing physically wrong wither either it or my drive.
Curiously, this behavior persists even when I create an ISO of the disk and
point the Virtual Machine Manager to it.

Chuck Short (zulcss) wrote :

Is this a problem in libvirt?

Changed in libvirt (Ubuntu):
status: New → Incomplete
importance: Undecided → Low
Dustin Kirkland  (kirkland) wrote :

This appears to be fix-released for me in Lucid.

Please reopen if you can reproduce it there. Thanks!

Changed in libvirt (Ubuntu):
status: Incomplete → Fix Released
Changed in virt-manager:
importance: Unknown → Medium
status: Fix Released → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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