Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34

Thread: Beginning with KVM

  1. #1

    Default Beginning with KVM

    So I attempted to give it a try. Before even starting to create a new virtual machine I stumbled with few initial questions.

    1) SLES docs advise for using the vhost-net module as it's more efficient. So as root user I did "modprobe vhost-net", then confirmed with "lsmod | grep vhost". But after rebooting module is no longer loaded. Is there a way to make it persistent after reboot/shutdown?

    2) I tried getting help for lsmod command, but "lsmod --help" only gave a message "usage: lsmod", and echo $? gave 1, which meant it was an error. This was made as normal user. Does this have consequences for the OS? How can fix?

    3) When first opening virt-manager I saw a grayed-out entry "QEMU/KVM: not connected"; if selecting it there's the option to "connect". But connect to what? There are still no VMs whatsoever yet!

    4) Is there a more graphical way to open virtual machine manager other than having to open terminal and type "virt-manager"?

    Thanks again.

  2. #2
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,711
    Blog Entries
    1

    Default Re: Beginning with KVM

    Rather than using a SLES guide, refer to this guide for openSUSE

    https://doc.opensuse.org/documentati...tallation.html

  3. #3
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,685
    Blog Entries
    3

    Default Re: Beginning with KVM

    Quote Originally Posted by F_style View Post
    So I attempted to give it a try. Before even starting to create a new virtual machine I stumbled with few initial questions.
    I've just started using KVM here.

    1) SLES docs advise for using the vhost-net module as it's more efficient. So as root user I did "modprobe vhost-net", then confirmed with "lsmod | grep vhost". But after rebooting module is no longer loaded. Is there a way to make it persistent after reboot/shutdown?
    I'm not currently using "vhost-net".

    For automatic loading of a module, try
    Code:
    man modules-load.d
    2) I tried getting help for lsmod command, but "lsmod --help" only gave a message "usage: lsmod", and echo $? gave 1, which meant it was an error. This was made as normal user. Does this have consequences for the OS? How can fix?
    You should be able to use:
    Code:
    man lsmod
    3) When first opening virt-manager I saw a grayed-out entry "QEMU/KVM: not connected"; if selecting it there's the option to "connect". But connect to what? There are still no VMs whatsoever yet!
    It connects to "libvirtd", which should be running as a service. Installing KVM sets that up. Once I connect, I see a list of virtual machines.

    4) Is there a more graphical way to open virtual machine manager other than having to open terminal and type "virt-manager"?
    I did it by typing "virt" into the menu search of my desktop.

    I also installed "ovmf" (well, "ovmf", "ovmf-tools", "qemu-ovmf-x86_64"). That gives me the possibility of a UEFI virtual machine.

    First virtual install -- fedora26 (I had already downloaded the iso). I've since deleted that, but I learned something from doing it.

    Second virtual install - openSUSE 42.3. I'm normally a KDE person, so I installed Gnome. This was from the iso, already on my system. On screen 5 of setup, there's a box where I could specify that I wanted extra configuration. That gave me a choice where I could select UEFI. So I did. That virtual machine is running well (except currently not running). Running Yast on that virtual machine, I noticed that it wanted to install "spice-vdagent". So I allowed that to install. And it's great. I can now do copy/paste between the main machine and that 42.3 virtual machine.

    Third virtual install -- Solus. That was a fail. I tried using UEFI. But it seems that the UEFI choice for KVM is locked into secure-boot, and Solus does not do secure-boot.

    I redid without UEFI. And that worked. But as soon as I clicked on something with my mouse, the virtual machine captured the mouse. I later discovered that the manual I am reading ("Virtualization Guide - openSUSE 42.3" a pdf file that I downloaded) explains how to deal with that. So now it's fixed, and Solus no longer captures the mouse. The way that I initially escaped from the captured mouse was to shutdown the virtual machine.

    Final installl (for now) -- another install of fedora26, this time with UEFI. Since fedora does support secure-boot, I expected that to work, and it did.

    I would like to try UEFI without secure-boot. But it looks as if that will require a complicated command line method to specify which virtual firmware file to use.

    In any case, I recommend that you try creating a few virtual machines. You can delete them later. Treat it as a learning experience. Maybe start with openSUSE 42.3.

    My prior practice was bare metal installs (i.e. direct to computer). I'll probably still prefer that, but using KVM adds additional choices.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: Beginning with KVM

    Quote Originally Posted by F_style View Post
    So I attempted to give it a try. Before even starting to create a new virtual machine I stumbled with few initial questions.

    1) SLES docs advise for using the vhost-net module as it's more efficient. So as root user I did "modprobe vhost-net", then confirmed with "lsmod | grep vhost". But after rebooting module is no longer loaded. Is there a way to make it persistent after reboot/shutdown?

    2) I tried getting help for lsmod command, but "lsmod --help" only gave a message "usage: lsmod", and echo $? gave 1, which meant it was an error. This was made as normal user. Does this have consequences for the OS? How can fix?

    3) When first opening virt-manager I saw a grayed-out entry "QEMU/KVM: not connected"; if selecting it there's the option to "connect". But connect to what? There are still no VMs whatsoever yet!

    4) Is there a more graphical way to open virtual machine manager other than having to open terminal and type "virt-manager"?

    Thanks again.
    1. Assuming you've installed properly with libvirt, vhost-net should automatically be enabled and applied. Unless you're specifically running QEMU commands instead, vhost-net should not require any special action on your part.
    https://www.suse.com/documentation/s...quires.install

    You'll have to clarify if you really meant when your HostOS is rebooted (Not the Guest). The module should be automatically loaded (not require manual loading) and always available.

    2. Some commands don't recognize "--help" (or similar). Sometimes "help" works if you use help without any dashes. Otherwise, read the MAN pages instead.

    3. When you launch virt-manager, it should automatically connect to the libvirt "server" running on localhost. If it doesn't, that's a sign something is mis-configured. Verify or manually start your libvirt daemon
    https://doc.opensuse.org/documentati....overview.html

    Beyond that, may require troubleshooting.
    Sometimes re-installing is the only solution.

    4. After a proper installation, you should have new entries in your Desktop Application Menu for both VM Manager and virt-install, sometimes in two places (depends on the Desktop). If you don't see these, like any problem of the vm manager connecting immediately to the libvirt "server" can be an indication you didn't install your virtualization completely and correctly.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  5. #5

    Default Re: Beginning with KVM

    W T H !!??
    Cannot believe it! So my KVM installation is totally buggy!! No vhost-net module automatically loaded when openSUSE host boots, KVM "local server" not automatically connecting when opening virt-manager... WTH!?

    I installed KVM by following the SLES docs, i.e., by goinf to Yast > Virtualization > selecting KVM server (the other KVM option, "KVM tools" was grayed out by default, so I only selected KVM server), then accepting. It went through all the zypper-like process with NO *aparent* errors: all packages downloaded well, all were well installed, I accepted to install network passthrough, and once Yast finished all it didn't even advised for rebooting, yet I did it anyways.

  6. #6
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,685
    Blog Entries
    3

    Default Re: Beginning with KVM

    Quote Originally Posted by F_style View Post
    Cannot believe it! So my KVM installation is totally buggy!!
    I'm guessing that it is fine.
    No vhost-net module automatically loaded when openSUSE host boots, KVM "local server" not automatically connecting when opening virt-manager... WTH!?
    "vhost-net" is loaded here. But I didn't do it manually.

    I'm guessing that it loads when used, which is probably the first time that I start a virtual host.

    When I start "virt-manager", it looks as you describe. So I double-click on the "QEMU/KVM" line, and it connects. After it connects, I can see a list of the virtual hosts that I have setup.
    I installed KVM by following the SLES docs, i.e., by goinf to Yast > Virtualization > selecting KVM server (the other KVM option, "KVM tools" was grayed out by default, so I only selected KVM server), then accepting. It went through all the zypper-like process with NO *aparent* errors: all packages downloaded well, all were well installed, I accepted to install network passthrough, and once Yast finished all it didn't even advised for rebooting, yet I did it anyways.
    That's pretty much identical to what I did. And it all seems to work.

    I did use
    Yast --> Virtualization --> Create Virtual Machines for XEN and KVM
    to install a virtual machine.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  7. #7

    Default Re: Beginning with KVM

    First, do you all know why I verbosely and solely sticked to the SLES 11 documentation?
    From my other thread:
    Quote Originally Posted by tsu2 View Post
    First, a summery and links to my previous posts about documentation... And my criticsm has been hard because IMO it's especially important for recognized and recommended documentation to be accurate. Really good and comprehensive documentation is hard to come by, and when documentation is poor, I can't think of many worse things that exist because of the effect documentation has on disseminating truths and not falsehoods.

    I've reviewed the SLES 12 KVM documentation and find much to be desired. I have a particular beef with the documentation currently easing into the same improperly named concepts as the openSUSE community documentation (which I object to even more strenuously than the SLES 12 documentation).

    My previous posted opinion about SLES 12 virtualization documentation
    https://forums.opensuse.org/showthre...o-to-openSUSE)

    And, the following is my earlier criticism of the openSUSE community documentation. In fact, I posted enough detail that if someone were properly compensated or otherwise motivated, each item I identified could be verified and the documentation fixed.
    https://forums.opensuse.org/showthre...virtualization

    Note that there is some good stuff in the SLES 12 documentation, but because of the misinformation which is also there a student would either have to already know enough to know what to disregard or be prepared to have to unlearn/relearn a number of concepts to be able to move ahead.

    Anyway, bottom line is that IMO the SLES 11 SP4 KVM documentation is <exceptionally> good and complete... And at least for now can be considered an excellent reference. Only after the User becomes well versed in that documentation, then the SLES 12 SP2 KVM documentation is an interesting read because there <are> some nuggets of really good stuff in there, too.
    And I don't think mr tsu2 is nuts or something.

    @nrickert:
    Your comments begin to calm me down a bit, so thanks for that.
    But then, was doing "modprobe vhost-net" as root user a big death mistake, very just like trying "lsmod --help" and getting the error instead of having just "man lsmod"? Did I put the whole OS host in danger or buggy? Do I need to clean reinstall yet again!?

  8. #8
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,685
    Blog Entries
    3

    Default Re: Beginning with KVM

    Quote Originally Posted by F_style View Post
    But then, was doing "modprobe vhost-net" as root user a big death mistake, very just like trying "lsmod --help" and getting the error instead of having just "man lsmod"? Did I put the whole OS host in danger or buggy? Do I need to clean reinstall yet again!?
    Those actions should be harmless. Nothing to worry about.

    Use Yast to install a virtual machine. You can delete it later. It's just to get some practice.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  9. #9
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    15,685
    Blog Entries
    3

    Default Re: Beginning with KVM

    Quote Originally Posted by nrickert View Post
    I would like to try UEFI without secure-boot. But it looks as if that will require a complicated command line method to specify which virtual firmware file to use.
    I finally succeeded at this, after a few more false starts.

    The magic incantation (i.e. command) that worked was:

    Code:
    virt-install --name efisolus --memory 4096 --vcpus 2 --disk size=20 \
     --cdrom /shared/iso/solus/Solus-2017.04.18.0-Budgie.iso \
     --boot loader=/usr/share/qemu/ovmf-x86_64-code.bin,loader_ro=yes,loader_type=pflash,nvram_template=/usr/share/qemu/ovmf-x86_64-vars.bin,loader_secure=no
    Two parts of that command are specific to Solus (the "--name efisolus" and the argument following "--cdrom"). Those are the part that would have to change to install a different system.

    I'm not sure whether that "loader_secure=no" actually does anything. I used the output of
    Code:
    man virt-install
    as a guide.
    openSUSE Leap 15.3; KDE Plasma 5.18.6;

  10. #10
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: Beginning with KVM

    Quote Originally Posted by F_style View Post
    First, do you all know why I verbosely and solely sticked to the SLES 11 documentation?
    From my other thread:

    And I don't think mr tsu2 is nuts or something.

    @nrickert:
    Your comments begin to calm me down a bit, so thanks for that.
    But then, was doing "modprobe vhost-net" as root user a big death mistake, very just like trying "lsmod --help" and getting the error instead of having just "man lsmod"? Did I put the whole OS host in danger or buggy? Do I need to clean reinstall yet again!?
    You'll notice in all my posts
    - Like all other posts in these openSUSE forums, the assumption is that you're installing on openSUSE. If you're installing on SLES, then go to those forums, I very rarely post anything that applies to SLES.
    - Use YaST to install your KVM/Xen/LXC, do not otherwise follow SLES Documentation for installing
    - Once your virtualization is installed, <then> everything you might read in the SLES documentation is fully applicable to understanding and doing virtualization on openSUSE.

    Sp. I think it's pretty straightforward.
    1. Use YaST to install.
    2. Use SLES 11 SP4 documentation for 99.9% of everything thereafter.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Page 1 of 4 123 ... LastLast

Posting Permissions

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