Skip to content

Instantly share code, notes, and snippets.

@ivon852
Created July 14, 2023 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivon852/0a0fae263c49c1e06f97237e439ab61c to your computer and use it in GitHub Desktop.
Save ivon852/0a0fae263c49c1e06f97237e439ab61c to your computer and use it in GitHub Desktop.
Compile QEMU binaries in Docker
mkdir ~/qemubuilder && cd qemubuilder
cat <<EOT >> Dockerfile
FROM debian:bookworm
RUN apt update
RUN apt install build-essential zlib1g-dev pkg-config libglib2.0-dev binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev python3-capstone virtualenv ninja-build wget -y
EOT
docker build -t qemubuilder .
sudo docker run -it -v $(realpath ./build):/mnt/build --name qemubuilder "qemubuilder"
cd ~
wget https://download.qemu.org/qemu-6.2.0.tar.xz
tar xvJf qemu-6.2.0.tar.xz
cd qemu-6.2.0
./configure
make -j8
mv build/* /mnt/build
exit
echo "export PATH=/home/user/qemubuilder/build:$PATH" >> ~/.bashrc
source ~/.bashrc
sudo docker rm qemubuilder
sudo docker image rm qemubuilder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment