[HowTo] Install QEMU/KVM on antiX

Forum Forums General Software [HowTo] Install QEMU/KVM on antiX

Tagged: ,

  • This topic has 19 replies, 9 voices, and was last updated Sep 24-6:34 am by andyprough.
Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #75962
    Member
    rayluo

      Hi community,

      Not sure how many community members here use QEMU/KVM to power their virtual machines. Presumably fewer than the VirtualBox users, because VirtualBox is readily available from antiX’s Package Installer, QEMU/KVM is not. It took me a while to figure out how to setup QEMU/KVM on antiX21, but now I have put my learning into one installation script, so that it would become just one click/command away to have “Virtual Machine Manager” available in your Applications menu.

      Enjoy. By the way, a VM powered by QEMU/KVM is 20% faster than by VirtualBox. Nice to have those extra power at your fingertips. 🙂

      #75967
      Anonymous
        Helpful
        Up
        0
        ::

        Thanks for sharing the script. I have a few questions regarding
        authentication unavailable: no polkit agent available to authenticate action ‘org.libvirt.unix.manage’
        mentioned within your installation script:

        Does your script presume that one//all of the following are installed on the system?
        (I checked and found that they are preinstalled in antiX 21 FULL edition, but are absent from Base edition)

        gir1.2-polkit-1.0
        libpolkit-agent-1-0
        libpolkit-gobject-1-0
        libpolkit-gobject-elogind-1-0

        If missing, will they be automatically installed, as dependencies, when the following command is run?
        sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager libguestfs-tools -y

        I am unsure whether “libpolkit-gobject-elogind-1-0” package is, in fact, necessary, but… should the installation script test whether the needed polkit -related packages are present on the system?

        #75986
        Member
        olsztyn
          Helpful
          Up
          0
          ::

          Enjoy. By the way, a VM powered by QEMU/KVM is 20% faster than by VirtualBox.

          Thank you Rayluo for the KVM installation process. I was actually planning to install and such script will come in handy…
          In reference to the quoted statement:
          KVM appears to be more efficient virtual engine, however not as user friendly. The way I understand also integration with host hardware is limited, such as mouse, USB and video. Is this still correct to say, or my info is too outdated?
          Thanks again…

          Live antiX Boot Options (Previously posted by Xecure):
          https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

          #76031
          Moderator
          christophe
            Helpful
            Up
            0
            ::

            Thanks you this, rayluo.
            I’m playing with it now….

            confirmed antiX frugaler, since 2019

            #76046
            Member
            rayluo
              Helpful
              Up
              0
              ::

              Does your script presume that one//all of the following are installed on the system?
              (I checked and found that they are preinstalled in antiX 21 FULL edition, but are absent from Base edition)

              gir1.2-polkit-1.0
              libpolkit-agent-1-0
              libpolkit-gobject-1-0
              libpolkit-gobject-elogind-1-0

              I should have mentioned that I use antiX full version exclusively, so, all my scripts were only developed from, and tested on antiX full version. (Aside: this forum does not seem to allow me to modify my old post. Otherwise I would clarify that in my first post above.)

              If missing, will they be automatically installed, as dependencies, when the following command is run?
              sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager libguestfs-tools -y

              As mentioned above, I haven’t tested it with antiX base version. Perhaps you can just go ahead and try it. If some of them are indeed necessary, let me know, I can add it into my script.

              KVM appears to be more efficient virtual engine, however not as user friendly. The way I understand also integration with host hardware is limited, such as mouse, USB and video. Is this still correct to say, or my info is too outdated?

              I am still a fairly new KVM user (that installation script was the byproduct of my first encounter of KVM during my weekend hobby project). So, just take my opinion with a grain of salt. My understanding is the QEMU/KVM was originally developed as a lower level infrastructure (fwiw, kvm is a Linux kernel module), which provides better performance, but traditionally only available with command-line interface (CLI). That CLI might be considered as “less user friendly”? But my installation script also installs a GUI “Virtual Machine Manager” into your Start menu. With that GUI, I’d say its user friendness is comparable to Virtualbox.

              And, once your VM is up and running, the mouse and video/audio all work well. I did not have a chance to test any other USB devices (other than the mouse), though. That being said, I haven’t figured out to use USB external storage on Virtualbox, either. So, to me, QEMU/KVM is not worse than Virtualbox in this regard.

              #76059
              Moderator
              christophe
                Helpful
                Up
                0
                ::

                I use antiX base, generally, so I was able to check.
                gir1.2-polkit-1.0 & libpolkit-agent-1-0 are not installed as dependencies. The other 2 listed above are installed on my “base” antiX system, after running your install script.

                confirmed antiX frugaler, since 2019

                #76071
                Member
                olsztyn
                  Helpful
                  Up
                  0
                  ::

                  Attempted to install and ran into conflict right on the first part. It appears to require sysvinit while I am running runit antix21. I will try to figure out what needs to be changed…
                  “The following packages have unmet dependencies:
                  runit-core-services-antix : Conflicts: initscripts but 2.96-7 is to be installed
                  Conflicts: initscripts:i386
                  runit-init-antix : Conflicts: sysvinit-core but 2.96-7 is to be installed
                  sysvinit-core : Depends: sysvinit-utils (>= 2.86.ds1-66)
                  E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

                  • This reply was modified 1 year, 3 months ago by olsztyn.

                  Live antiX Boot Options (Previously posted by Xecure):
                  https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

                  #76073
                  Forum Admin
                  anticapitalista
                    Helpful
                    Up
                    0
                    ::

                    The problem is with libguestfs-tools

                    apt install libguestfs-tools 
                    Reading package lists... Done
                    Building dependency tree... Done
                    Reading state information... Done
                    Some packages could not be installed. This may mean that you have
                    requested an impossible situation or if you are using the unstable
                    distribution that some required packages have not yet been created
                    or been moved out of Incoming.
                    The following information may help to resolve the situation:
                    
                    The following packages have unmet dependencies:
                     runit-core-services-antix : Conflicts: initscripts but 2.96-7 is to be installed
                                                 Conflicts: initscripts:i386
                     runit-init-antix : Conflicts: sysvinit-core but 2.96-7 is to be installed
                     sysvinit-core : Depends: sysvinit-utils (>= 2.86.ds1-66)
                    E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

                    Philosophers have interpreted the world in many ways; the point is to change it.

                    antiX with runit - leaner and meaner.

                    #76074
                    Member
                    olsztyn
                      Helpful
                      Up
                      0
                      ::

                      The problem is with libguestfs-tools

                      Thanks for identifying the issue. Is there any workaround?
                      Thanks and Regards…

                      Live antiX Boot Options (Previously posted by Xecure):
                      https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

                      #76075
                      Forum Admin
                      anticapitalista
                        Helpful
                        Up
                        0
                        ::

                        Thanks for identifying the issue. Is there any workaround?
                        Thanks and Regards…

                        No idea.

                        Is libguestfs-tools really required?

                        Philosophers have interpreted the world in many ways; the point is to change it.

                        antiX with runit - leaner and meaner.

                        #76078
                        Member
                        olsztyn
                          Helpful
                          Up
                          0
                          ::

                          Is libguestfs-tools really required?

                          Great question that appears to solve this issue…
                          I just checked on my the second best Linux distro (right after antiX, of course) where I have kvm installed (it was actually an option during OS installation process), which (kvm/qemu) seems to work fine and at firs sight libguestfs-tools appear to not be installed…
                          Thanks for the tip!

                          Live antiX Boot Options (Previously posted by Xecure):
                          https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

                          #76079
                          Member
                          olsztyn
                            Helpful
                            Up
                            0
                            ::

                            Just reporting progress:
                            KVM/QEMU completed all setup successfully and appears to start fine per process outlined by rayluo, omitting libguestfs-tools from the installation.
                            This is on antiX 21 Runit.

                            Thanks rayluo for the process outline, which has all the necessary pieces in one place and thanks anticapitalista for the tip.
                            Great to see KVM on antiX as well, which might be the best suited to run such VM infrastructure due to minimal memory footprint…

                            • This reply was modified 1 year, 3 months ago by olsztyn.

                            Live antiX Boot Options (Previously posted by Xecure):
                            https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

                            #76109
                            Moderator
                            christophe
                              Helpful
                              Up
                              0
                              ::

                              Well, my initial testing is on my 32-bit core duo laptop on antiX-21.

                              And it is INFINITELY faster than virtualbox, because…

                              …vitualbox dropped 32-bit support, since antiX-19! 😉

                              • This reply was modified 1 year, 3 months ago by christophe.

                              confirmed antiX frugaler, since 2019

                              #76217
                              Member
                              rayluo
                                Helpful
                                Up
                                0
                                ::

                                Is libguestfs-tools really required?

                                Great question that appears to solve this issue…
                                I just checked on my the second best Linux distro (right after antiX, of course) where I have kvm installed (it was actually an option during OS installation process), which (kvm/qemu) seems to work fine and at firs sight libguestfs-tools appear to not be installed…
                                Thanks for the tip!

                                Good to know that libguestfs-tools is not strictly required.

                                Like I said, I am still new in this area. That “part 1” of my script – including that libguestfs-tools – was initially copied from somewhere else, aiming to run some particular docker image. I did not reach that far. The “part 2” was a byproduct when I attempted troubleshooting on part 1.

                                On a close look, the libguestfs-tools is only used for this purpose: “libguestfs is a set of tools for accessing and modifying virtual machine (VM) disk images.” So, as long as your normal operations do not reach that territory, I think it would be fine to skip libguestfs-tools.

                                Great to see KVM on antiX as well, which might be the best suited to run such VM infrastructure due to minimal memory footprint…

                                my initial testing is on my 32-bit core duo laptop on antiX-21.

                                And it is INFINITELY faster than virtualbox, because…

                                …vitualbox dropped 32-bit support, since antiX-19! 😉

                                That is a good point. 😀 It would be great if antiX’s package installer would provide KVM as an alternative option, alongside with VirtualBox.

                                #76219
                                Member
                                PPC
                                  Helpful
                                  Up
                                  0
                                  ::

                                  If this does work (as it seems it does), maybe this script could be addapted and added to Package Installer (along with a simple GUI for QEMU, there are some available).
                                  A mini tutorial on how to use qemu (to launch .iso’s, to launch cd/dvd’s and install to a virtula disk) is available here: https://linux-tips.com/t/booting-from-an-iso-image-using-qemu/136

                                  I got this error on the very last part of the script (on antiX 19.X 64bits, sysv):

                                  [....] Starting DNS forwarder and DHCP server: dnsmasq
                                  dnsmasq: failed to create listening socket for port 53: Address already in use
                                   failed!
                                  invoke-rc.d: initscript dnsmasq, action "start" failed.

                                  P.

                                  Edit:
                                  I tried to test qemu by running antiX’s iso in VM. I only got this:

                                  qemu-system-x86_64 -boot d -cdrom ~/antiX-21_386-full.iso -m 1024
                                  VNC server running on ::1:5900

                                  qemu-system-i386 -boot d -cdrom ~/antiX-21_386-full.iso -m 1024
                                  Got me the same result.

                                  qemu-system-x86_64    -boot d \
                                                        -cdrom ~/antiX-21-b2-runit_x64-full.iso \
                                                        -m 1024 \
                                                        -curses

                                  Shows, for a fraction of a second, a “seabios” text then switches to 800×600 empty screen and stops.

                                  The terminal didn’t freeze, but nothing happened… Long ago I used to test iso’s with qemu this way… Am I missing something?

                                  • This reply was modified 1 year, 3 months ago by PPC.
                                  • This reply was modified 1 year, 3 months ago by PPC.
                                  • This reply was modified 1 year, 3 months ago by PPC.
                                Viewing 15 posts - 1 through 15 (of 20 total)
                                • You must be logged in to reply to this topic.