Sample Header Ad - 728x90

sinit failing to run in firecracker vmm

0 votes
0 answers
30 views
I am playing around with firecrackver VMM. I have extracted rootfs from a python docker image like this.
docker export $(docker create python:latest) --output="python.tar"
mkdir python
tar -xf python.tar -C python/
dd if=/dev/zero of=python.ext4 bs=1M count=1500
mkfs.ext4 python.ext4
mkdir python-mnt
sudo mount python.ext4 python-mnt
sudo cp -r python/* python-mnt/
sudo umount python-mnt
I am using the kernel that is provided in the firecracker readme. If I try running this sudo ./firecracker --api-sock "fc1.socket" --config-file vmconfig.json I will get kernel panic because it cant find init system. I compiled suckless init (sinit) and tried using that but my vm doesnt start. I might be doing something wrong with my config file
{
  "boot-source": {
    "kernel_image_path": "vmlinux",
    "boot_args": "console=ttyS0 reboot=k panic=1 pci=off "
  },
  "drives": [
    {
      "drive_id": "init",
      "is_root_device": false,
      "is_read_only": false,
      "path_on_host": "sinit"
    },
    {
      "drive_id": "rootfs",
      "is_root_device": true,
      "is_read_only": false,
      "path_on_host": "python.ext4"
    }
  ],
  "machine-config": {
    "vcpu_count": 2,
    "mem_size_mib": 1024,
    "smt": false,
    "track_dirty_pages": false,
    "huge_pages": "None"
  },
  "cpu-config": null,
  "balloon": null,
  "network-interfaces": [],
  "vsock": null,
  "logger": null,
  "metrics": null,
  "mmds-config": null,
  "entropy": null
}
I have two drives here because I am following https://github.com/superfly/init-snapshot/blob/public/README.md this example. It has not worked so I thought of starting with a simple init. PS: I am very new to this subject and I am interested to learn more. I might have asked a very stupid question and please point me to resources where I can learn about it.
Asked by Raaz (131 rep)
Jan 1, 2025, 01:42 PM