All Projects → david942j → Kvm Kernel Example

david942j / Kvm Kernel Example

Examples for: Learning KVM - implement your own kernel

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Kvm Kernel Example

Kafl
A fuzzer for full VM kernel/driver targets
Stars: ✭ 204 (-7.69%)
Mutual labels:  kernel, kvm
Prototype Kernel
Prototyping kernel development work outside mainline
Stars: ✭ 214 (-3.17%)
Mutual labels:  kernel, linux-kernel
Sutekh
An example rootkit that gives a userland process root permissions
Stars: ✭ 62 (-71.95%)
Mutual labels:  kernel, linux-kernel
Diamorphine
LKM rootkit for Linux Kernels 2.6.x/3.x/4.x/5.x (x86/x86_64 and ARM64)
Stars: ✭ 725 (+228.05%)
Mutual labels:  kernel, linux-kernel
Cv4pve Autosnap
Automatic snapshot tool for Proxmox VE
Stars: ✭ 123 (-44.34%)
Mutual labels:  vm, kvm
Proton zf6
Proton Kernel for the Asus Zenfone 6 (2019), codename Kirin and also known as I01WD and ZS630KL.
Stars: ✭ 42 (-81%)
Mutual labels:  kernel, linux-kernel
Simplefs
A simple file system for Linux kernel
Stars: ✭ 65 (-70.59%)
Mutual labels:  kernel, linux-kernel
Learn Kvm
Qemu KVM(Kernel Virtual Machine)学习笔记
Stars: ✭ 305 (+38.01%)
Mutual labels:  kernel, kvm
Raspberry Pi Os
Learning operating system development using Linux kernel and Raspberry Pi
Stars: ✭ 11,000 (+4877.38%)
Mutual labels:  kernel, linux-kernel
S2e
S2E: A platform for multi-path program analysis with selective symbolic execution.
Stars: ✭ 102 (-53.85%)
Mutual labels:  vm, kvm
Paper collection
Academic papers related to fuzzing, binary analysis, and exploit dev, which I want to read or have already read
Stars: ✭ 710 (+221.27%)
Mutual labels:  kernel, linux-kernel
Linux Samus
Linux 4.16 on Chromebook Pixel 2015
Stars: ✭ 179 (-19%)
Mutual labels:  kernel, linux-kernel
Spy
👀 Linux kernel mode debugfs keylogger
Stars: ✭ 546 (+147.06%)
Mutual labels:  kernel, linux-kernel
Linux Unattended Installation
This project provides all you need to create an unattended installation of a minimal setup of Linux.
Stars: ✭ 215 (-2.71%)
Mutual labels:  vm, kvm
Kernel Exploits
Various kernel exploits
Stars: ✭ 397 (+79.64%)
Mutual labels:  kernel, linux-kernel
Traceshark
This is a tool for Linux kernel ftrace and perf events visualization
Stars: ✭ 63 (-71.49%)
Mutual labels:  kernel, linux-kernel
camflow-dev
Generates kernel patch for CamFlow Linux Provenance Capture.
Stars: ✭ 19 (-91.4%)
Mutual labels:  kernel, linux-kernel
Sphinx-Beryllium
Sphinx Custom Kernel for Pocophone F1 (Beryllium)
Stars: ✭ 23 (-89.59%)
Mutual labels:  kernel, linux-kernel
Linux 0.11
A heavily commented linux kernel source code in Chinese.
Stars: ✭ 81 (-63.35%)
Mutual labels:  kernel, linux-kernel
Linux Kernel Utilities
👷 Utilities to compile and / or update linux kernels for Debian and derivatives (e.g. Ubuntu, LinuxMint, etc.)
Stars: ✭ 166 (-24.89%)
Mutual labels:  kernel, linux-kernel

KVM-Kernel Example

The source code are examples on my blog: Learning KVM - implement your own kernel.

I've described how to implement a KVM-based hypervisor and the key points to implement a kernel on my blog. You can leave comments in the blog or file issues here if you have questions or find any bug.

Dir

Hypervisor

The KVM-based hypervisor, its role is like qemu-system.

Kernel

A extremely simple kernel, supports few syscalls.

User

Simple ELF(s) for testing our kernel. Pre-built user program was provided, and you can re-generate by the following commands:

$ pip3 install pwntools
$ user/gen.py

NOTE: You have to install Python 3.x in advance.

Setup

Check KVM support

Check if your CPU supports virtualization:

$ egrep '(vmx|svm)' /proc/cpuinfo

NOTE: CPUs in a VM might not support virtualization (i.e. no nested virtualization). For example, EC2 on AWS doesn't support using KVM.

Install KVM device

Check if the KVM device exists:

$ ls -la /dev/kvm

If /dev/kvm is not found, you can enable it (on Ubuntu) with:

$ sudo apt install qemu-kvm

If you are not root, you need to add yourself into the kvm group to have permission for accessing /dev/kvm.

$ sudo usermod -a -G kvm `whoami`

Remember to logout and login to have the group changing effective.

How to run

$ git clone https://github.com/david942j/kvm-kernel-example
$ cd kvm-kernel-example && make
$ hypervisor/hypervisor.elf kernel/kernel.bin user/orw.elf /etc/os-release
# NAME="Ubuntu"
# VERSION="18.04.1 LTS (Bionic Beaver)"
# ID=ubuntu
# ID_LIKE=debian
# PRETTY_NAME="Ubuntu 18.04.1 LTS"
# VERSION_ID="18.04"
# HOME_URL="https://www.ubuntu.com/"
# SUPPORT_URL="https://help.ubuntu.com/"
# BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
# PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
# VERSION_CODENAME=bionic
# UBUNTU_CODENAME=bionic
# +++ exited with 0 +++

Environment

I only tested the code on Ubuntu 18.04, but I expect it to work on all KVM-supported x86 Linux distributions. Please file an issue if you find it's not true.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].