Closed 512yottabytes closed 1 year ago
You're currently trying to detach integrated GPU. You need to use pci_0000_03_00_0 and pci_0000_03_00_1 instead.
Thank you.
Now I can see SystemD init process on external display, but only if I add QXL or VGA. When boot process is over and LightDM of the VM started -- external display shows No Signal
.
Without QXL or VGA I see only No Signal
and nothing else.
I've tryed to get ROM, but got I/O error:
echo 1 > /sys/bus/pci/devices/0000:03:00.0/rom
cat /sys/bus/pci/devices/0000:03:00.0/rom > vbios.rom
Input-output error
Please provide the log file at: /var/log/libvirt/qemu/your_vm_name.log
log.log Here it is.
On your CPU section, use -cpu host and remove the explicitly mentioned features. I'm not sure if those are the requirements to get macos running under KVM, so I don't know if that'll work. Did it work without passthrough?
Both with macOS an Ubuntu it works without passthrough.
Changed to host
and it worked with Linux, but it seems something is wrong with my GPU.
I think it wouldn't be possible to run macOS with cpu=host
...
Tryed Linux with:
<qemu:arg value="-cpu"/>
<qemu:arg value="Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"/>
also worked fine, except the picture on the external display broken as on the photo above.
But I have the same broken picture I have on my host OS, when I switch to 2 displays (I think laptop switches from integrated GPU to discrete one, when I attach 2nd display to the host OS. Am I right?)
MacOS shows nothing on external display, while seems to boot properly (I see it on serial Qemu console). I'll try to boot Windows this way. It's interesting, will broken picture appear in it too?
The display issue happens right after connecting external monitor or during passthrough only? I use single monitor on my PC so I don't really have any idea on what might be happening..
Passthrough doesn't work on my system for now.. I'll check if I can get macOS running with passthrough later..
The display issue happens right after connecting external monitor, and it doesn't matter if I do passthrough, or if I attach 2nd display to my laptop, as usual 2nd display. The only difference, that if I attach 2nd display to my host OS, the picture on laptop's display becomes broken, but on the external display the picture is fine.
Also tryed with Windows 10 Installer (iso) -- got nothing on the external display. Maybe it would work with preinstalled Windows, with preinstalled Radeon GPU driver...
Also I'll try to boot Ubuntu with vesa nomodeset
, and maybe the picture will be fine, this time.
UPD: with vesa nomodeset
or just with nomodeset
nothing works. No Signal
.
It's working on my system with passthrough. My mouse didn't work under macOS and keyboard stopped working on language selection screen so I wasn't able to install it.. Here's my script:
OSK="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
OVMF=$PWD/firmware
ROMFILE="GP106.rom"
DISK="/home/qaidvoid/vm/macos.img"
USER="qaidvoid"
qemu-system-x86_64 \
-runas $USER \
-nodefaults \
-enable-kvm \
-machine q35,accel=kvm \
-cpu Penryn,vendor=GenuineIntel,kvm=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,+invtsc \
-m 4G \
-smp 4,cores=2 \
-device isa-applesmc,osk="$OSK" \
-smbios type=2 \
-drive if=pflash,format=raw,readonly=on,file="$OVMF/OVMF_CODE.fd" \
-drive if=pflash,format=raw,file="$OVMF/OVMF_VARS-1024x768.fd" \
-device usb-ehci,id=ehci \
-device ich9-ahci,id=sata \
-device ide-hd,bus=sata.2,drive=ESP \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-device ide-hd,bus=sata.4,drive=MacOS \
-drive id=ESP,if=none,format=qcow2,file=ESP.qcow2 \
-drive id=InstallMedia,format=raw,if=none,file=BaseSystem.img \
-drive id=MacOS,if=none,file=$DISK,format=raw \
-serial none \
-net nic \
-net user \
-vga none \
-nographic \
-device vfio-pci,host=01:00.0,x-vga=on,multifunction=on,romfile=$ROMFILE \
-device vfio-pci,host=01:00.1 \
-object input-linux,id=mouse1,evdev=/dev/input/by-id/usb-PixArt_HP_USB_Optical_Mouse-event-mouse \
-object input-linux,id=kbd1,evdev=/dev/input/by-id/usb-Chicony_USB_Keyboard-event-kbd,grab_all=on,repeat=on \
-device virtio-keyboard \
-device virtio-mouse
Great! Maybe I need to dump ROM? But, unfortunately, I can't:
echo 1 > /sys/bus/pci/devices/0000:03:00.0/rom
cat /sys/bus/pci/devices/0000:03:00.0/rom > vbios.rom
Input-output error
Is there any other way to get ROM, or have I done something wrong?
UPD: It was simple:
echo 1 > /sys/bus/pci/devices/0000\:03\:00.0/rom
cat /sys/bus/pci/devices/0000\:03\:00.0/rom > vbios.rom
Input-output error
It worked this way.
In my case MacOS didn't work. Maybe, because my ROM isn't PCIR: type 3 (EFI)
...
Also Qemu reported, that x-vga=on
isn't supported.
I've enabled serial, to see at least something... I don't think serail will break all, won't it?
Tried to boot Windows with:
qemu-system-x86_64 \
-enable-kvm \
-m 4G \
-machine q35,accel=kvm \
-smp 4,cores=2 \
-cpu Penryn,vendor=GenuineIntel,kvm=on,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc \
-smbios type=2 \
-netdev user,id=net0 \
-device e1000-82545em,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-device ich9-ahci,id=sata \
-drive id=ESP,if=none,format=qcow2,file=/var/lib/libvirt/images/win10-2-clone.qcow2 \
-device ide-hd,bus=sata.2,drive=ESP \
-vga none \
-device pcie-root-port,bus=pcie.0,multifunction=on,port=1,chassis=1,id=port.1 \
-device vfio-pci,host=03:00.0,bus=port.1,multifunction=on \
-device vfio-pci,host=03:00.1,bus=port.1 \
-object input-linux,id=mouse1,evdev=/dev/input/by-id/usb-YSPRINGTECH_USB_OPTICAL_MOUSE-event-mouse \
-object input-linux,id=kbd1,evdev=/dev/input/by-id/usb-BTC_USB_Keyboard-event-kbd,grab_all=on,repeat=on \
-device virtio-keyboard \
-device virtio-mouse
and failed. `No Signal`. Maybe I need patched ROM for Windows too.
Found patched ROM for my GPU (https://www.techpowerup.com/vgabios/216922/AMD.RX5500XT.8192.191017.rom). Used your command, that you wrote here in comments. All worked! (Almost, neither mouse nor keyboard works)
As for Windows (using -cpu host
), -- it works disgusting. Drivers autodetection doesn't work. Edge doesn't work. I ought to use IExplorer to download Firefox. Screen resolution -- only 800x600. AMD Automatic driver installer sees no AMD devices. Download something in Firefox -- BSOD. Launch .exe -- BSOD. Download Windows updates -- BSOD.
Thank you!!!
Using evdev for keyboard/mouse passthrough didn't work.
But using this works:
-usb \
-device usb-host,vendorid=0x1532,productid=0x0101,id=mouse \
-device usb-host,vendorid=0x04f2,productid=0x0833,id=keyboard
You can find vendorid and productid using lsusb.
With this method, you can't switch between host & guest though..
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Hello, Tryed on my laptop MSI Bravo 17 and got nothing. GUI hanged and nothing else. My
lspci -nn
:So I changed
to
, am I right?