Qemu Vga Drivers For Mac

mac OS QEMU with VGA passthrough, Clover EFI boot
  1. The host machine communicates with the QEMU guest agent through a VirtIO serial connection between the host and guest machines. A VirtIO serial channel is connected to the host via a character device driver (typically a Unix socket), and the guest listens on this serial channel.
  2. QEMU now includes a VGA driver for Mac machine types (g3beige/mac99, respectively OldWorld and NewWorld) Support for POWER9 guests with KVM; Partial support for POWER9 guests with TCG. The powernv machine includes a more complete device tree. OpenPIC timers now work; The U-Boot firmware for the e500 has been updated to release v2017.07; pSeries.
hackintosh.sh

Status - 17 July 2020 - Core information collected Optionally: I may at some point add section on moving to / from: Physical to Virtual Mac and to / from VMWare Fusion to QEMU / KVM Macs and now verified with Ubuntu 20.04 and does some further Q35 Version and Network device testing. On the QEMU side of things, everything should be included in QEMU 2.1. The last required piece was the kvm=off cpu option, which is necessary for Nvidia 340+ guest drivers. On the kernel side, this setup requires only the i915 patch since IGD is my host graphics.

QEMU_AUDIO_DRV=alsa QEMU_ALSA_ADC_BUFFER_SIZE=1024 QEMU_ALSA_ADC_PERIOD_SIZE=256 QEMU_ALSA_DAC_BUFFER_SIZE=1024 QEMU_ALSA_DAC_PERIOD_SIZE=256 QEMU_AUDIO_DAC_FIXED_SETTINGS=1 QEMU_AUDIO_DAC_FIXED_FREQ=44100 QEMU_A
UDIO_DAC_FIXED_FMT=S16 QEMU_AUDIO_ADC_FIXED_FREQ=44100 QEMU_AUDIO_ADC_FIXED_FMT=S16 QEMU_AUDIO_DAC_TRY_POLL=1 QEMU_AUDIO_ADC_TRY_POLL=1 QEMU_AUDIO_TIMER_PERIOD=50
/usr/local/bin/qemu-2.9.0 -machine q35,accel=kvm
-cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,+vmx,vmware-cpuid-freq=on
-mem-prealloc
-drive file=/hackintosh/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on
-drive file=/hackintosh/OVMF_VARS.fd,if=pflash,format=raw,unit=1
-m 4096
-smp 4,sockets=1,cores=2,threads=2
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1
-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e
-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0
-device ahci
-drive file=/hackintosh/clover.img,format=raw,if=none,id=drive0
-device ide-hd,bus=ide.0,drive=drive0,id=sata0-0-0,bootindex=1
-drive file=/mnt/mac_hdd.img,format=raw,if=none,id=drive-sata0-0-1
-device ide-hd,bus=ide.1,drive=drive-sata0-0-1,id=sata0-0-1,bootindex=2
-netdev tap,id=hostnet0,vhost=on
-device e1000-82545em,netdev=hostnet0,id=net0,mac=52:54:00:92:33:51,bus=pci.2,addr=0x1
-netdev tap,id=hostnet1,vhost=on
-device e1000-82545em,netdev=hostnet1,id=net1,mac=52:54:00:cf:fa:66,bus=pci.2,addr=0x2
-usb -device usb-kbd -device usb-mouse
-device vfio-pci,host=03:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on
-device vfio-pci,host=03:00.1,bus=root.1,addr=00.1
-balloon none
-soundhw hda
-vga none
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
< QEMU
This article has some todo items:

This article describes some of the options useful for configuring QEMU virtual machines. For the most up to date options for the current QEMU install run man qemu at a terminal.

Note
It is important to note that the command has changed from qemu to qemu-system-x86_64 to launch QEMU as a 64-bit virtual machine.

Display options

There are a few available options to specify the kind of display to use in QEMU.

  • -display sdl - Display video output via SDL (usually in a separate graphics window).
  • -display curses - Displays video output via curses.
  • -display none - Do not display video output. This option is different than the -nographic option. See the man page for more information.
  • -display gtk - Display video output in a GTK window. This is probably the option most users are looking for.
  • -display vnc=127.0.0.1:<X> - Start a VNC server on display X (accepts an argument (X) for the display number). Substitute X for the number of the display (0 will then listen on 5900, 1 on 5901, etc).

For example to have QEMU send the display to a GTK window add the following option to the list:

Machine

  • -machine type=q35,accel=kvm - Modern chipset (PCIe, AHCI, ...) and hardware virtualization acceleration
  • -object rng-random,id=rng0,filename=/dev/urandom -device virtio-rng-pci,rng=rng0 - Pass-through for host random number generator. Accelerates startup of e.g. Debian VMs because of missing entropy.

Processor

  • -cpu <CPU> - Specify a processor architecture to emulate. To see a list of supported architectures, run: qemu-system-x86_64 -cpu ?
  • -cpu host - (Recommended) Emulate the host processor.
  • -smp <NUMBER> - Specify the number of cores the guest is permitted to use. The number can be higher than the available cores on the host system. Use -smp $(nproc) to use all currently available cores.

RAM

  • -m MEMORY - Specify the amount of memory (default: 128 MB). For instance: -m 256M (M stands for Megabyte, G for Gigabyte).
Qemu

Hard drive

  • -hda IMAGE.img - Set a virtual hard drive and use the specified image file for it.
  • -drive - Advanced configuration of a virtual hard drive:
  • Very fast Virtio SCSI emulation for block discards (TRIM), native command queuing (NCQ). You need at least one virtio-scsi-controller and for each block device a -drive and -device scsi-hd pair.
  • -drive file=IMAGE.img,if=virtio - Set a virtual VirtIO-BLK hard drive and use the specified image file for it.
  • -drive file=/dev/sdX#,cache=none,if=virtio - Set a virtual VirtIO-BLK hard drive and use the specified partition for it.
  • -drive id=disk,file=IMAGE.img,if=none -device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0 - Set emulation layer for an ICH-9 AHCI controller and use the specified image file for it. The AHCI emulation supports NCQ, so multiple read or write requests can be outstanding at the same time.

Optical drives

  • -cdrom IMAGE.iso - Set a virtual CDROM drive and use the specified image file for it.
  • -cdrom /dev/cdrom - Set a virtual CDROM drive and use the host drive for it.
  • -drive - Advanced configuration of a virtual CDROM drive:
  • -drive file=IMAGE.iso,media=cdrom - Set a virtual CDROM drive and use the specified image file for it. With this syntax you can set multiple drives.

Qemu Vga Virtio

Boot order

  • -boot c - Boot the first virtual hard drive.
  • -boot d - Boot the first virtual CD-ROM drive.
  • -boot n - Boot from virtual network.
Qemu Vga Drivers For Mac

Graphics card

QEMU can emulate several graphics cards:

  • -vga cirrus - Simple graphics card. Every guest OS has a built-in driver.
  • -vga std - Support resolutions >= 1280x1024x16. Linux, Windows XP and newer guest have a built-in driver.
  • -vga vmware - VMware SVGA-II, more powerful graphics card. Install x11-drivers/xf86-video-vmware in Linux guests, VMware Tools in Windows XP and newer guests.
  • -vga qxl - More powerful graphics card for use with SPICE.

To get more performance use the same color depth for your host as you use in the guest.

PCI pass-through

Note
This will NOT work for GPUs. It's completely different. Take a look here and here
KERNELFor AMD processors:

Find the host PCI device:

Note down the device (00:1b.0) and vendor (8086:284b) ID.

Unbind it:

root #echo '8086 284b' > /sys/bus/pci/drivers/pci-stub/new_id
root #echo '0000:00:1b.0' > /sys/bus/pci/devices/0000:00:1b.0/driver/unbind
root #echo '0000:00:1b.0' > /sys/bus/pci/drivers/pci-stub/bind

And bind it to guest:

-device pci-assign,host=00:1b.0

Networking

Qemu Graphics Driver

Default - without any -netdev option - is Pass-through.

Important
Pass-through method only works for TCP and UDP connections.Qemu device vga

Free Download Vga Drivers Xp

Thus, ping is not a suitable tool to test networking connectivity because it uses ICMP.

Try using curl or other UDP or TCP/IP software for testing.

Pass-through

  • -netdev user - The QEMU process will create TCP and UDP connections for each connection in the VM. The virtual machine does not have an address reachable from the outside.
  • -device virtio-net,netdev=vmnic -netdev user,id=vmnic - (Recommended) Pass-through with VirtIO support.
  • -netdev user,id=vmnic,hostfwd=tcp:127.0.0.1:9001-:22 - Let QEMU listen on port 9001. Connections to that port will be relayed to the VM on port 22. ssh -p 9001 localhost will thus log into the VM.


Virtual network cable (TAP)

  • -device virtio-net,netdev=vmnic -netdev tap,id=vmnic,ifname=vnet0,script=no,downscript=no - A new device (vnet0) is created by QEMU on the host, the other end of the 'cable' is at the VM.


Network bridge

With this setup, we create a TAP interface (see above) and connect it to a virtual switch (the bridge).

Please first read about network bridging and QEMU about configuring kernel to support bridging.

OpenRC

Assuming a simple case with only one Virtual Machine with tap0 net interface and only one net interface on host with eth0.

Vga

Host and guest can be on the same subnet.Configuration based on this forum post. [1]

systemd

Create the bridge:

FILE/etc/systemd/network/vmbridge.netdev

Configure the bridge's address:

FILE/your/path/to/qemu/stuff/addtobridge.sh