for more details about args: refer to
doc:args
See all options:
./dbs-cli --help
A simple example:
./dbs-cli \
--kernel-path ~/path/to/kernel/vmlinux.bin \
--rootfs ~/path/to/rootfs/rootfs.dmg \
--boot-args "console=ttyS0 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" ;
For the rootfs from firecracker:
./dbs-cli \
--kernel-path ~/path/to/kernel/vmlinux.bin \
--rootfs ~/path/to/rootfs/bionic.rootfs.ext4 \
--boot-args "console=ttyS0 tty0 reboot=k debug panic=1 pci=off root=/dev/vda" ;
Set the log level and log file:
The log-level argument is case-insensitive: ErrOR and InFO are valid.
./dbs-cli \
--log-file dbs-cli.log --log-level ERROR \
--kernel-path ~/path/to/kernel/vmlinux.bin \
--rootfs ~/path/to/rootfs/bionic.rootfs.ext4 \
--boot-args "console=ttyS0 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" ;
Create a vsock console (communication with sock file)
When the parameter
serial-path
is not given or set to "stdio",dbs-cli
will create a stdio console.Otherwise,
dbs-cli
will create a vsock console with a sock file, namely the value ofserial-path
.
./dbs-cli \
--log-file dbs-cli.log --log-level ERROR \
--kernel-path ~/path/to/kernel/vmlinux.bin \
--rootfs ~/path/to/rootfs/bionic.rootfs.ext4 \
--boot-args "console=ttyS0 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" \
--serial-path "/tmp/dbs" ;
If you want to exit vm, just input
reboot
in vm's console.
If you wish to modify some details or debug to figure out the fault of codes, you can do as follow to see whether the program act expectedly or not.
cargo run -- --kernel-path ~/path/to/kernel/vmlinux.bin \
--rootfs ~/path/to/rootfs/rootfs.dmg \
--boot-args "console=ttyS0 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" ;
To see some help:
cargo run -- --help
Regarding the dependency issue of the upstream library, it is recommended to build the build
target of Makefile to avoid it temporally.
make build
DBS-CLI
is licensed under Apache License, Version 2.0.