Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Sudden fatal error when running any VM with QEMU-KVM

  1. #11
    Join Date
    May 2007
    Beans
    43

    Re: Sudden fatal error when running any VM with QEMU-KVM

    FIXED!!!! Did a bit more googling and found what happened.. Apparently my booting that USB stick somehow caused /dev/kvm permissions to go to root:plugdev instead of
    root:kvm. Changed the perm to root:kvm and voila! its working again.. I would have found it sooner, but for the fact I wasn't up on what the correct permissons for /dev/kvm and google kept me in the dark until I happened to drill down far enough to see a forum that had the correct permissions. I kind of suspected it was supposed to be root:kvm, but really HATE to change things and break them even further... Thanks all who replied!!!!

    Edit: I spoke too soon... After running one VM and closing it down when I tried to start a second, the error was back.. A check of /dev/kvm found that the root/:plugdev perms were back.. I'm not really up on what "plugdev" does, though I strongly suspect its a "plug&play" thing for USB stuff. Now I know WHAT the problem is, but
    have no idea how to prevent plugdev from stealing perms from kvm... If I manually change the kvm perm back to root:kvm, restart libvirtd and then start a vm, and then immediately look at the /dev/kvm perms again. its back to root:plugdev I've tried two different vms and it happens on both..
    Last edited by DuckHook; September 24th, 2021 at 03:46 AM. Reason: Problem is back.. Spoke too soon

  2. #12
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Sudden fatal error when running any VM with QEMU-KVM

    Dang.

    Sorry for not being more involved with this thread the past few days... I have 14 new certifications to study for, for work. (Lenovo and HP) ...and only a week to complete them.

    From the Debian Wiki:
    plugdev: Allows members to mount (only with the options nodev and nosuid, for security reasons) and umount removable devices through pmount. netdev: Members of this group can manage network interfaces through the network manager and wicd.
    And this Bug with plugdev related to kvm: https://bugs.launchpad.net/ubuntu/+s...u/+bug/1884476
    Note remarks 3 & 4... udev rules...

    And this Debian Forum post: https://forums.debian.net/viewtopic.php?p=680731
    Posts #13 & 14 where they also resolved by changing their udev rules.

    That last thread goes into more details, where they found that manually changing the permissions without doing that, was ending up as not being persistent, and were getting changed back from kvm to plugdev, just like your's.
    Last edited by MAFoElffen; September 24th, 2021 at 10:44 PM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  3. #13
    Join Date
    May 2007
    Beans
    43

    Re: Sudden fatal error when running any VM with QEMU-KVM

    Thanks!! Sorry for keeping you from you cert study.. Will scope those links out and hopefully they'll point me to a permanent fix... Good luck on the certs..

  4. #14
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Sudden fatal error when running any VM with QEMU-KVM

    LOL!!! No worries.

    In the past 4 Days, I've completed 7 Dell, 8 HP, and 6 Lenovo Certification Courses. I finished 13 of those in less than 24 hours. I have 4 more required Certs to renew left from Lenovo. I have until Wednesday to finish those 4.

    The way it's going, I might do some of the optional courses, just to add to my Resume. Since I did so well in such a short time, and because of my role, each training opportunity gave me credits to do more Certification Courses... that won't be charged out to the company. If it's free, I might as well take advantage of it.

    Taking a break right now... Here's some links for you:
    - Since it has to do with with permissions and ownership, the title mentions "files", but the article is written for devices (/dev, device files...), which would include and work for /dev/kvm:
    - How to Configure Device File owner/group with udev rules

    More basic:, because these explain how they actually work:
    - Beginners Guide to Udev in Linux
    - Tutorial on how to write basic udev rules in Linux
    Last edited by MAFoElffen; September 26th, 2021 at 08:40 AM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  5. #15
    Join Date
    May 2007
    Beans
    43

    Angry Re: Sudden fatal error when running any VM with QEMU-KVM

    Been awhile since I posted on this topic. Still can't find anything wrong in the /etc/udev/rules.d that is responsible for changing the perms on /dev/kvm
    from root:kvm to rootlugdev. So I "mcgiver'ed" it, wrote a script that sudo's "chown root:kvm /dev/kvm" and then starts virt-manager. This allows me
    to start ONE each VM, which is ok, since that's all I run at one time currently. I can't start more as *somewhere* during the starting of the vm, *something*
    changes /dev/kvm back to rootlugdev... Have posted this elsewhere and NObody seems to have a clue as to what the "smoking gun" is for this problem..

  6. #16
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Sudden fatal error when running any VM with QEMU-KVM

    Do this and post the results to an Ubuntu Pastebin:
    Code:
    grep -r "plugdev" /lib/udev/

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  7. #17
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Sudden fatal error when running any VM with QEMU-KVM

    I just found this fix from another distro where this same thing happened way back in 2009, but should work for this now...

    1. Create the file /etc/udev/rules.d/65-kvm.rules as root
    2. Put the following line inside this file: KERNEL=="kvm", NAME="%k", GROUP="kvm", MODE="0660"
    3. Reload rules with udevadm control --reload-rules && udevadm trigger
    4. With an user that is member of kvm group, try to execute qemu with the -enable-kvm option.
    Updated to what is current now You could try this:
    Code:
    sudo echo -d 'KERNEL=="kvm", NAME="%k", GROUP="kvm", MODE="0660"' > /etc/udev/rules.d/65-kvm.rules
    sudo udevadm control --reload-rules && sudo udevadm trigger --action=change
    sudo update-initramfs -u
    The first line should create the file with those contents. You could always just open an editor with elevated permissions and do the same...And save it to the same path and filename.

    The next line would reload udev without a reboot...

    The 3rd will add the new udev rules to the boot image.

    That should exclusively claim /dev/kvm as root:kvm
    Last edited by MAFoElffen; October 12th, 2021 at 09:57 AM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •