Skip to content

Instantly share code, notes, and snippets.

@madyasiwi
Last active December 31, 2019 00:17
Show Gist options
  • Save madyasiwi/245c09c7738dd22a0788fa4b9b7e03dd to your computer and use it in GitHub Desktop.
Save madyasiwi/245c09c7738dd22a0788fa4b9b7e03dd to your computer and use it in GitHub Desktop.

Qemu Build Notes

This is a work in progress

Main information for building qemu can be found in https://wiki.qemu.org/Hosts/Linux. This documentation add some more details on how I tried to build qemu with OpenGL support on Ubuntu 18.04 Server in December 2019.

Pre-requirements

  • Git
  • Make
  • bison
  • flex

Build tools

sudo apt install build-essential

Minimum/default configuration

sudo apt install libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev

OpenGL support

sudo apt install libepoxy-dev libgbm-dev

SDL support

sudo apt install libsdl2-dev

Virgl support

sudo apt install libvirglrenderer-dev

Cloning the repository

To clone particular version only -- on order to speed up downloads:

git clone --branch v4.2.0 --depth 1 git://git.qemu-project.org/qemu.git

Configuration options

  • --target-list=x86_64-softmmu

    Limit build to x86-64 architecture to speed up build.

  • --enable-kvm

  • --enable-opengl

  • --enable-sdl

  • --enable-virglrenderer

Make options

  • -j4

    Number of concurrent build workers. Adjust to match the number of your logical processors.

Apparmor permission

After;

make install

Tell apparmor to allow libvirtd run the custom build qemu and its tools in /usr/local/bin by adding the directory into /etc/apparmor.d/usr.sbin.libvirtd. (This assumes libvirt-daemon-system is already installed.)

/usr/local/bin/* PUx,

Then run:

sudo apparmor_parser -r /etc/apparmor.d/usr.sbin.libvirtd

To apply the changes immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment