Installing on KVM QEMU vs Virtualbox

270 views
Skip to first unread message

Mahendra Priolkar

unread,
Feb 15, 2023, 1:23:58 PM2/15/23
to minix3
Hello. When I try to install Minix 3 ver 4.0rc6 on KVM/QEMU the system runs properly but randomly stops responding, screen freezes (sometimes at the setup script, sometimes when files are being installed) and I cannot even access the other ttys. I'm using QEMU emulator ver 7.0.0 . However it works perfectly fine in Virtualbox 7.0.6. Why is that so?

Peter Shkenev

unread,
Feb 16, 2023, 3:03:00 AM2/16/23
to min...@googlegroups.com
Hello,

What is your Qemu configuration? Which distribution do you use for Qemu?

---
Best regards,
Peter

Mahendra Priolkar

unread,
Feb 17, 2023, 9:16:12 AM2/17/23
to minix3
Thankyou for replying!! Sorry for not being "verbose". I'm currently using Fedora 37 x86_64 Workstation Edition (Linux kernel 6.1.11-200.fc37.x86_64) as my Host OS, from whose official repos KVM/QEMU has been installed.
My QEMU config for Minix:-

<domain type="kvm">
  <name>Minix</name>
  <uuid>b011408a-ce25-42eb-a68e-bcfb08497340</uuid>
  <memory unit="KiB">2097152</memory>
  <currentMemory unit="KiB">2097152</currentMemory>
  <vcpu placement="static">2</vcpu>
  <os>
    <type arch="i686" machine="pc-i440fx-7.0">hvm</type>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state="off"/>
  </features>
  <cpu mode="custom" match="exact" check="partial">
    <model fallback="allow">kvm32</model>
    <feature policy="require" name="ibpb"/>
    <feature policy="require" name="spec-ctrl"/>
    <feature policy="require" name="ssbd"/>
    <feature policy="require" name="virt-ssbd"/>
  </cpu>
  <clock offset="utc">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-i386</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2" discard="unmap"/>
      <source file="/var/lib/libvirt/images/vm1.qcow2"/>
      <target dev="hda" bus="ide"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>
    <controller type="usb" index="0" model="ich9-ehci1">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x7"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci1">
      <master startport="0"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0" multifunction="on"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci2">
      <master startport="2"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x1"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci3">
      <master startport="4"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x2"/>
    </controller>
    <controller type="pci" index="0" model="pci-root"/>
    <controller type="ide" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/>
    </controller>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x0"/>
    </controller>
    <interface type="network">
      <mac address="52:54:00:80:cb:dc"/>
      <source network="default"/>
      <model type="e1000"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/>
    </interface>
    <serial type="pty">
      <target type="isa-serial" port="0">
        <model name="isa-serial"/>
      </target>
    </serial>
    <console type="pty">
      <target type="serial" port="0"/>
    </console>
    <channel type="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
      <address type="virtio-serial" controller="0" bus="0" port="1"/>
    </channel>
    <input type="tablet" bus="usb">
      <address type="usb" bus="0" port="1"/>
    </input>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <graphics type="spice" autoport="yes">
      <listen type="address"/>
      <image compression="off"/>
    </graphics>
    <sound model="ich6">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
    </sound>
    <audio id="1" type="spice"/>
    <video>
      <model type="qxl" ram="65536" vram="65536" vgamem="16384" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
    </video>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="2"/>
    </redirdev>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="3"/>
    </redirdev>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x0"/>
    </memballoon>
  </devices>
</domain>

Peter Shkenev

unread,
Feb 18, 2023, 9:21:04 AM2/18/23
to min...@googlegroups.com
Hello,

First of all: you use Qemu through libvirt, not the plain Qemu. I use it
too, but I am on Ubuntu 22.04 which has older versions.

Minix currently supports only one core, so you can set CPU amount to
one.

I see you are using QXL graphics. Try to switch to VGA to see if this
would work. (QXL capabilities are not used anyway as far as I know).

Also you have serial device connected. Can you check whether there
anything happens on it?

---
Best regards,
Peter

Mahendra Priolkar

unread,
Feb 19, 2023, 1:47:49 PM2/19/23
to minix3
Hello!! I implemented everything you said and unfortunately the same problem persists...The serial console wasn't any help at all either...

Peter Shkenev

unread,
Feb 19, 2023, 3:14:11 PM2/19/23
to Mahendra Priolkar, minix3
Hello,

Try to enable gdb server on this virtual machine (google how to do this in case of libvirt) and attach gdb to your virtual machine. Maybe it will say something useful in case of this event.

---
Best regards,
Peter

Пётр Шкенев

unread,
May 31, 2023, 2:12:36 PM5/31/23
to Peter Shkenev, Mahendra Priolkar, minix3
Hello,

I tested Minix on Qemu 7.2.1 some time ago and got freezes too. As a
workaround, injecting NMIs using Qemu monitor unfreezes Minix.

I will try to track down the issue once I have more free time.

---
Best regards,
Peter

Murray Smith

unread,
May 31, 2023, 2:51:57 PM5/31/23
to min...@googlegroups.com
Which version  and build of minix?

--
You received this message because you are subscribed to the Google Groups "minix3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minix3+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minix3/CT0O01D5J8GQ.3PJ0K9806J4UF%40flyaptyap.

Peter Shkenev

unread,
May 31, 2023, 2:57:56 PM5/31/23
to min...@googlegroups.com
Hello Murray,

As OP stated, 3.4.0RC6.

---
Best regards,
Peter

Murray

unread,
May 31, 2023, 3:38:05 PM5/31/23
to minix3
do you know which QEMU build it was? RC0 - RC4?

Пётр Шкенев

unread,
Jun 1, 2023, 3:03:20 PM6/1/23
to min...@googlegroups.com
I do not know which Qemu build author used, but I use 7.2.1. Therefore I
wanted to clarify if OP and I experience the same issue.

---
Best regards,
Peter

Murray Smith

unread,
Jun 1, 2023, 5:40:57 PM6/1/23
to min...@googlegroups.com
From the look of it, minix is getting "stuck" in the idle function in proc.c (line's 210 or 213).
It is waiting for an NMI or INT at this point.

During the installation minix hung twice, both times during prolonged disc access

After the install I can see that the kernel is going into and out of the idle state at the command prompt.
but anything with a great deal of disc usage, interrupts are being "missed"

tested using #pkgin in git and #pkgin_sets and installing the sources were ok however compiling minix source tree
minix hung again, there might be a time component involved.


There could be an underlying qemu and linux kernel issue here.

Or could it be linked to the profiling part of minix, proc.h line 210 and 213
where halt_cpu could be called twice (timer interrupt should bring cpu out of halted state).

Does this happen on the recent version of qemu?


--
You received this message because you are subscribed to the Google Groups "minix3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minix3+un...@googlegroups.com.

Peter Shkenev

unread,
Jun 1, 2023, 6:36:44 PM6/1/23
to min...@googlegroups.com
Thank you for the information!

I do not have QEMU 8.0.2 nearby, so I cannot test it right now.

Also, I am bisecting Minix tree to find offending commit.

---
Best regards,
Peter

Murray

unread,
Jun 2, 2023, 5:09:21 PM6/2/23
to minix3
What command line arguments are you using for qemu?

This is what I have come up with so far.

kvm -s -m 512 -drive file=minix_R3.4.0rc6-d5e4fc0.iso,media=cdrom,if=ide  -drive file=minix3.img,format=raw,if=ide -boot c -no-hpet

which is a bit different from the website guide

two things to note are the use of a simulated IDE drive (if=ide) and disabling the high Precision Event Timer with -no-hpet

Murray

Peter Shkenev

unread,
Jun 8, 2023, 8:15:47 AM6/8/23
to min...@googlegroups.com
Hello,

My command line is

qemu-system-x86_64 -enable-kvm -net user -net nic -m 1G \
-drive file=minix3.qcow2,if=ide -drive file=disk2.qcow2

Also I used to run Minix with libvirt, which gave me freezes too.

Issue seems to show up more frequently if qemu is launched with -machine
pc command line option.

---
Best regards,
Peter

Murray

unread,
Jun 11, 2023, 6:09:28 AM6/11/23
to minix3
Hi Peter,

 Have you tried with  -no-hpet on the qemu command line, seems to have solved my issue.

 As for  libvirt I have noticed that it is on by default with no way to change it.
 I have had freeze's at the install stage but after that it has been working fine.

 I have to hold off on testing qemu and libvirt on my ubuntu machine for a bit until I  "Un-Brick" my ubuntu 20.04 setup, you remove one package and it removes the desktop! 
 Now I am stuck with a console and broken packages!

Peter Shkenev

unread,
Jun 12, 2023, 1:12:56 PM6/12/23
to min...@googlegroups.com
Hello,

On Sun Jun 11, 2023 at 1:09 PM MSK, Murray wrote:
> Hi Peter,
>
> Have you tried with -no-hpet on the qemu command line, seems to have
> solved my issue.

I managed to reproduce it with -no-hpet option.

> As for libvirt I have noticed that it is on by default with no way to
> change it.
> I have had freeze's at the install stage but after that it has been
> working fine.

Libvirt allows adding qemu options directly. I don't remember the
correct way, so look it up on the internet if you wish.

> I have to hold off on testing qemu and libvirt on my ubuntu machine for a
> bit until I "Un-Brick" my ubuntu 20.04 setup, you remove one package and
> it removes the desktop!
> Now I am stuck with a console and broken packages!

Ubuntu 20.04 has QEMU 6.x in which Minix works fine.

>
> On Friday, 9 June 2023 at 00:15:47 UTC+12 Peter Shkenev wrote:
>
> > Hello,
> >
> > My command line is
> >
> > qemu-system-x86_64 -enable-kvm -net user -net nic -m 1G \
> > -drive file=minix3.qcow2,if=ide -drive file=disk2.qcow2
> >
> > Also I used to run Minix with libvirt, which gave me freezes too.
> >
> > Issue seems to show up more frequently if qemu is launched with -machine
> > pc command line option.
> >
> > ---
> > Best regards,
> > Peter
> >
>
> --
> You received this message because you are subscribed to the Google Groups "minix3" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to minix3+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/minix3/d85850cb-b61e-4ff7-9076-68e1c9363de3n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages