Skip to content

Instantly share code, notes, and snippets.

@DUOLabs333
Last active June 1, 2021 20:22
Show Gist options
  • Save DUOLabs333/4467e2e0c49e819307db090d6c1c0a5b to your computer and use it in GitHub Desktop.
Save DUOLabs333/4467e2e0c49e819307db090d6c1c0a5b to your computer and use it in GitHub Desktop.
Boot up Fuchsia VM without having to compile anything
  1. Download the latest version of the Fuchsia IDK (it doesn't matter whether you choose Linux or MacOS).
  2. Unzip it, and go to device and choose either qemu-x64.json or qemu-arm64.json, depending on which platform you'll like to emulate.
  3. Open up your chosen .json file and copy everything after gs:// under "images_url". Then, paste into your browser, storage.googleapis.com + whatever came after it.
  4. Wait for the download to finish, then unzip it into a directory
  5. Create a tap interface and either bridge your ethernet or Wifi to it (for Windows, I've had success with OpenVPN and sharing my Wifi with my TAP interface in the Control Panel; for MacOS, you can use tuntaposx; for Linux, you can find instructions online).
  6. Convert the storage-full.blk to a qcow2 file with qemu-img convert -f raw -O qcow2 storage-full.blk storage-full.qcow2
  7. Resize the qcow2 file with qemu-img resize -f qcow2 storage-full.qcow2 +5G
  8. Execute qemu-system-x86_64 -kernel fuchsia/qemu-kernel.kernel -initrd fuchsia/zircon-a.zbi -drive file=fuchsia/storage-full.qcow2 -machine q35 -cpu Haswell,+smap,-fsgsbase -m 5G -netdev tap,id=mynet0,ifname=tap-test,script=no,downscript=no -device e1000,netdev=mynet0. If you absolutely can not use HAXM, Hyper-V, KVM, etc., you can add -smp 4 -accel tcg,thread=multi. Otherwise, add enable-+ your accelerator of choice.
  9. Enjoy!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment