QEMU/KVM/virt-manager installed but I can't make virtualization work.
I decided to see if I could move from VirtualBox to QEMU/KVM for virtualizing. I managed to get things installed by using the SBOpkg list from this thread: https://www.linuxquestions.org/quest....php?p=6394372
I had to juggle some configuration files and user settings, and I got limited success. I can run virt-manager and get the interface. I managed to get the KVM modules installed and the libvirtd and QEMU services running. First thing, I start virt-manager and it informs me that KVM is not available. I query the modules and get back that there are three KVM modules running. I try to create a VM without KVM, and when I go to connect to an ISO file, I get "Failed to connect socket to '/var/run/libvirt/virtstoraged-sock': No such file or directory. At this point, I'm wondering how much effort to put into this, given that I have a working solution in VirtualBox. This is on Slackware64-15.0 |
I have QEMU 8.1.1 and Virt-Manager 4.1.0 installed WITHOUT KVM and run virtual machines running ReactOS, Devuan, Arch Linux, Alpine, KolibriOS, Lilidog, TinyCore, and Sparky Linux. (NOT all at once.) It all works.
I am running on a DELL laptop running Manjaro Linux stable, and I keep it up to date. Kernel version 6.6.0. My desktop i KDE Plasma on Wayland. What do you have? |
Versions of things.
virt-manager 4.1.0 and QEMU 7.2.1.
My system is a Frankensteined concoction of an ASUS motherboard with 64GB of RAM and an Intel i7 processor and assorted add-ons. I tend toward SlackBuilds and and QEMU 7.2.1 is what is there. If 8.1.1 is likely to work I can try compiling that. I have nothing to lose as it isn't working now. Do you think I should try that, or would I be spinning my wheels? I understand that the KVM isn't critical for function, which I is why I tried without it. While better performance would be nice, nothing I do in VMs required blazing speed, just functioning software. |
#1 I would not think it a good idea to apply any urgency to this, since you already have a working solution.
#2 I have not read the release notes for the change QEMU 7 to 8 for a long while, but I do not recall anything there that should be a stopper. #3 I would be embarrassed to tell you how much LONGER (decades) it has been since I touched slackware! QEMU is the more "Linuxy" and FOSS way to do this, so one would thing that SOMEONE more current on Slack' would chime in with advice. Keep trying. You might have to "tune" VirtManager a bit, but QEMU under VirtM gets tuned BY VirtM and that seems to work better for me than manual control. Could it be something in your build of VirtM that is the problem? Because that is where I would look next. |
Looking at the SlackBuild for virt-manager, there is a dependency tree.
Code:
virt-manager-4.1.0/ e.g. build and install the spice-protocol package, then build and install the spice package, then build and install the spice-gtk package. Repeat for the other dependencies, then build virt-manager. Like many Slackware users, for me this just creates increased complexity with ongoing maintenance problems. Far easier just to run QEMU from a simple script. Something like this will get you going Code:
qemu-kvm \ To access an install iso file, add a line like Code:
-cdrom <path and iso filename> \ For me, QEMU is cleaner, faster and easier to maintain on Linux than VirtualBox. |
For KVM, you need:
1. Support in your CPU. AMD and Intel call it by different names. 2. Support/enabled in BIOS. 3. Support in-kernel (usually via kmods). I use QEMU all the time and it works well for a variety of VMs. I use the 8.0.x branch because 8.1.x has broken cursor support in the SPARC emulator with Solaris. Never used virt manager. I learned with just the QEMU command lines so that's what I used. Compicated at first, but once you get used to it they are not too bad. Usually you can copy/paste what you used last time and just tweek it for your next machine. The Slackware packages are old so I built from source. You night need some extra Python stuff to build the docs. |
I will take the above information and see what I can do.
Thanks. |
Quick update - test worked, need to fine-tune, but progress.
I used the command line listed above, tweaked for my test, with a recent version ReactOS.
I needed to run the command with sudo prefixed, and it worked. It did not mess with the permissions of my .qcow2 file, which is stored under my normal user ID. I might need to add some group permissions that I haven't done, either correctly or yet. The performance was absolutely blazing. I was able to install ReactOS in about a minute and a half. I'll be looking into things like enabling networking and such, but that is hopefully just a matter of reading documentation. Thanks. |
Quote:
Let's just simply say that this is the order of things.. 1. kvm 2. qemu 3. libvirt, 4. virt-manager. This is also the order you have to check where the issue is.. With SBO package this is not transparent. However, I can tell you the problem is most likely with libvirt somehow. QEMU is complex, but out of those packages, libvirt adds the most complexity. When you say the problem is virtualization is not working on your machine, that's very generic. It probably works! There can be a thousand different problems with your settings though. You need to narrow down the problem a great deal. One of the first things you can do is to try to run QEMU/KVM directly, without libvirt and virt-manager. Have a look at this page: https://docs.slackware.com/howtos:em...manage_install It might give you some pointers, and tips of things you can try. I'm not saying you need to install everything yourself, but see how it works, and how complex it is, and what the order of things is. That way you can try to figure out the problem in the right order, and narrow things down. |
Quote:
|
Quote:
|
Quote:
Quote:
Quote:
Quote:
|
Quote:
SBO package isn't necessarily the problem in itself, but the problem with something like that is you don't really know how it sets things up, and if you're fresh to what you're doing it will makes it more difficult to find the problem. I mentioned 1-4 in my previous post, those are the 4 elements of the virtualization package, keep that in mind. What virt-manager says is pretty much irrelevant, it's the last thing you should "solve", because it's #4 on the elements. To figure out the problem(s), you need to deal with the 3 other ones first. And for us here on the forum, if we should be able to help you, the issue needs to be narrowed down quite alot. KVM is really a very basic thing, and like others here say, you can run QEMU without KVM. But, ofcourse, you want KVM working. So, how can you check if it works? Try this (in a terminal as root): 1. Check if you have a CPU that support virtualization Code:
lscpu | grep -i virtualization Code:
lsmod | grep kvm Code:
ls -la /dev | grep -i kvm You can quickly test QEMU in many different ways. One way is to boot a kernel image with it directly. Copy any kernel image (ex.vmlinuz-huge-5.15.19) from /boot to /home/user, then run the following command (or something similar): Code:
qemu-system-x86_64 -enable-kvm -kernel /home/user/vmlinuz-huge-5.15.19 This will simply verify if QEMU is working as expected. If KVM is enabled, it should be fairly fast. So, you can even run this without kvm enabled, and perhaps it is much slower, if it is, then kvm is most likely working when you boot with it enabled like above. You can do many different kind of test runs with QEMU, even booting CD's and all kind of things like that. Running virtual machines this way is very flexible, and only the limits of QEMU (which aren't that many) and your imagination will limit what you can do this way. But, you probably want to make this easy. So.. With the abovesteps you will know if QEMU-KVM is working as it should. If it does, the problem is with libvirt and/or virt-manager. Give it a go to narrow down the problem. |
Quote:
Quote:
If I have understood what I've read correctly, I need libvirt for networking. virt-manager would be a "nice to have", but I can live without it. I use bridged networking on VirtualBox so that I can connect between the host and guests. I want to be able to do the same under QEMU. I have libvirtd running, for what that's worth. |
Quote:
At the end of the link I gave you, there is another link: http://docs.slackware.com/howtos:emu...config_methods Have a look at it please. It goes through some of those things. If you are very lucky, it's just a matter of giving virt-manager the right permissions with polkit and/or setting up KVM for user. Quote:
First things first. Ideally if you don't mind it, you should run libvirt daemons as root, that gives libvirt the access it needs to set all those things up quite easily. You need to check how your libvirt daemons run, and what access they have. In the article above, the method is described. If libvirt daemons run as root and work as they should, they grant access to /dev/kvm to setup a user session (or qemu system). You don't have to run the libvirt daemons as root, but it makes things more complicated to run them as user. Secondly virt-manager must have the right access in polkit, as mentioned above, otherwise it can't use libvirt to run qemu/kvm, even if every other authorization is correct, regardless of how you want to run things. But like you said, you don't HAVE to use virt-manager, but it sure makes things more neat. Some people use virsh instead, others use another thing like virt-manager, but less complex (don't remember the name of it). I think everything you need is in that article above, with that you should be able to figure it out. Actually, virtualization is complicated, so don't give up. With all these 4 components, it's very convenient and easy actually, once you get it set up properly. Right now it seems there are some twisted threads, and those just need untangling. |
All times are GMT -5. The time now is 06:19 PM. |