Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: using vm-nogui format, can you emulate an aarch64 guest on an x86 host? #249

Open
AydinGokce opened this issue Jun 16, 2023 · 0 comments

Comments

@AydinGokce
Copy link

Title sums it up.

I'm using nixosGenerate in a flake. Given a minimal example as such:

  mkVmImage = modules:
    nixos-generators.nixosGenerate {
      modules = modules;
      system = "...";
      format = "vm-nogui";
  };

This appears to always produce a run script and guest kernel/initrd for the same architecture. I.e. if system is x86_64-linux, the resulting executable bash script (something like run-nixos-vm) will be built to run on an x86_64-linux host and emulate an x86_64-linux guest VM, likewise for aarch64-linux. In my use case, I would like to have a runner script that runs on x86_64-linux, which emulates an aarch64-linux guest machine. Is it possible to achieve this using format = "vm-nogui"?

I'm guessing my best option would be to generate an aarch64-linux image in a qcow2 format, and make my own script to emulate it with qemu-system-aarch64, however I just wanted to check.

Thank you for the help! I apologize if this is a naive question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant