I’m trying NixOS inside VirtualBox on two separate instances, one built from the ISO and the other from the VirtualBox demo/demo, both fresh installs and I love it. But.
The main machine is running Win10 and Bun works as intended inside WSL2, so we can normally cast out the “CPU argument” (AMD Ryzen 3 2200G with Radeon Vega Graphics 3.50 GHz) I saw on StackOverflow. If it works on Win/WSL it should work in Nix.
So. When adding Bun to configuration.nix or installing it from nix-shell -p bun …it installs, then throw “Illegal instruction” when invoked.
Is there anything I can add to the config file to make it work as intended?
Thank you for taking time to answer. Unfortunately, I think I’ve done the same research and already went trough the Bun’s issues github and StackOverflow … even there, the main reason cited was the CPU being old or not having something Bun use. If the hardware was indeed at fault it should fail the same on WSL, as it use the same machine.
I’m trying NixOS inside VirtualBox on two separate instances
I guess the important question is not what your Ryzen 3 2200 is capable of, but rather what your virtualized CPU is capable of.
Edit: If you want to do a 1-on-1 comparison, try cat /proc/cpuinfo | less and check what CPU flags are available, both in WSL2 (I hope that’s possible?) and inside the VM. Not sure which one might be missing though, but maybe the error message told you something more?
bun appears to have a baseline build that does not require AVX/AVX2 on the CPU. But that means that the normal build most likely requires them. And your VM doesn’t have them. And nixpkgs might not have them either.
So I’d say best bet is to teach your virtualized CPU AVX/AVX2, which should be doable.