# 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
```
