This seems to be universal problem. During the use of the virtual machine (I use qemu), it periodically freezes. The problem is not observed with ssh, so obviously, the problem is not in the virtual machine itself, but as suggested in the video acceleration or something.
The suggestion was to do
$vblank_mode=0 /usr/bin/virt-manager
I tried it, it still freezes.
Second attempt is the solution given
here.
IT tells you to do (rc.local should have $chmod a+rx rx.local):
sudo nano /etc/rc.local
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
exit 0
The problem is that my system is using systemd so the rc.local is not even being read.
So to enable it I've found
this:
Create a file
/etc/systemd/system/rc-local.service with the following contents:
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
Then, just run
systemctl enable rc-local.service as root to enable it.
You can also test it/run it now by running
systemctl start rc-local.service
I still don't know if it works, because I have to test the virtual machine and systemctl enable gives an error: "sudo systemctl enable rc-local.service
The unit files have no [Install] section. They are not meant to be enabled
using systemctl."
Ok, after revising rc-local.service to contain the [Install] section, everything works like a charm.
And guess what, my virtual machine is finally not freezing. I've been using it for hours now and it seems to work flawlessly. Yay!