arindas / mac-on-linux-with-qemu

Runs macOS on linux with qemu.
MIT License
196 stars 18 forks source link

Archlinux After qemu and kernel upgrade I lost virtio-vga support #24

Closed tombombadilom closed 3 years ago

tombombadilom commented 3 years ago

After qemu and kernel upgrade I lost the virtio-vga support

too bad everything was going perfectly fine with mac os x

[tom@tomPC mac-on-linux-with-qemu]$ ./launch-macos.sh
qemu-system-x86_64: -drive if=pflash,format=raw,readonly,file=packaged-firmware/OVMF_CODE.fd: warning: short-form boolean option 'readonly' deprecated
Please use readonly=on instead
qemu-system-x86_64: -device virtio-vga,virgl=on: Property 'virtio-vga.virgl' not found

dmesg | grep drm did not return pci:virtio-vga and in kernel virtio drivers it cannot be found either.

[tom@tomPC /lib/modules/5.13.13-arch1-1/kernel/drivers/virtio$ ls
virtio_balloon.ko.zst  virtio_input.ko.zst  virtio_mmio.ko.zst  virtio_pci_modern_dev.ko.zst
virtio_dma_buf.ko.zst  virtio_mem.ko.zst    virtio_pci.ko.zst   virtio_vdpa.ko.zst

normaly there should be no problem has I have this enabled

[root@tomPC tom]# zgrep VIRTIO /proc/config.gz
CONFIG_BLK_MQ_VIRTIO=y
CONFIG_VIRTIO_VSOCKETS=m
CONFIG_VIRTIO_VSOCKETS_COMMON=m
CONFIG_BT_VIRTIO=m
CONFIG_NET_9P_VIRTIO=m
CONFIG_VIRTIO_BLK=m
CONFIG_SCSI_VIRTIO=m
CONFIG_VIRTIO_NET=m
CONFIG_VIRTIO_CONSOLE=m
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_DRM_VIRTIO_GPU=m
CONFIG_SND_VIRTIO=m
CONFIG_VIRTIO=y
CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS=y
CONFIG_VIRTIO_PCI_LIB=m
CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_VDPA=m
CONFIG_VIRTIO_PMEM=m
CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_MEM=m
CONFIG_VIRTIO_INPUT=m
CONFIG_VIRTIO_MMIO=m
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
CONFIG_VIRTIO_DMA_SHARED_BUFFER=m
CONFIG_RPMSG_VIRTIO=m
CONFIG_VIRTIO_FS=m
CONFIG_CRYPTO_DEV_VIRTIO=m

here are my libs versions

[tom@tomPC mac-on-linux-with-qemu]$ pacman -Qs '^(linux|mesa|qemu|virglrenderer|libepoxy)$'
local/libepoxy 1.5.9-1
    Library handling OpenGL function pointer management
local/linux 5.13.13.arch1-1
    The Linux kernel and modules
local/mesa 21.2.1-1
    An open-source implementation of the OpenGL specification
local/qemu 6.1.0-1
    A generic and open source machine emulator and virtualizer
local/virglrenderer 0.9.1-1
    A virtual 3D GPU library, that allows the guest operating system to use the host GPU to accelerate 3D rendering

I wonder if there is something that i am missing ? if I have to downgrade version for qemu and/or kernel. Or compile a modified kernel .

tombombadilom commented 3 years ago

virtio modules where not loaded at start by the kernel I had to had a file for each module in /etc/modules-load.d/

[root@tomPC tom]# cat /etc/modules-load.d/*
kvm_amd
virtio
 virtio_gpu
virtio_net
virtio_pci

now I have those modules loaded

[root@tomPC tom]# lsmod | grep virtio
virtio_pci             24576  0
virtio_pci_modern_dev    16384  1 virtio_pci
virtio_net             61440  0
net_failover           24576  1 virtio_net
virtio_gpu             73728  0
virtio_dma_buf         16384  1 virtio_gpu
drm_kms_helper        294912  2 amdgpu,virtio_gpu
drm                   585728  12 gpu_sched,drm_kms_helper,amdgpu,virtio_gpu,drm_ttm_helper,ttm

But the problem remains: the module virtio-vga is not provided by my kernel :(

[tom@tomPC mac-on-linux-with-qemu]$ sudo modprobe virtio_vga
modprobe: FATAL: Module virtio_vga not found in directory /lib/modules/5.13.13-arch1-1
and i cannot start the vm through the GPU
qemu-system-x86_64: -device virtio-vga,virgl=on: Property 'virtio-vga.virgl' not found
tombombadilom commented 3 years ago

I have downgraded to linux-lts 5.10.61 but still no virtio-vga . this doesn't seem to be a kernel module ...

tombombadilom commented 3 years ago

so after downgrading linux , I finally downgraded qemu from version 6.1.0-1 to version 6.0.0-1 and it finaly fixed the problem. To resume qemu wasn't compilated with virtio-vga support in the last version. I hope it can help others to get things working.

arindas commented 3 years ago

Thank you for the update @tombombadilom

finn-liebner commented 2 years ago

There is no downgrade required, I also tried it on Arch Linux. With the latest version of qemu (6.1.0-5) virtio-vga works, but the command line parameters are different. The following change is necessary (I found this on Reddit):

virtio-vga,virgl=on
  virtio-vga-gl

There is also a notice that another parameter is deprecated, so I would propose the following change:

readonly
  readonly=on
tombombadilom commented 2 years ago

merged https://github.com/arindas/mac-on-linux-with-qemu/commit/2bf228469612ef517dfe3c1c177faef6e19dfc67