It’s better to use virt-manager as it’s more user-friendly and will add the corresponding flags.
Installation
# install in archyay -S qemu-full
Tip
When I tried to launch the installation, I had a “Kernel panic” error with the message “is deadlock on memory”.
By default only 128 MiB of memory is assigned to the machine. The amount of memory can be adjusted with the -m switch, for example -m 512M or -m 2G.
Issue encountered
Cannot start SSH daemon ✅
I installed NixOS using the following commands:
# create hard disk imageqemu-img create -f raw nix 50G# start NixOS installation from ISO imageqemu-system-x86_64 \ -cdrom ~/Downloads/nixos-gnome-24.05.675.805a384895c6-x86_64-linux.iso \ -boot order=d \ -drive file=nix,format=raw \ -m 2048
I had the following error:
[ERROR] Cannot start ssh daemon
I changed the command from -boot order=d to -boot menu=on.
# first create qcow2 hard disk imageqemu-img create -f qcow2 nix.qcow2 50G# execute imageqemu-system-x86_64 \ -enable-kvm \ -m 4G \ -smp 2 \ -hda nix.qcow2 \ -boot d \ -cdrom ~/Downloads/nixos-gnome-24.05.675.805a384895c6-x86_64-linux.iso \ -netdev user,id=net0,net=192.168.0.0/24,dhcpstart=192.168.0.9 \ -device virtio-net-pci,netdev=net0 \ -vga qxl
Stuck on loading screen ✅
I used another command to support UEFI. It started good, i.e. the resolution was greater than the previous one (3/4 of my screen), however, the screen is stuck to the loading screen with the TianoCore and Nix logos…
Tried to add SPICE to have shared clipboard from host to guest:
$ # not working as I do not have SPICE client$ qemu-system-x86_64 -enable-kvm \ -m 4G \ -smp 2 \ -hda nix.qcow2 \ -netdev user,id=net0,net=192.168.0.0/24,dhcpstart=192.168.0.9 \ -device virtio-net-pci,netdev=net0 \ -vga std \ -device virtio-serial-pci \ -spice port=5930,disable-ticketing=on \ -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \ -chardev spicevmc,id=spicechannel0,name=vdagent \ -display spice-appqemu-system-x86_64: info: Launching display with URI: spice+unix:///tmp/.EECBP2/spice.sockqemu-system-x86_64: Failed to launch spice+unix:///tmp/.EECBP2/spice.sock URI: The specified location is not supportedqemu-system-x86_64: You need a capable Spice client, such as virt-viewer 8.0$ # Installing spice client, and now it's working!$ yay -S virt-viewer
Fail
I gave up. It seems it’s not possible to share the clipboard on Wayland.
Now, I tried to start the VM at home, but I got the error:
Error starting domain: Requested operation is not valid: network 'default' is not active
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager
...
Success
I had to enable it:
$ # check network$ sudo virsh net-list --all Name State Autostart Persistent---------------------------------------------- default inactive no yes$ # enable default network$ sudo virsh net-start defaultNetwork default started$ sudo virsh net-list --all Name State Autostart Persistent-------------------------------------------- default active no yes$ # enable auto start so it's enable with boot$ sudo virsh net-autostart defaultNetwork default marked as autostarted
When I re-started the VM at home, using Hyprland, alacritty is not executing automatically.
Moreover, when I tried to SUPER+Return, no console is spawn…
Success
It was my alacritty/default.nix configuration that was not working…
I had the following:
{ ... }: { services.openssh = { enable = true; settings = { AllowUsers = [ "l-lin" ]; PasswordAuthentication = false; PermitRootLogin = "yes"; }; }; # Start the OpenSSH agent when you log in. # The OpenSSH agent remembers private keys for you so that you don’t have to type in passphrases # every time you make an SSH connection. # Use ssh-add to add a key to the agent. programs.ssh.startAgent = true;}
However, it’s not connecting. Maybe I need to add my public key?