Giter Site home page Giter Site logo

homebrew-qemu-virgl's Introduction

3D accelerated qemu on MacOS

ubuntu

What is it for

If you own a Mac (x86 or ARM) and want to have a full Linux desktop for development or testing, you'll find that having a responsive desktop is a nice thing. The graphical acceleration is possible thanks to the work of Akihiko Odaki. I've only packaged it into an easily-installable brew repository while the changes are not yet merged into upstream.

Features:

  • Support for both ARM and X86 acceleration with Hypervisor.framework (works without root or kernel extensions)
  • Support for OpenGL acceleration in the guest (both X11 and Wayland)
  • Works on large screens (5k+)
  • Dynamically changing guest resolution on window resize
  • Properly handle sound output when plugging/unplugging headphones

Installation

brew install knazarov/qemu-virgl/qemu-virgl

Or brew tap knazarov/qemu-virgl and then brew install qemu-virgl.

Usage

Qemu has many command line options and emulated devices, so the sections are specific to your CPU (Intel/M1).

For the best experience, maximize the qemu window when it starts. To release the mouse, press Ctrl-Alt-g.

Usage - M1 Macs

First, create a disk image you'll run your Linux installation from (tune image size as needed):

qemu-img create hdd.raw 64G

Download an ARM based Ubuntu image:

curl -O https://cdimage.ubuntu.com/focal/daily-live/current/focal-desktop-arm64.iso

Copy the firmware:

cp $(dirname $(which qemu-img))/../share/qemu/edk2-aarch64-code.fd .
cp $(dirname $(which qemu-img))/../share/qemu/edk2-arm-vars.fd .

Install the system from the CD image:

qemu-system-aarch64 \
         -machine virt,accel=hvf,highmem=off \
         -cpu cortex-a72 -smp 2 -m 4G \
         -device intel-hda -device hda-output \
         -device virtio-gpu-pci \
         -device virtio-keyboard-pci \
         -device virtio-net-pci,netdev=net \
         -device virtio-mouse-pci \
         -display cocoa,gl=es \
         -netdev user,id=net,ipv6=off \
         -drive "if=pflash,format=raw,file=./edk2-aarch64-code.fd,readonly=on" \
         -drive "if=pflash,format=raw,file=./edk2-arm-vars.fd,discard=on" \
         -drive "if=virtio,format=raw,file=./hdd.raw,discard=on" \
         -cdrom focal-desktop-arm64.iso \
         -boot d

Run the system without the CD image to boot into the primary partition:

qemu-system-aarch64 \
         -machine virt,accel=hvf,highmem=off \
         -cpu cortex-a72 -smp 2 -m 4G \
         -device intel-hda -device hda-output \
         -device virtio-gpu-pci \
         -device virtio-keyboard-pci \
         -device virtio-net-pci,netdev=net \
         -device virtio-mouse-pci \
         -display cocoa,gl=es \
         -netdev user,id=net,ipv6=off \
         -drive "if=pflash,format=raw,file=./edk2-aarch64-code.fd,readonly=on" \
         -drive "if=pflash,format=raw,file=./edk2-arm-vars.fd,discard=on" \
         -drive "if=virtio,format=raw,file=./hdd.raw,discard=on"

Usage - Intel Macs

First, create a disk image you'll run your Linux installation from (tune image size as needed):

qemu-img create hdd.raw 64G

Download an x86 based Ubuntu image:

curl -O https://cdimage.ubuntu.com/focal/daily-live/current/focal-desktop-amd64.iso

Install the system from the CD image:

qemu-system-x86_64 \
         -machine accel=hvf \
         -cpu Haswell-v4 -smp 2 -m 4G \
         -device intel-hda -device hda-output \
         -device virtio-vga \
         -device virtio-keyboard-pci \
         -device virtio-net-pci,netdev=net \
         -device virtio-mouse-pci \
         -display cocoa,gl=es \
         -netdev user,id=net,ipv6=off \
         -drive "if=virtio,format=raw,file=hdd.raw,discard=on" \
         -cdrom focal-desktop-amd64.iso \
         -boot d

Run the system without the CD image to boot into the primary partition:

qemu-system-x86_64 \
         -machine accel=hvf \
         -cpu Haswell-v4 -smp 2 -m 4G \
         -device intel-hda -device hda-output \
         -device virtio-vga \
         -device virtio-keyboard-pci \
         -device virtio-net-pci,netdev=net \
         -device virtio-mouse-pci \
         -display cocoa,gl=es \
         -netdev user,id=net,ipv6=off \
         -drive "if=virtio,format=raw,file=hdd.raw,discard=on"

homebrew-qemu-virgl's People

Contributors

knazarov avatar oilipheist avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.