1# Linux
2
3Build a Linux kernel for use as the primary VM OS kernel on the QEMU simulator.
4
5## Host cross-compilers
6
7You will need an GCC aarch64 targeted compiler. It may be available in your Linux distribution, E.g.:
8```bash
9sudo apt install build-essential gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu ncurses-dev
10```
11
12## Download the source code
13
14Download the latest Linux source code:
15> Note, we show a shallow clone to speed up checkouts
16
17```bash
18git clone --depth=1 https://github.com/torvalds/linux.git
19```
20
21## Build Linux kernel
22
23Build Linux kernel with the default defconfig, cross-compiled for arm64.
24
25```bash
26cd linux/
27make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
28make -j4 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
29cp ./arch/arm64/boot/Image <path-to-output-dir>/.
30```
31