Can't install and run systems on VM's

Hi, fellows,

I'm transitioning from Windows to Linux, and right now, I'm using both. Zorin OS is my first choice, and this is my first post in this community.

Let me briefly introduce my system:

  • Lenovo E531 laptop, dual-boot set up (Windows 10 / Zorin OS Core 17.1)
  • 4 GB RAM
  • 200 GB SSD
  • Secure Boot and Fast Startup options are off

The installation was quite smooth. I solved a few problems by myself (despite being a total newbie in Linux) by reading posts in this forum. My experience with Zorin OS has been very positive; almost all routine tasks can be done smoothly and without significant stress. So, at this point, everything is OK.

But I'm curious about learning more, and that's where I need your help (I can't find solutions in the forum).

My first question (there will be a couple more later) is about virtual machines that are not working.

I've experimented with VirtualBox (installed from the official Oracle site; already removed from my system), Gnome Boxes, and Virt-Manager (both installed from the Zorin OS repository). I tried to install Zorin OS Core 17.1 and Linux Mint Cinnamon on VMs. Later, I chose to play with Linux Lite 7.0 as one of the most lightweight systems to not overload my hardware. However, with all the VMs, regardless of which OS I was installing (.iso files were downloaded from official sites, and checksums were OK), the result was always the same: the installation starts, but shortly after, the guest system slows down and hangs. The host system also hangs, and everything stays frozen for a few minutes. Then, the guest system switches off (crashes?), and the host system returns to a working state. In the VM GUI, it appears that the virtual machine was created, but when I try to start it, I get a message saying there is no bootable media or something similar.

It doesn't seem to be an issue with the VM software, as the same scenario occurred with all three applications I tried. For Linux Lite on Virt-Manager, I allocated 2 to 2.5 GB of RAM, 2 of 4 cores, and 25 GB of storage. In my opinion, that should be enough, but the VM still fails.

Let's focus on Virt-Manager since I prefer to use it. I apologize if my replies to your posts are delayed by a day or two. I will read everything and try any suggestions you offer, and I will let you know about the results.

Sorry for the long post, but in my next message, I will add more technical information about my interactions with the terminal and what I've done and checked.

Thank you!

Screenshot from 2024-06-23 19-38-41

gintautas@Gintautas-ThinkPad-Edge-E531:~$ egrep -c '(vmx|svm)' /proc/cpuinfo
8

gintautas@Gintautas-ThinkPad-Edge-E531:~$ lsmod | grep kvm
kvm_intel 487424 0
kvm 1409024 1 kvm_intel
irqbypass 12288 1 kvm

gintautas@Gintautas-ThinkPad-Edge-E531:~$ egrep -o 'vmx|svm' /proc/cpuinfo
vmx
vmx
vmx
vmx
vmx
vmx
vmx
vmx

gintautas@Gintautas-ThinkPad-Edge-E531:~$ free -h
total used free shared buff/cache available
Mem: 3,6Gi 1,6Gi 349Mi 424Mi 1,7Gi 1,4Gi
Swap: 0B 0B 0B

gintautas@Gintautas-ThinkPad-Edge-E531:~$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 373M 12M 362M 4% /run
/dev/sda4 164G 35G 122G 22% /
tmpfs 1,9G 0 1,9G 0% /dev/shm
tmpfs 5,0M 0 5,0M 0% /run/lock
efivarfs 64K 24K 35K 41% /sys/firmware/efi/efivars
tmpfs 1,9G 0 1,9G 0% /run/qemu
/dev/sda1 545M 32M 514M 6% /boot/efi
tmpfs 373M 2,1M 371M 1% /run/user/1000
/dev/sdb1 932G 749G 183G 81% /media/gintautas/Isorinis_HD
/dev/sda3 156G 67G 89G 43% /media/gintautas/D6FC606BFC604837
/dev/sda2 142G 123G 20G 87% /media/gintautas/CC96F0ED96F0D8C2

gintautas@Gintautas-ThinkPad-Edge-E531:~$ sudo systemctl status libvirtd
● libvirtd.service - Virtualization daemon
Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2024-06-23 19:23:13 EEST; 49min ago
TriggeredBy: ● libvirtd-admin.socket
● libvirtd-ro.socket
● libvirtd.socket
Docs: man:libvirtd(8)
https://libvirt.org
Main PID: 1362 (libvirtd)
Tasks: 21 (limit: 32768)
Memory: 15.7M
CPU: 762ms
CGroup: /system.slice/libvirtd.service
├─1362 /usr/sbin/libvirtd
├─1527 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=>
└─1528 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=>

birž. 23 19:23:14 Gintautas-ThinkPad-Edge-E531 dnsmasq-dhcp[1527]: DHCP, sockets bound exclusively to interface virbr0
birž. 23 19:23:14 Gintautas-ThinkPad-Edge-E531 dnsmasq[1527]: reading /etc/resolv.conf
birž. 23 19:23:14 Gintautas-ThinkPad-Edge-E531 dnsmasq[1527]: using nameserver 127.0.0.53#53
birž. 23 19:23:14 Gintautas-ThinkPad-Edge-E531 dnsmasq[1527]: read /etc/hosts - 8 names
birž. 23 19:23:14 Gintautas-ThinkPad-Edge-E531 dnsmasq[1527]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 nam>
birž. 23 19:23:14 Gintautas-ThinkPad-Edge-E531 dnsmasq-dhcp[1527]: read /var/lib/libvirt/dnsmasq/default.hostsfile
birž. 23 19:23:16 Gintautas-ThinkPad-Edge-E531 dnsmasq[1527]: reading /etc/resolv.conf
birž. 23 19:23:16 Gintautas-ThinkPad-Edge-E531 dnsmasq[1527]: using nameserver 127.0.0.53#53
birž. 23 19:23:16 Gintautas-ThinkPad-Edge-E531 dnsmasq[1527]: reading /etc/resolv.conf

gintautas@Gintautas-ThinkPad-Edge-E531:~$ groups $(whoami)
gintautas : gintautas adm cdrom sudo dip plugdev lpadmin sambashare libvirt

gintautas@Gintautas-ThinkPad-Edge-E531:~$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

gintautas@Gintautas-ThinkPad-Edge-E531:~$ groups $(whoami)
gintautas : gintautas adm cdrom sudo dip plugdev kvm lpadmin sambashare libvirt

Hi, and welcome!

My first thought is this is definitely due to lack of resources, RAM in particular.

This is pretty much what would happen when the system runs out of memory: hang, and then the Linux kernel starts shutting off processes in order to be able to continue to function. At one point, the virtual machine gets destroyed freeing the resources that are needed to restore the system to a working state.

I don't disagree, but consider that the base OS needs resources for itself as well, including the network stack that is handled outside of the VM, as does the virtualization layer itself. You're probably running a little too close to the edge.

Something that will help with this is enabling ZRAM. This compresses the RAM used by the system so that the same amount of memory is used more effectively, at the cost of increased processing. But probably well worth it in this case.

Not a problem at all. For future reference, try to edit the post instead of making multiple new ones, just to stay more organized and make searching easier. And as an aside, when pasting output from the terminal it's preferable to wrap it in triple backticks (`) to format the text a little nicer, for example:

gintautas@Gintautas-ThinkPad-Edge-E531:~$ lsmod | grep kvm
kvm_intel 487424 0
kvm 1409024 1 kvm_intel
irqbypass 12288 1 kvm

Don't worry about it now, it's not a big deal, just something to consider for next time.

2 Likes

Thant You. It works.
Problem really was about RAM and installation of ZRAM helped.

1 Like