Open TonyTheLion opened 6 years ago
Hi,
I have nixos
working via QEMU/libvirt
on archlinux
. Looking at my command history...
Create image.
qemu-img create -f qcow2 /common/Containers/pool/nixos.qcow2 12G
Install
qemu-system-x86_64 -m 2056 -hda /common/Containers/pool/nixos.qcow2 -cdrom /data/iso/nixos-minimal-17.09.2853.b222a0713f4-x86_64-linux.iso -boot d -vnc :1 -enable-kvm
Note the -vnc
flag to view via vncviewer
.
Install via your own method but I did ...
Via vncviwer
I used this to bootstrap my installation. I know it's tailored for Vultr
install (I have a Vulr
account and used this script to install nixos
successfully) but found it worked with QEMU
. I think you need to tweak /dev/vda
(and reflect this in configuration.nix
at boot.load.grub.device
) and naturally use your own generated keys. Tinker with configuration.nix
if need be.
Powerdown and boot into fresh install.
qemu-system-x86_64 -m 2056 -hda /common/Containers/pool/nixos.qcow2 -vnc :1 -enable-kvm
This method only allows login over ssh
and I couldn't identify the ip
address of the instance/guest. This can be rectified by importing into libvirt
and following the dns
tweak by modifying /etc/nsswitch.conf
as described on the archlinux
wiki. (libvirt
has been added).
hosts: files libvirt dns myhostname
This allows guest
images to be referenced by their name in lieu of their ip
addresses.
Importing into libvirt
.
virt-install --name nixos --ram 2048 --vcpus="1,maxvcpus=2" --connect qemu:///system --disk path="/common/Containers/pool/nixos.qcow2",device=disk,bus=virtio,format=qcow2 --network="network=default" --os-type linux --os-variant generic --noautoconsole --console pty,target_type=serial --graphics vnc,listen=0.0.0.0 --import
Start via virsh
virsh -c qemu:///system start nixos
ssh
in.
ssh ian@nixos
I have this problem occurring as well.
The system boots up with QEMU easily when I use -vga std
. But I try to use -nographic
with the serial console redirected I end up with:
kbd_mode: KDSKBMODE: Inappropriate ioctl for device
starting device mapper and LVM...
[ 1.799591] random: lvm: uninitialized urandom read (4 bytes read)
mounting tmpfs on /...
mounting ../nix-store.squashfs on /nix/.ro-store...
[ 1.862079] squashfs: version 4.0 (2009/01/31) Phillip Lougher
mounting tmpfs on /nix/.rw-store...
mounting unionfs on /nix/store...
stage 2 init script (/mnt-root//init) not found
Pretty strange error.
Hello, I'm a bot and I thank you in the name of the community for opening this issue.
To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.
The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.
If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.
Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/nixos-vm-under-freebsd-bhyve-failing/24964/1
Issue description
Running the following:
qemu-system-x86_64 -enable-kvm -m 4G -cdrom ../install/nixos/nixos-17.09.3023.c882c4dd55e-x86_64.iso -initrd ../install/nixos/iso/boot/initrd -kernel ../install/nixos/iso/boot/bzImage -append "console=ttyS0" -boot order=d ./hydra.qcow2 -nographic
results in the following output:
Steps to reproduce
1) mount the iso
sudo mount -o loop <nixos.iso> iso
2) run the qemu command as above, making sure you point the 'initrd' and the 'bzImage` in the iso\boot\ dir in the command correctly.
This is running it on an Ubuntu 16.04.3 LTS server edition.