tree: 406ef020f9117ad9579190d422c3581a5201085f [path history] [tgz]
  1. docs/
  2. meta/
  3. scripts/
  4. BUILD.gn
  5. efi.cc
  6. efi.h
  7. guest.cc
  8. guest_view.cc
  9. guest_view.h
  10. kernel.h
  11. linux.cc
  12. linux.h
  13. README.md
  14. zircon.cc
  15. zircon.h
bin/guest/README.md

Guest

The guest app enables booting a guest operating system using the Zircon hypervisor.

These instructions will guide you through creating minimal Zircon and Linux guests. For instructions on building a more comprehensive linux guest system see Hypervisor Benchmarking.

Building a guest image

To run a guest using the hypervisor, you must create a bootfs image containing the guest and use the guest app to launch it. This section will provide steps for building a simple Zircon and Linux guest image.

Note: guest only supports the Zircon and Linux kernels.

On the host system, run the following from the Fuchsia root (ex: the same directory that contains .jiri_root):

# Optional: Build Linux, an initial RAM disk, and an EXT2 file-system.
garnet/bin/guest/scripts/mklinux.sh x86
garnet/bin/guest/scripts/mksysroot.sh -ri x86

# Optional: Build a GPT disk image for Zircon guests.
garnet/bin/guest/scripts/mkgpt.sh

# This will assemble all the boot images and start the bootserver. It will be
# ready to netboot once you see:
#
# [bootserver] listening on [::]33331
garnet/bin/guest/scripts/build.sh x86

Zircon guest

After netbooting the target device, to run Zircon:

run guest -r /system/data/bootdata.bin /system/data/zircon.bin

To run Zircon using a GPT disk image:

run guest \
    -b /system/data/zircon.gpt \
    -r /system/data/bootdata.bin \
    /system/data/zircon.bin

Linux guest

After netbooting the target device, to run Linux using an initial RAM disk:

run guest -r /system/data/initrd /system/data/image

To run Linux using a read-only EXT2 root file-system:

run guest \
    -b /system/data/rootfs.ext2 \
    -c 'root=/dev/vda ro init=/init' \
    /system/data/image

To run Linux using a writable EXT2 root file-system:

cp /system/data/rootfs.ext2 /system/data/rootfs-rw.ext2

run guest \
    -b /system/data/rootfs-rw.ext2 \
    -c 'root=/dev/vda rw init=/init' \
    /system/data/image