Virtual machine ongoing issues

Bringing this topic up - again - as I am still having issues (Virtualbox issues)
Have a Win10 VM, and multiple Linux distros for testing etc, and all have been on VirtualBox, Tumbleweed as the host, up until now (as per the previous post), but after having seen an article (https://tinyurl.com/2bhg8wql), thought I would give Virt-Manager/KVM a go.
So today (about 4 hours ago), ran up a new Virtual machine, using this new pairing. Came back recently, after the PC had been sitting for an hour or so, and, yes, same issue - PC was locked up, mouse moving VERY sporadically, unable to accurately click on anything…
After about 10 mins, I actually managed to kill the VM using Ctrl-Alt-esc, and most things came back, although my Vivaldi browser didn’t - had to kill/restart.
Over time, this had happened on multiple Dell PCs (several Optiplex 9020s, 7060, etc)currently on a Lenovo M920S, etc. Generally with 16GB RAM (generally only give a VM 4GB), plenty of HDD space (the virtual machines are on an SSD), and no issues running them “in general”, mostly, but not always, it is when they have sat for a while (and doing nothing…)
One gotcha I will try shortly, is to run one up from scratch, as I DID cheat with the current one - used an existing Linux Mint disk from VirtualBox. It has all the latest updates etc…
Help…??

At first, congratulations on dropping litterbox and welcome in KVM users community! :wink:

How did you setup devices (eg. sata emulation or Virtio)?
If Virtio, did you install necessary drivers?
How did you setup Windows power management? (is plenty of articles in Internet how to adjust it for virtualization)
What Windows Event Viewer shows at the time when the problem appears?

Hint: In yours previous post you mentioned allocating 1 core to VM. Try different approach and allocate 2 cores but restrict them to use, lets say, 60% of each core by using cpulimit=1.2.

Thanks for the reply.
Have to sort out the different terminology for KVM…
Disk is shown as VirtIO Disk1. How do I setup the drivers? (assuming their is a Webpage somewheres, where all this info is??)
“Windows power management”?? Not using Windows - Tumbleweed…
Have added another core, but not sure where I limit to 60%?
Thanks.

@hornetster:

Please be aware of where KVM drops the VM images by default and, the SELinux needs if your “/var” partition isn’t large enough –

 # LANG=C semanage fcontext -C -l
SELinux fcontext                                   type               Context

/home01                                            all files          system_u:object_r:home_root_t:s0 
/home01/KVM                                        all files          system_u:object_r:virt_var_lib_t:s0 

SELinux Local fcontext Equivalence 

 . 
 . 
/home01/KVM/images = /var/lib/libvirt/images
 #

An explanation is in the SELinuxsemanage-fcontext” man page:

   For home directories under top level directory, for example /disk6/home,
   execute the following commands.
   # semanage fcontext -a -t home_root_t "/disk6"
   # semanage fcontext -a -e /home /disk6/home
   # restorecon -R -v /disk6

@michu_l
Thanks for the reply.
Have to sort out the different terminology for KVM…
Disk is shown as VirtIO Disk1. How do I setup the drivers? (assuming their is a Webpage somewheres, where all this info is??)
“Windows power management”?? Not using Windows - Tumbleweed…
Have added another core, but not sure where I limit to 60%?
Thanks.

Going away for a couple of weeks - will get back to it…

This is correct - in most cases the most efficient way to go.
Did you follow any migration guide or did you just copy the images?

Please see below link to the Virtio drivers. Probably the most convenient way is to download iso and use it with any VM when required.
https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md

:rofl: Of course you don’t but you use Windows inside virtual machine. You still have to administrate this virtual computer and the best way, to check what is wrong with it, is to check it’s logs. You are going to use tools inside your’s VMs adequate to operating systems on them.
The rule of thumb for VMs is to disable it’s power management and let the host (hypervisor) to handle it all.
In addition the bare minimum for smooth communication host-guest is to install qemu guest tools (for KVM/QEMU, in case of other hypervisors it’s going to be different software tools. It’s bassicaly VirtualBox Guest Additions equivalent - You’ve used so you know).
BTW. You will find qemu guest tools on the iso above. Probably worth to mention you should install those tools on every VM guest no matter what OS is used on them. Keep that iso and check for updates regularly (I mean twice a year).

By adding to this VM settings cpulimit=1.2. Apologies, I’ve assumed there is an option in GUI. In case of GUI applications I don’t know how to setup it. I’ll check cockpit later, just because I wonder if there is an option.

Enjoy your holidays.

Another thought. Before you start messing with your existing VMs I would suggest clean install and exercise installing all the drivers and proper settings. At the same time you can test different setting and chose what works best for you. Then backup of the VM or at least snapshot and only then ‘fixing’ it (I’m suspecting lack of correct drivers and misconfiguration). It may appear to be easier just to migrate your data and soft to the new, freshly installed OS.
Good luck.

Initially, just pointed it at the current VB disk…
Have since done a “from scratch” install.

Are those drivers just for Windows? Yes, I will be using Win as a virtual machine, but so far, have only copied/run up a Mint image.

I am assuming you are meaning within the View>Details>XML section, where this, for example, info is:

</features>
  <cpu mode="host-passthrough" check="none" migratable="on"/>
  <clock offset="utc">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
  </clock>

This is where I am at the moment…

Now, DEFINITELY going on hols… :grinning:

They are for both, Windowsa and Linux. Most of the recent distros have them in their repos. Some of them can even recognize they are installed in the virtual environment and install qemu-guest-agent automatically. Unfortunately not all of them so it’s worth to make sure it’s installed.

Yes and no. :wink:
I’ve mixed-up this setting with Proxmox - it has KVM under the hood, and I assumed KVM handles this directly but it’s not a case.
But because Virtual Machine Manager has libvirt under the hood, so I’m pretty sure combination of <period> and <quota> in XML will do the trick.
There is also an option to use command cpulimit on the host but it’s not going to be permanent - unless you will run script or find other way to automate it.

https://libvirt.org/formatdomain.html#cpu-tuning
https://linuxcommandlibrary.com/man/cpulimit

:grinning:

Back from hols…
About 5,300km on the bike - think I blew the cobwebs out!
But back to the task…
Fired up my Mint yesterday, and it ran all day, without a hiccup - so impressed!
But on to the main task - rebirth the Windows Virtualbox disk I have, for QEMU, so far without joy…
Cannot get it to boot:
Initially, tried attaching as a standard VB disk (how do I do a COPY in the running console?)
and basically get

BdsDxe: No bootable option or device was found.
BdsDxe: Press any key to enter the Boot Manager Menu.

which gives:

and selecting EFI Firmware Setup, gives:

Can’t seem to get into configure anything…? There is only 1 disk, and no option to change flags/partitions whatever…
Have also created a qcow2 image from the vdi (qemu-img convert -f vdi -O qcow2 Windows10_1.vdi Windows10.qcow2), and this gives the same result. both images are about 50gb…
How to go about getting something to boot?
When I initially added the existing VB Mint disk, it just worked…
Thanks.

Might give up on Virtual Machines… :worried:
After posting the above, closed that machine, opened my NEW (ie created in QEMU, not the transferred one) Mint and started playing, within 2 minutes my host had locked up with 100% disk usage, very little movement in mouse pointer, no response from keyboard/mouse clicks… Gave it about 10 mins, only option was to do a hard reboot.
trying it again…

On reboot, so far working fine, but this is what p#sses me off! Totally unpredictable (I think…)

It does not boot because lack of the virtio-scsi driver (normally it’s installed during Windows installation, F6 and pointing to the ISO mentioned before).
To fix it, temporarily, switch disk type from virtio to sata (VM will boot and work but it’s not the most efficient way). Once it boots, install drivers from ISO. Shutdown VM, switch back to virtio, and it will boot.

Any clues in host logs/journal?

https://doc.opensuse.org/documentation/leap/virtualization/html/book-virtualization/cha-virt-logs.html

I believe it is already using sata??

Have not connected this image before, and this is the config it comes up with?
Thanks.

First problem overcome… = my stupidity!!
Have been using uefi on my machines for yonks(?), but my Win VM was originally installed in the days of Win8, and has been upgraded (reinstalled at times, but into the same machine, so always came up licenced…), and, of course, on moving this across to QEMU, it has assumed UEFI, and I haven’t even thought about it, so re-adding the disk, but setting it to BIOS, has worked… to a point.
Now I am going round in circles with the “Preparing Automatic Repair”, that obviously doesn’t want to fix it…
Have been attempting this with the VDI disk image, will try a cow conversion…
Thanks.