Announcement

Collapse
No announcement yet.

Qemu & virt-manager on Neon

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

    Qemu & virt-manager on Neon

    I looked at qemu/kvm briefly some years ago, perhaps a decade, IIRC.

    In another thread virt-manger was highly praised and I decided to putzed around abit with it. I it hadn't improved much. In that thread I was given reasons to re-examine my experience. That led me to getting serious and re-installing installing virt-manager, qemu-system and all that they haul down the pipe.

    By co-incidence I also happened to find my licensed copy of XP SP2. And, Maui1, a successor to Netrunner 17 was released, as was openSUSE-Leap41. Both are plasma5 releases. Three nice candidates to test Qemu/kvm.

    My initial, and somewhat casual, first experience with the latest Qemu/kvm led to the problem of creating a fixed virtual HD, because I use btrfs and it does not like dynamically sized files. I went ahead anyway and used qcow2, the recommended dynamic drive, primarily because the virt-manager gui didn't give an unambiguous method of creating a fixed size *.img file. I tried "file" and "raw" but they seemed hit and miss, and Maui1 and openSUSE didn't perform well using either.

    Then I decided to read some documentation and watch some youtube videos. The video by Dan Sheffner was long but very informative. For help installing XP I found this article.

    The key to using qemu is creating your virtual HD manually, not through the gui, because the gui lacks many parameters that are necessary when installing a guest OS on btrfs or installing a Windows guest OS.

    First, open a Konsole and issue "sudo su -" so that you don't have to repeatedly use the sudo command. Then cd to
    /var/lib/libvirt/images/

    which is a "pool" where the HD images are stored. (Ya, it's a directory) I found it a good idea to save downloaded ISO's to that directory because the gui, virt-manager, uses that location as its default "pool". Later you can create other "pools" in other locations.

    The command to make an openSUSE Leap-41 fixed sized HD is:
    qemu-img create -f qcow2 -o nocow=on mint18kde5.qcow2 25G

    The format (-f) is qcow2 (qemu's copy on write version 2), but since I am using btrfs I need to use the parameter which turns off copy on write (-o nocow=on), followed by the name and extension of the virtual HD and then the size. It doesn't take long.

    The virtual disks for Maui1 and winxp are made identically, except for the name.
    I used the qemu gui, virt-manager, to install Maui1 and openSUSE by selecting their ISO for the install source, and their qcow2 HDs for the destination. I also chose to configure the setup before the install began.


    The method for installing the winxp quest is different, because of the installation will be from the winxp CDROM, not an ISO file, so the command line is used.

    qemu-system-i386 -m 256 -hda ./winxp.qcow2 -cdrom /dev/cdrom -boot d

    I used qemu-system-i386 (I could have used the qemu-sysstem-x86_64), and set the memory at 256, and told qemu to use the cdrom at /dev/cdrom with the -boot command and "d". Winxp installed the slowest of the three, taking nearly two hours, but it loads the fastest, runs the fastest and shuts down the fastest. Maui1 takes the longest to shut down, at least 3 to 4 minutes.

    It is very easy to resize the displays, openGL is available (3.1, 3.0,2.1) as is wayland. I found no setting for 3D acceleration, but I plan to try a game that uses it to see if it can run. More than likely it is in the copious amount of Konsole commands and parameters available to the user.

    I was able to to use a virsh command (domiflist) to list the domains and their internet mac addresses. From that I can use the arp command in a console to pull the IP address out of the guest OS. (arp -e | grep macaddress).
    With the IP address I can use SSH to log into the domain, if it is running, and do what one can usually do with a remote connection:
    ssh yourdomainname@the.ip.address.wyz -l accountname

    You'll be asked for the account password (you can't remotely access root) and then you are in. You can move files back and forth, make configuration changes and do other things with the CLI tools available.

    All in all I love the way qemu works, its versitility and power. And, it is fast.
    "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.

    #2
    Here are a couple screen captures of my new WinXP VM desktop, and the second is the only reason why I reinstalled it, Parker IQAN PCL designer/Dev.

    Click image for larger version

Name:	Screenshot_20160831_172635.jpg
Views:	1
Size:	71.9 KB
ID:	643299

    Click image for larger version

Name:	Screenshot_20160831_172745.jpg
Views:	1
Size:	108.9 KB
ID:	643300
    "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
      Are you using the spice client for the guest GUI? Just curious. It recently broke in Debian sid and I'm having to boot Debian stable to use my Win 10 VM.

      Comment


        #4
        I'm still too new to Virt-Manager, QEMU and KVM to fully understand what is going on and what is being used and why.

        I am using Btrfs. Because of that I used the "-o nocow=on" parameter when I created the 20GB 1cow2 HD image on the CLI. The virt-manager GUI does NOT have the option to use nocow.

        When I run WinXP I use qemu-system-x86_64 with the ""--enable-kvm"" option and it dramatically increases the speed of the guest. But, even without that appendage WinXP runs reasonably fast anyway.

        The Spice server is the type used for the display by default.
        The "Channel Device" type is spicevmc with type virtio and target name: com.redhat.spice.0
        The Video is QXL.

        I added a "FileSystem" option to the configuration. It automatically uses type: mount, which I can't change. I selected driver: Path, Mode:Squash, Write Policy: Immediate, Source Path: /home/jerry/Downloads, and Target Path: C:\Documents~\jerry\Downloads. Unfortunately, that filesystem bidirectional connection to the host doesn't work.
        Click image for larger version

Name:	Screenshot_20160901_104714.png
Views:	1
Size:	79.1 KB
ID:	643301

        So then I cd'd into my Downloads directory and issued:
        python SimpleHTTPServer 8080 (8000 is taken by the icecast2 server)
        and opened a hole on the firewall on WinXP for port 8080, but FireFox on WinXP timed out on any IP I tried, which included 10.0.2.2:8080, 192.168.122.82:8080. 0.0.0.0:8080 and 192.168.1.1:8080 (which displayed my Wireless HTML !!!).
        Then I created a bridge on my host using NetManager and gave it an IP 192.168.1.112. I could ping that IP address from a DOS box in WinXP but FireFox still timed out trying to load the webpage served by SimpleHTTPServer on 8080.

        I also tried SMB by starting winxp.qcow2 with
        qemu-system-x86_64 -smb /home/jerry/Shared -m 512 winxp.qcow2 -enable-kvm
        but even after starting NET in a DOS box WinXP wouldn't see my host or the group it was in.

        I'm not saying that all these features won't work, but I am saying I don't know qemu/kvm/virt-manager well enough to use it knowledgeably. However, it is easy enough to learn for the basic install, which suites me just fine, and, it gives me a new toy to play with.

        Fortunately, I tried the USB Redirector1, which is type spicevmc, to allow a USB stick to transfer files back and forth, and that worked.

        I noticed that the Virt-manager GUI that is in the repository is somewhat behind the one shown in screenshots on the Virt-manager webpage. The screenshots shows options not present on the one in the repository.

        I didn't time it but I'd estimate that it took at least 2 to 3 hours to install the WinXP guest OS off of the CD that I bought 12 years ago. Sadly, during the install my validation ID wasn't recognized because Microsoft has taken down the validation site, so I had to use other means to validate my Circuit City purchased LEGAL copy of WinXP SP2.
        Last edited by GreyGeek; Sep 01, 2016, 11:03 AM.
        "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


          #5
          It sounds like your expertise with qemu/kvm runs about as deep as mine. I got tired of VMware's fragile module-builder breaking with every new kernel version, and bit the bullet about a year ago to learn to use KVM. (I need a Windows system to support some proprietary genealogy tools.) I practiced with Win 8, and when I worked out a repeatable process, I set up Win 10 on a virtual hdd that can grow to 40 GB if needed. I put together the process from parts of perhaps three different sources that google could find, including the Debian wiki. I used the Fedora virtio-win-xxx iso images for scsi drivers and such. I use a 64 GB USB stick to transfer my website out of Windows so I can upload it from Linux (I don't install or need any third-party security protection on Win 10 because that is not used for browsing or other Internet work.). Lately some of the KVM and spice dependencies have been undergoing upgrades in sid, and when they pulled gir1.2-spice-client-gtk-2.0:amd64, that was the end of my spice display. I assume full support for KVM and spice will return one of these days before sid becomes stretch, but meanwhile I am using Debian 8.5 to run my VM and it works just fine. I have it on a SSD, on an ext4 filesystem on my desktop rig with a quad-core CPU and tons of RAM.

          Comment


            #6
            Originally posted by GreyGeek View Post
            I'm still too new to Virt-Manager, QEMU and KVM to fully understand what is going on and what is being used and why.
            You probably already know this since after 2 days you already know more than I do, but the complete xml configuration files for all of your virtual machines are stored in etc>libvirt>qemu. To tweak them you would use 'virsh edit Your_machine_name'. By the way these machines are very easy to clone (right click the machine in virt-manager and clone or use virsh).

            Comment


              #7
              Originally posted by dibl View Post
              It sounds like your expertise with qemu/kvm runs about as deep as mine. I got tired of VMware's fragile module-builder breaking with every new kernel version, and bit the bullet about a year ago to learn to use KVM. (I need a Windows system to support some proprietary genealogy tools.) I practiced with Win 8, and when I worked out a repeatable process, I set up Win 10 on a virtual hdd that can grow to 40 GB if needed. I put together the process from parts of perhaps three different sources that google could find, including the Debian wiki. I used the Fedora virtio-win-xxx iso images for scsi drivers and such. I use a 64 GB USB stick to transfer my website out of Windows so I can upload it from Linux (I don't install or need any third-party security protection on Win 10 because that is not used for browsing or other Internet work.). Lately some of the KVM and spice dependencies have been undergoing upgrades in sid, and when they pulled gir1.2-spice-client-gtk-2.0:amd64, that was the end of my spice display. I assume full support for KVM and spice will return one of these days before sid becomes stretch, but meanwhile I am using Debian 8.5 to run my VM and it works just fine. I have it on a SSD, on an ext4 filesystem on my desktop rig with a quad-core CPU and tons of RAM.
              VMware's fragility during kernel upgrades is exactly why I abandon it. Your use of qemu/kvm/virt appears more advanced than the level I've achieved so far.

              Originally posted by wartnose View Post
              You probably already know this since after 2 days you already know more than I do, but the complete xml configuration files for all of your virtual machines are stored in etc>libvirt>qemu. To tweak them you would use 'virsh edit Your_machine_name'. By the way these machines are very easy to clone (right click the machine in virt-manager and clone or use virsh).
              Virsh is an amazing tool with a TON of commands and options. I saw the admonition to use virsh as the editor of xml files in the leading comment section of my winxp.xml file. I've clones my winxp.qcow2 and created a snapshot of it as well. I have a LOT to learn about these tools.

              BTW, On a lark I reinstalled VirtualBox so I could compare how my copy of WinXP installed an ran in it. The install using virt-manager took between two and three hours. On VBox the same CD install took 45 minutes. Speedwise, I'll have to give the edge to qemu-system-x86_64 with --enable-kvm. Flexibility and CLI ability? Qemu/virt-manager/kvm/CLI win hands down.

              PS- I forgot to mention that when I created a bridge via NetManager in an attempt to pass files into my winxp guest, winxp became intermittently laggy, and on occasion stopping both the host and the guest for a few seconds. I dismantled the bridge.
              Last edited by GreyGeek; Sep 01, 2016, 08:42 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
                Continuing my experiments with virt-manager, qemu and kvm:

                I was not able to create a bidirectional shared folder to my WinXP host. I suspected it must be a windows problem. I was wrong.
                On my Maui1 guest I dupicated the filesystem settings I had for WinXP, as shown in the post above, but it did not work in Maui1, either.

                The "type" is fixed at "mount". I haven't checked with virsh to see if this is negotiable. In the examples I've seen using a more recent version of the virt-manager gui that type option is settable.

                For "driver" I've tried path and default. I haven't read yet what "handle" is.

                For "mode" I've tried squash, passthrough and default.

                For "write policy" I've tried immediate and default.

                The "source" and "target" have the same name in both my Maui1 guest and my Kubuntu host. I used "/home/jerry/Shared" on both. I have no info telling me that any additional prefixes or suffixes are necessary. When I use the browse button on the "source" it takes me to the "pool" dialog where I can create a "Shared" pool and then it lets me select a host directory. But that doesn't work either.

                I'm continuing to use the USB sneaker connection.
                "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


                  #9
                  There is a section in the Debian wiki on setting up host-to-guest networking in KVM, using something called a "macvlan" bridge, but I never tried it. Maybe I'll give it a shot and see what happens -- it's not complicated.

                  Comment


                    #10
                    Following the guidance in the wiki, I set up macvlan0 as a bridge. In the Win10 guest I changed the network from br0 bridged to macvlan0 (macvtap) bridged. At that point a little yellow warning symbol popped up with a note that approximately said "Macvlan host to guest networking usually doesn't work". So I bravely "applied" the setup anyway. When I started the VM, the Win 10 boot process ran about 0.5 seconds and froze, and it's been frozen for 5 minutes now, with 2 of my 8 CPU threads pegged at 100%. So I'm gonna go out on a limb and say it doesn't actually work. At least not on my (relatively non-exotic) hardware.
                    Last edited by dibl; Sep 02, 2016, 02:04 PM.

                    Comment


                      #11
                      Originally posted by dibl View Post
                      .... In the Win10 guest I changed the network from br0 bridged to macvlan0 (macvtap) bridged.....
                      So you already had a bridge set up rather than the default NAT? Did you set up br0 manually in interfaces or were you able to set it up through network manager? Bridging through network manager didn't work a few Kubuntu versions back but it looks like it might work now. I know a bit off topic but just curious.

                      Comment


                        #12
                        Besides the various combinations for the "filesystem" paramters I also tried an smb connection. Ran into the bug on smb on both Neon and Maui1. Couldn't connect them (I had holes in my firewall for SAMBA). If nothing else, qemu vm's are impenetrable fortresses!
                        "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


                          #13
                          Originally posted by wartnose View Post
                          So you already had a bridge set up rather than the default NAT? Did you set up br0 manually in interfaces or were you able to set it up through network manager? Bridging through network manager didn't work a few Kubuntu versions back but it looks like it might work now. I know a bit off topic but just curious.
                          The default NAT connected to the internet without problems, but when I ran "python -m SimpleHTTPServer 8080" in my Shared directory I could not connect using FF in my guest OS. It timed out. That led me to create a bridge on my subnet using NetworkManager. It, too, allowed me to browse the web but like NAT would NOT let me browse the 8080 port. (Yes, I had holes in the firewalls.) However, the bridge introduced significant lag in the operation of the guest OS. I also used virt-manager to set up a bridge as well, just to see if it could do something different that NM didn't do. No joy. It behaved just like the NM bridge. It worked for Internet browsing but no joy using SimpleHTTPServer.
                          "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


                            #14
                            Originally posted by wartnose View Post
                            So you already had a bridge set up rather than the default NAT? Did you set up br0 manually in interfaces or were you able to set it up through network manager?
                            I set it up manually, following the Debian wiki.

                            Comment


                              #15
                              Well, last night I fired up my WinXP host again and after a long pause during which there was a lot of Internet activity a dialog popped up proclaiming that I had installed my copy of WinXP too many times. I was left with onlly two options. Call log off and call MS. I chose a third: I deleted my guest OS, the qemu/kvm/virt and VB VM's and went back to using WINE to run the IQANDesigner, which works very well and appears as if it is a native app.

                              A side note: Even using the purge command to uninstall QEMU did not remove the menu items, the Internet interface, the systemd qemu.service, or the config and startup files in /etc/init.d and other places. I had to manually scrub them to eliminate "Failed" errors during boot.
                              "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

                              Working...
                              X