Console login service(s) cannot run while tryng to emulate Solaris 11.4

Hello.

I'm trying to boot Solaris 11.04 using qemu + UEFI on FreeBSD 14.1,using the following parameters :

qemu-system-x86_64 -name guest=s11x64,debug-threads=on \
-machine pc,usb=off \
-cpu kvm64,hv_relaxed,hv_time,hv_synic \
-m 8G -smp 2,sockets=2,cores=1,threads=1 -nodefaults -no-shutdown \
-drive file=/bhyve/Files/ISO/sol-11_4-text-x86.iso,format=raw \
-drive file=/mnt/zroot2/zroot2/bhyve/img/Solaris/solaris114.img,format=raw \
-global PIIX4_PM.disable_s3=1 \
-global PIIX4_PM.disable_s4=1 \
-device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x4.0x7 \
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x4 \
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x4.0x1 \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x4.0x2 \
-device VGA,id=video0,vgamem_mb=32,bus=pci.0,addr=0x2 \
-netdev tap,id=mynet0,ifname=tap4,script=no,downscript=no \
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01 \
-device ich9-ahci,id=sata \
-drive if=pflash,format=raw,readonly=on,file=/usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd \

as you can see below,it almost worked,but not yet. I think only a few parametes are missing :

While,it fully worked using bios instead of uefi:

/usr/local/bin/qemu-system-x86_64 \
-L /usr/local/share/qemu/ -name guest=s11x64,debug-threads=on \
-machine pc,usb=off -cpu kvm64,hv_relaxed,hv_time,hv_synic \
-m 8192 -smp 2,sockets=2,cores=1,threads=1 \
-nodefaults -global kvm-pit.lost_tick_policy=delay -no-shutdown \
-global PIIX4_PM.disable_s3=1 \
-global PIIX4_PM.disable_s4=1 -boot strict=on \
-device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x4.0x7 \
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x4 \
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x4.0x1 \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x4.0x2 \
-device VGA,id=video0,vgamem_mb=32,bus=pci.0,addr=0x2 \
-hda /mnt/zroot2/zroot2/bhyve/img/Solaris/solaris114.img \
-boot d --cdrom /bhyve/Files/ISO/sol-11_4-text-x86.iso \
-netdev tap,id=mynet0,ifname=tap3,script=no,downscript=no \
-device e1000,netdev=mynet0,mac=52:55:00:d1:55:01 \

Can someone help ? thanks.

I think your main problem is the "Unable to mount media".
Perhaps it wants to see a USB device or a CD-ROM.
Something like in your working sample: -boot d --cdrom /bhyve/Files/ISO/sol-11_4-text-x86.iso

-boot d --cdrom /bhyve/Files/ISO/sol-11_4-text-x86.iso IS not compatible with : -drive if=pflash,format=raw,readonly=on,file=/usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd \

Now there is a syntax error.
Unfortunately I am not familiar with the syntax.
I just wanted to say that you somehow must tell it to mount a cdrom or usb.

I guess that you've already read this:

https://www.itayemi.com/blog/2023/01/01/solaris-10-x86-vm-running-on-qemu-hypervisor-on-an-ubuntu-host/

It does mention Solaris 11.

yeah,but it boots Solaris using the BIOS. I'm trying to use EFI. So,it's not useful.

Does this work for you for booting Solaris 11.4 with UEFI ?

qemu-system-x86_64 -name guest=s11x64,debug-threads=on \
  -machine pc,usb=off \
  -cpu kvm64,hv_relaxed,hv_time,hv_synic \
  -m 8G -smp 2,sockets=2,cores=1,threads=1 \
  -nodefaults -no-shutdown \
  -drive if=pflash,format=raw,readonly=on,file=/usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd \
  -drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/QEMU_UEFI_VARS-x86_64.fd \
  -drive file=/bhyve/Files/ISO/sol-11_4-text-x86.iso,media=cdrom,if=ide \
  -drive file=/mnt/zroot2/zroot2/bhyve/img/Solaris/solaris114.img,format=raw,if=virtio \
  -global PIIX4_PM.disable_s3=1 \
  -global PIIX4_PM.disable_s4=1 \
  -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x4.0x7 \
  -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x4 \
  -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x4.0x1 \
  -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x4.0x2 \
  -device VGA,id=video0,vgamem_mb=32,bus=pci.0,addr=0x2 \
  -netdev tap,id=mynet0,ifname=tap4,script=no,downscript=no \
  -device e1000,netdev=mynet0,mac=52:55:00:d1:55:01 \
  -device ich9-ahci,id=sata

Hello. It worked. Very thanks. You helped me a lot to understand what could be wrong between the bhyve parameters because Solaris won't boot from the iso image.

My real goal is to be able to boot and install Solaris 11.4 using bhyve because in FreeBSD we don't have KVM. Bhyve is an accelerated hypervisor,QEMU without KVM is not.

For some technical and unknown reason to me,bhyve is not able to detect and use the cd rom. I've used qemu as a means of comparison to understand the reason.

Well,the following are the correct parameters used by qemu to be able to boot from the iso image and to start the installation :

qemu-system-x86_64 -name guest=s11x64,debug-threads=on \
  -machine pc,usb=off \
  -cpu kvm64,hv_relaxed,hv_time,hv_synic \
  -m 8G -smp 2,sockets=2,cores=1,threads=1 \
  -nodefaults -no-shutdown \
  -drive if=pflash,format=raw,readonly=on,file=/usr/local/share/edk2-qemu/QEMU_UEFI_CODE-x86_64.fd \
  -drive if=pflash,format=raw,file=/usr/local/share/edk2-qemu/QEMU_UEFI_VARS-x86_64.fd \
  -drive file=/mnt/zroot2/zroot2/OS/ISO/Unix/Solaris/sol-11_4-text-x86.iso,media=cdrom,if=ide \
  -drive file=/mnt/zroot2/zroot2/bhyve/img/Solaris/solaris114-empty.img,format=raw,if=virtio \
  -global PIIX4_PM.disable_s3=1 \
  -global PIIX4_PM.disable_s4=1 \
  -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x4.0x7 \
  -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x4 \
  -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x4.0x1 \
  -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x4.0x2 \
  -device VGA,id=video0,vgamem_mb=32,bus=pci.0,addr=0x2 \
  -netdev tap,id=mynet0,ifname=tap4,script=no,downscript=no \
  -device e1000,netdev=mynet0,mac=52:55:00:d1:55:01 \
  -device ich9-ahci,id=sata

Instead,these are the parameters that I used in bhyve :

/usr/sbin/./bhyve-win -S -c sockets=2,cores=2,threads=2 -m 8G -w -H -A \
-s 0,hostbridge \
-s 1,ahci-cd,/mnt/zroot2/zroot2/OS/ISO/Unix/Solaris/sol-11_4-text-x86.iso,bootindex=1 \
-s 2,virtio-blk,/mnt/zroot2/zroot2/bhyve/img/Solaris/solaris114-empty.img \
-s 29,fbuf,tcp=0.0.0.0:5915,w=1600,h=950,wait \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:15 < /dev/null & sleep 2 && vncviewer 0:15 &

and this is what happens when I try to boot it using bhyve :

it hangs there forever. My conclusion. This is the key :

-drive file=/mnt/zroot2/zroot2/OS/ISO/Unix/Solaris/sol-11_4-text-x86.iso,media=cdrom,if=ide \

Solaris needs that the cdrom is detected as ide. Now,I'm almost sure that the parameter ahci-cd used by bhyve :

-s 1,ahci-cd,/mnt/zroot2/zroot2/OS/ISO/Unix/Solaris/sol-11_4-text-x86.iso,bootindex=1 \

is not compatible with IDE. How to fix it ? I'm not sure. But I see that Oracle offers another kind of installer,called "sol-11_4-text-x86.usb". Maybe I can boot Solaris using this file.

Tried this :


-s 1,ahci-hd,/mnt/zroot2/zroot2/OS/ISO/Unix/Solaris/sol-11_4-text-x86.usb,bootindex=1 \

didn't work. It hangs like before.

This version worked...(Solaris 11.4 does not support : -s 0,hostbridge)

/usr/sbin/./bhyve-win -S -c sockets=2,cores=2,threads=2 -m 8G -w -H -A \
-s 1,ahci-cd,/mnt/zroot2/zroot2/OS/ISO/Unix/Solaris/sol-11_4-text-x86.iso,bootindex=1 \
-s 2,virtio-blk,/mnt/zroot2/zroot2/bhyve/img/Solaris/solaris114-empty.img \
-s 29,fbuf,tcp=0.0.0.0:5915,w=1600,h=950,wait \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd,/usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd \
vm0:15 < /dev/null & sleep 2 && vncviewer 0:15 &

Well done @marietto !