34 lines
996 B
Markdown
34 lines
996 B
Markdown
# bearnet
|
|
|
|
This repository contains necessarities to build a VM image and corresponding hypervisor image using Dockerfiles.
|
|
|
|
Edit corresponding files in [image/overlay](./image/overlay) to customize VM behaviour. Privileges are required for building VM images as some scripts are depending on `/dev/nbd`.
|
|
|
|
# Build & Running
|
|
|
|
```bash
|
|
# cp .env.example .env
|
|
# vim .env
|
|
# VM_OPTS="--no-cache" HY_OPTS="--no-cache" ./BUILD.sh
|
|
# fallocate -l 128G ./data/data.raw
|
|
# sgdisk -o -n 1:0:0 -t 1:8300 ./data.raw
|
|
# losetup -Pf ./data.raw
|
|
# mkfs.ext4 /dev/loop0p1
|
|
# losetup -d /dev/loop0
|
|
|
|
# vim docker-compose.yml
|
|
# docker compose up
|
|
```
|
|
|
|
The given compose file is for reference only. It must be edited according to your situation.
|
|
|
|
Once the image is built and udhcpd is ready, VM's IP will be shown in logs.
|
|
|
|
By default, a OpenSSH server will be listening on :2222.
|
|
|
|
# FAQ
|
|
|
|
> udhcpc: socket(AF_PACKET,2,8): Address family not supported by protocol
|
|
|
|
Clear build cache for both images to unify kernel version.
|