Announcement

Collapse
No announcement yet.

virt-manager

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    virt-manager

    qemu/kvm via virt-manager is speedy compared to Virtualbox for VMs

    Wikkid fahst (1)




    That is all.






    (1) That is my approximation of a Maine accent

    #2
    I'll second that!

    And, for those running BTRFS, you'll need to mark the directory in which you save the virtual HD's as nocow BEFORE you create your first VM, and point your virutal drive to that directory. From btrfs(5): "within a single file system, it is not possible to mount some subvolumes with nodatacow and others with datacow. The mount option of the first mounted subvolume applies to any other subvolumes." That eliminates the desire to create a @vmimages subvolume in which to store vm images.
    But, nodatacow doesn't apply to directories within a subvolume. So, using

    $ chattr +C /path/to/vmimages

    before any images are created and saved in /path/to/vmimages will make the vm immages nocow.

    From chattr man page: "For btrfs, the 'C' flag should be set on new or empty files. If it is set on a file which already has data blocks, it is undefined when the blocks assigned to the file will be fully stable. If the 'C' flag is set on a directory, it will have no effect on the directory, but new files created in that directory will have the No_COW attribute."

    So, what if you've already created a vmimage file? Here is how you can revert it to nocow, first making sure the VM program is shut down:

    $ mv /path/to/dir /path/to/dir_old
    $ mkdir /path/to/dir
    $ chattr +C /path/to/dir
    $ cp -a /path/to/dir_old/* /path/to/dir
    $ rm -rf /path/to/dir_old

    For a single vmimage file this method can be used:

    F=/path/to/vmimage
    T=/path/to/tmpfile
    touch $T
    chattr +C $T
    dd if=$F of=$T bs=1M
    rm $F
    mv $T $F

    My experience with virt-manager was that the virtual distro was almost as fast as my
    Kubuntu system, and it had access to all of my hardware.

    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      I copied the first command to terminal 'chattr +C /path/to/vmimages' and got an error message. What do I have to change to get it to work? I was running the new Kubuntu using Cow and it ran right but felt a little slow, especially when updating. I have btrfs.

      Comment


        #4
        You can't just copy/paste 'chattr +C /path/to/vmimages'; that simply won't work. You have to change '/path/to/vmimages' to the actual path on your system to your VM images.
        Windows no longer obstructs my view.
        Using Kubuntu Linux since March 23, 2007.
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Lol way to make something extra complicated

          I just installed stuffs and opened the program from my menu and did things with it.

          Comment


            #6
            Using Dolphin, the path turned out be root/var/lib/libvirt/images (which is locked down). But when I do the chattr +C command, I get an error message saying the file doesn't exist. What am I doing wrong?

            Comment


              #7
              Originally posted by oldgeek View Post
              Using Dolphin, the path turned out be root/var/lib/libvirt/images (which is locked down). But when I do the chattr +C command, I get an error message saying the file doesn't exist. What am I doing wrong?
              See https://www.howtogeek.com/117635/how...nes-on-ubuntu/


              Only the root user and users in the libvirtd group have permission to use KVM virtual machines. Run the following command to add your user account to the libvirtd group:
              sudo adduser name libvirtd

              Then,
              After running this command, log out and log back in. Run this command after logging back in and you should see an empty list of virtual machines. This indicates that everything is working correctly.

              virsh -c qemu:///system list
              At this point, before you actually add a virtual HD, open a Konsole and as root and set

              chattr -C /var/lib/libvert/images

              so that they won't interfere with BTRFS. You probably won't need to use more than 16GB for your VM. Don't select all your available free space or misery will result and you will have to roll back to a previous @something and @homesomething.

              Here is some more help
              https://help.ubuntu.com/community/KVM/VirtManager
              Last edited by GreyGeek; Apr 18, 2020, 01:46 PM.
              "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
              – John F. Kennedy, February 26, 1962.

              Comment


                #8
                That did the trick! I'm using Focal Fossa on Virt-manager right now and I can see the difference. Thanks for the advice.

                Comment


                  #9
                  Using KVM-VertManager gives the VM a performance that is almost equal to a bare metal install, or at least significantly faster than VirtualBox, in my experience.
                  "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                  – John F. Kennedy, February 26, 1962.

                  Comment


                    #10
                    I have rarely used Virtual Box. Virt-manager seems easier to operate, and I like the graph.

                    Comment

                    Working...
                    X