Overview

I had to build a kernel and an image for trying CorJail. But the building was not completed in my environment (WSL2 on Windows 11). I think I will be comfortable if I have a linux VM for a building linux kernel, file system image, and etc.

Step

  1. Select Ubuntu version and download its image on here
  2. Install cloud-init, cloud-utils and qemu-system
    1. You can install them by sudo apt install -y cloud-init cloud-utils qemu-system on Debian/Ubuntu.
  3. Generate a RSA key using ssh-keygen -t rsa
  4. Set up config file and create seed.img
    1. To create config files, see config files section
    2. Create seed.img via cloud-localds seed.img user-data.yaml metadata.yaml
  5. Set shared foldder and run qemu
  6. In guest OS, add shared /shared 9p trans=virtio,version=9p2000.L,access=any 0 0 to /etc/fstab
    1. After addition type sudo systemctl daemon-reload && sudo systemctl restart local-fs.target && sudo mount -a.

Then if you need more space for a qemu drive, use qemu-img resize.