Norman's Blog

Setting up NixOS in VMware Fusion Public Tech Preview 22H2

On the macOS host:

  1. Install and start Docker Desktop for Mac
  2. git clone https://github.com/normful/nixos-config.git
  3. cd nixos-config && make iso/nixos.iso
  4. Install VMware Fusion Public Tech Preview 22H2

In VMware Fusion:

  1. Install from disc or image
  2. Choose nixos.iso
  3. Select Linux -> Other Linux 5.x kernel 64-bit Arm
  4. Click Customize Settings
  5. Type a better name into the Save As field.
  6. Display:
  7. Network Adapter -> Connect Network Adapter -> Share with my Mac (default)
  8. Hard Disk:
  9. Sound Card -> Remove Sound Card
  10. Camera -> Remove Camera
  11. Start VM

On the VM:

  1. Press enter to start the installer (default selection). This will run https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/boot/stage-1-init.sh
    • For some strange reason, at one point, it was running into an error trying to mount /mnt-root even though /mnt-root was not even mounted in latter attempts that succeeded.
  2. setfont ter-v32n to use a larger font.
  3. Switch into into the root user: sudo su
  4. Set the root user password to root: passwd
  5. Write down IP address from ip a output.

On the host:

  1. Fill in NIXADDR in the Makefile using the IP address.
  2. make vm/boostrap0 and wait it to finish and reboot.
  3. docker run -it --rm alpine mkpasswd -m sha-512 and copy the password hash to nixos-config/users/norman/nixos.nix in users.users.norman.hashedPassword.
  4. Copy ~/.ssh/id_ed25519.pub to nixos-config/users/norman/nixos.nix in users.users.norman.openssh.authorizedKeys.keys.
  5. make vm/boostrap and wait it to finish and reboot.