• Stars
    star
    112
  • Rank 312,240 (Top 7 %)
  • Language
    Shell
  • Created over 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Boot a Linux kernel in a VM without a dedicated root filesystem.

eudyptula-boot

eudyptula-boot boots a Linux kernel in a VM without a dedicated root filesystem. The root filesystem is the underlying root filesystem (or some pre-built chroot). This is a convenient way to do quick tests with a custom kernel.

The name comes from Eudyptula which is a genus for penguins. This is also the name of a challenge for the Linux kernel.

This utility is aimed at development only. This is a hack. It relies on AUFS/overlayfs and 9P to build the root filesystem from the running system.

Also see this blog post for a quick presentation of this tool.

Usage

It is preferable to have a kernel with AUFS or OverlayFS enabled. Ubuntu and Debian kernels are patched to support AUFS. Since 3.18, vanilla kernels have OverlayFS built-in. Ubuntu kernels also come with OverlayFS support. Check you have one of those options:

CONFIG_AUFS_FS=y
CONFIG_OVERLAY_FS=y
CONFIG_OVERLAYFS_FS=y

Ensure you have the following options enabled (as a module or builtin):

CONFIG_9P_FS=y
CONFIG_NET_9P=y
CONFIG_NET_9P_VIRTIO=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_CONSOLE=y

To get a somewhat minimal configuration, have a look at the minimal-configuration script.

Once compiled, the kernel needs to be installed in some work directory:

$ make modules_install install INSTALL_MOD_PATH=$WORK INSTALL_PATH=$WORK

Then, boot your kernel with:

$ eudyptula-boot --kernel $WORK/vmlinuz-3.15.0~rc5-02950-g7e61329b0c26

Use --help to get additional available options.

Before booting the kernel, the path to GDB socket will be displayed. You can use it by running gdb on vmlinux (which is somewhere in the source tree):

$ gdb vmlinux
GNU gdb (GDB) 7.4.1-debian
Reading symbols from /home/bernat/src/linux/vmlinux...done.
(gdb) target remote /path/to/vm-eudyptula-gdb.pipe
Remote debugging using /path/to/vm-eudyptula-gdb.pipe
native_safe_halt () at /home/bernat/src/linux/arch/x86/include/asm/irqflags.h:50
50  }
(gdb)

If you have modules, you also need to manually load debug symbols for them. In guest:

$ grep . /sys/module/vxlan/sections/{.text,.data,.bss}
/sys/module/vxlan/sections/.text:0xffffffffc0370000
/sys/module/vxlan/sections/.data:0xffffffffc0378000
/sys/module/vxlan/sections/.bss:0xffffffffc0378900

In GDB:

(gdb) add-symbol-file /usr/lib/debug/lib/modules/$(uname -r)/kernel/drivers/net/vxlan.ko \
                      0xffffffffc0370000 \
             -s .data 0xffffffffc0378000 \
             -s .bss  0xffffffffc0378900

This can be automated with lx-symbols command if you source vmlinux-gdb.py from a compiled kernel.

A serial port is also exported. It can be convenient for remote debugging of userland processes. More details can be found in this blog post (which also covers debugging the kernel).

QEMU monitor is also attached to a UNIX socket. You can use the following command to interact with it:

$ socat - UNIX:/path/to/vm-eudyptula-console.pipe
QEMU 2.0.0 monitor - type 'help' for more information
(qemu)

You can also get something similar to guestfish:

$ eudyptula-boot --qemu="-drive file=someimage.qcow2,media=disk,if=virtio"

With --extra-gettys, you can allocate additional consoles. To access one of them, use:

$ socat STDIO,echo=0,icanon=0 UNIX:/tmp/tmp.oCshB5ryj4/getty-1.pipe

Alternatives

Similar projects exist:

More Repositories

1

network-lab

Networking lab using root-less VM
Shell
528
star
2

dashkiosk

Managing dashboards on various displays (especially those running on Android)
JavaScript
354
star
3

hellogopher

Makefile to build a Go project
Makefile
301
star
4

rfc5077

Various tools for testing RFC 5077
C
241
star
5

nodecastor

Experiment to implement a sender API for Chromecast in Node.js
JavaScript
180
star
6

snimpy

interactive SNMP tool with Python
Python
180
star
7

video2hls

Prepare a video to be streamed with HLS
Python
171
star
8

awesome-configuration

My ~/.config/awesome directory
Lua
127
star
9

pragmatic-debian-packages

Pragmatic Debian packaging
Makefile
98
star
10

serverspec-example

Advanced use example of serverspec
JavaScript
98
star
11

jchroot

a chroot with more isolation
C
96
star
12

wiremaps

layer 2 network discovery application
Python
89
star
13

zshrc

My .zshrc
Shell
84
star
14

bootstrap.c

Boilerplate for small C projects (autotools)
C
74
star
15

i3wm-configuration

Python
72
star
16

vincent.bernat.ch

My own website
HTML
71
star
17

extend-netsnmp

Various examples on how to extend NetSNMP agent
C
46
star
18

ssl-dos

Various tools related to SSL denial of service
C
46
star
19

python-script

Sample self-contained Python script
Python
36
star
20

systemtap-cookbook

Some tools using systemtap
Python
29
star
21

vbeterm

Custom terminal based on VTE
C
21
star
22

xssproxy

Forward freedesktop.org Idle Inhibition Service calls to Xss
C
20
star
23

ip_vs_mh

Backport of ip_vs_mh for Linux (consistent hashing with Google's Maglev algorithm)
C
17
star
24

lanco

task launcher which does not want to be an init program
C
16
star
25

bootstrap.c-web

Boilerplate for small C projects (autotools) exporting a REST+SSE+WS API
C
14
star
26

puppet-workstation

Puppet setup to install my own workstation
Puppet
14
star
27

udpproxy

a Netfilter powered UDP proxy
C
13
star
28

cve-2015-3456

Experiments related to CVE-2015-3456
C
12
star
29

puppet-eizo

Puppet repository for "eizo"
Shell
12
star
30

ethtool-snmpd

Export ethtool stuff through SNMP
C
12
star
31

dot.emacs

My Emacs (and Gnus) configuration files
Emacs Lisp
12
star
32

fvwm-configuration

My configuration for fvwm
Shell
11
star
33

dashkiosk-android

Android application for Dashkiosk
Java
9
star
34

ansible-custom-module-examples

See https://vincent.bernat.ch/en/blog/2020-custom-ansible-module
Python
9
star
35

haproxy-debian-repository-wizard

Web application to select the appropriate Debian repository for HAProxy
HTML
9
star
36

junos-mode

Emacs major mode for JunOS configuration file
Emacs Lisp
9
star
37

ripe-atlas-lowest-latency

RIPE Atlas tool to determine the endpoint with the lowest latency
Python
8
star
38

ip_vs_csh

Consistent source hashing scheduler for Linux IPVS
C
8
star
39

ro-ro-tcp

performance enhancing proxy for TCP over links with high latency and moderate error rates
C
8
star
40

vpnoo

an IPSEc + XAuth client for Mac OS X
C
8
star
41

asn2org

AS numbers to organization names
Python
7
star
42

nixops-take1

Playground for NixOps
Nix
7
star
43

quagga

Quagga is free software that manages various IPv4 and IPv6 routing protocols.
C
5
star
44

flappy-bird-reborn-multiplayer

A "Flappy Bird" clone with multiplayer ability.
JavaScript
4
star
45

old-turbo-pascal-programs

Old programs that I wrote when I was a kid.
Pascal
4
star
46

cdktf-take1

Musing around CDKTF
TypeScript
3
star
47

splitpkcs12

PKCS#12 certificate splitter
C
3
star
48

net-snmp

Net-SNMP (not official)
C
3
star
49

ipoo

gather information about IP and hostnames
Python
3
star
50

dosbox

DOSBox, an x86 emulator with DOS. ⚠️ Not official. Not a complete mirror. Not updated.
C++
3
star
51

last-resort-gateway

Manage a last resort gateway
Go
2
star
52

pulumi-vultr

Pulumi provider for Vultr (based on the Terraform one), not official
Python
2
star
53

pygments-junos

JunOS lexer for pygments
Python
2
star
54

pygments-ios

IOS lexer for pygments
Python
2
star
55

homemanager-configuration

home-manager configuration for use with Debian Sid
Nix
2
star
56

www.une-oasis-une-ecole.fr

Source code for http://www.une-oasis-une-ecole.fr
HTML
2
star
57

Kitero

Interface and QoS switcher for router
Python
2
star
58

pulumi-gandi-old

Pulumi provider for Gandi, based on Terraform, not official
Python
1
star
59

pygments-haproxy

HAProxy lexer for Pygments
Python
1
star
60

QCss-3

load-balancer web service
Python
1
star