On Thu, 16 Apr 2009, Mark McLoughlin wrote:
On Thu, 2009-04-16 at 07:48 -0400, Robert P. J. Day wrote:
> apparently, i made one lame-brained move yesterday that almost
> certainly caused my VM to run thigh-suckingly slowly. following
> the linux KVM FAQ, i wanted to configure KVM so i could run it as
> a non-root user. to that end, i
>
> * created a "kvm" group,
> * added my user account to the kvm group, and
> * added the rules file /etc/udev/rules.d/60-kvm.rules:
>
> KERNEL=="kvm", GROUP="kvm"
>
> i re-initialized udev with:
>
> # udevadm control --reload-rules (right?)
>
> unloaded my kvm modules (kvm and kvm_amd), reloaded them and, sure
> enough, my new /dev/kvm device file had a group affiliation of
> kvm. excellent, i thought, and away i went ... with still
> painfully slow performance, until i realized that i was still in
> my original desktop session which *wasn't* considered part of the
> kvm group. so a quick logout, log back in and things were much
> better.
>
> *that's* the sort of thing i'm trying to document as i write all
> of this up -- those slight oversights which no one bothers to
> mention that eventually bite you in the butt.
You absolutely should not have needed to do that. We very much want
this to "just work".
Please give some more details so we can get to the bottom of what
your problem was.
actually, this is one case where qemu/kvm appears to have worked
properly, and it was my mistake. from here:
http://www.linux-kvm.org/page/FAQ#How_can_I_use_kvm_with_a_non-privileged...
you read how to allow kvm usage as a non-root user with udev. so (and
the following is from memory), first, i created the new group "kvm",
then added my regular user account to that group. piece of cake.
next, i added a new udev rules file, 60-kvm.rules, which contained
only:
KERNEL=="kvm", GROUP="kvm"
unloaded kvm modules, reloaded, but /dev/kvm was still (root, root).
then realized i needed to get udev to reconsult its rules to pick up
that new file, so i ran:
# udevadm control --reload-rules
unloaded modules, reloaded and /dev/kem was now (root, kvm), as it
should be.
annoyingly, installing was still screamingly slow until i realized
that i was still logged into my desktop from my user account which did
*not* have kvm groupship (verified that with "id" in an xterm). so
logged out of X, logged back in as same account, i was now in the
"kvm" group, and things went *much* faster.
here's the rub -- i think there was a reboot in there somewhere and
i'm not sure if that affected anything. but if you read that linux
kvm FAQ again:
http://www.linux-kvm.org/page/FAQ#How_can_I_check_that_I.27m_not_falling_...
In that case, you can check that:
* the modules are correctly loaded lsmod|grep kvm
* you don't have a "KVM: disabled by BIOS" line in the output of dmesg
* /dev/kvm exists and you have the correct rights to use it
that last point seems fairly adamant that your account *needs* access
to /dev/kvm so, if that's true, i *shouldn't* have had HW support
until i did all of the above. i don't see how you could shortcut any
of the above. would anyone else like to try it and see if it matches
what happened to me?
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Annoying Kernel Pedantry.
Web page:
http://crashcourse.ca
Linked In:
http://www.linkedin.com/in/rpjday
Twitter:
http://twitter.com/rpjday
========================================================================