> For the complete documentation index, see [llms.txt](https://breaking-bits.gitbook.io/breaking-bits/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://breaking-bits.gitbook.io/breaking-bits/vulnerability-discovery/emulation/building-qemu-on-ubuntu.md).

# Building QEMU on Ubuntu

This guide is stolen from <http://logan.tw/posts/2018/02/18/build-qemu-user-static-from-source-code/>

Install dependencies

```bash
$ sudo apt-get build-dep qemu
```

Download Source

```bash
$ git clone git://git.qemu.org/qemu.git
$ cd qemu
$ git submodule update --init --recursive
```

Configure QEMU

```bash
./configure \
    --prefix=$(cd ..; pwd)/qemu-user-static \
    --static \
    --disable-system \
    --enable-linux-user
### Or
./configure \
    --prefix=$(cd ..; pwd)/qemu-user-static \
    --disable-system \
    --enable-linux-user
```

Build and Install QEMU

```bash
make -j8
make install
```

The make install might not work

```
for i in $(ls | grep user);do sudo cp $i/qemu-* /usr/bin/;done
```
