Re: [Nix-dev] vmTools.runInLinuxImage with ubuntu 1204 image blocks on getrandom()
Sure - open a PR adding virtio_rng. On Tue, Jul 26, 2016 at 3:43 PM, Maarten Hoogendoornwrote: > OK, fixed this problem by adding the virtio_rng device to the kernel and > qemu opts, see below. > > Would a PR to make these additions the default in > build-support/vm/default.nix be appreciated? > > with import {}; with pkgs; > let > script = '' ># /dev/urandom works fine >dd if=/dev/urandom of=/dev/null bs=1M count=1 > ># /dev/random only works if virtio_rng is enabled. >dd if=/dev/random of=/dev/null bs=1M count=1 > ''; > img = runCommand "nix-binary-tarball-test" { > diskImage = vmTools.diskImages.ubuntu1204x86_64; > QEMU_OPTS = "-device virtio-rng-pci"; >} script; >runCustomInImage = vmTools.override { > rootModules = [ "virtio_rng" "virtio_pci" "virtio_blk" > "virtio_balloon" "ext4" "unix" "9p" "9pnet_virtio" "rtc_cmos" ]; >}; > in >runCustomInImage.runInLinuxImage img #<- does work > # vmTools.runInLinuxImage img # < - does not work > > 2016-07-16 15:39 GMT+02:00 Maarten Hoogendoorn : > >> Hi there, >> >> I'm trying to run some tests on a binary program on ubuntu 1204 using >> vmTools.runInLinuxImage. It just blocks on getrandom(). >> >> I've created a minimal reproducible example: >> >> with import {}; with pkgs; >> let >> script = '' >># /dev/urandom works fine >>dd if=/dev/urandom of=/dev/null bs=1M count=1 >> >> # /dev/random does not work! >>${pkgs.strace}/bin/strace \ >> dd if=/dev/random of=/dev/null bs=1M count=1 >> ''; >> img = runCommand "nix-binary-tarball-test" { >> diskImage = vmTools.diskImages.ubuntu1204x86_64; >> #QEMU_OPTS = "-device virtio-rng-pci"; >>} script; >> in >> vmTools.runInLinuxImage img >> >> I read somewhere that adding a virtio-rng-pci device could solve this, >> but it made no difference. >> >> Could someone confirm this behavior? And maybe one of you has an idea on >> how to fix this. >> > > > ___ > nix-dev mailing list > nix-dev@lists.science.uu.nl > http://lists.science.uu.nl/mailman/listinfo/nix-dev > > ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] vmTools.runInLinuxImage with ubuntu 1204 image blocks on getrandom()
OK, fixed this problem by adding the virtio_rng device to the kernel and qemu opts, see below. Would a PR to make these additions the default in build-support/vm/default.nix be appreciated? with import {}; with pkgs; let script = '' # /dev/urandom works fine dd if=/dev/urandom of=/dev/null bs=1M count=1 # /dev/random only works if virtio_rng is enabled. dd if=/dev/random of=/dev/null bs=1M count=1 ''; img = runCommand "nix-binary-tarball-test" { diskImage = vmTools.diskImages.ubuntu1204x86_64; QEMU_OPTS = "-device virtio-rng-pci"; } script; runCustomInImage = vmTools.override { rootModules = [ "virtio_rng" "virtio_pci" "virtio_blk" "virtio_balloon" "ext4" "unix" "9p" "9pnet_virtio" "rtc_cmos" ]; }; in runCustomInImage.runInLinuxImage img #<- does work # vmTools.runInLinuxImage img # < - does not work 2016-07-16 15:39 GMT+02:00 Maarten Hoogendoorn: > Hi there, > > I'm trying to run some tests on a binary program on ubuntu 1204 using > vmTools.runInLinuxImage. It just blocks on getrandom(). > > I've created a minimal reproducible example: > > with import {}; with pkgs; > let > script = '' ># /dev/urandom works fine >dd if=/dev/urandom of=/dev/null bs=1M count=1 > > # /dev/random does not work! >${pkgs.strace}/bin/strace \ > dd if=/dev/random of=/dev/null bs=1M count=1 > ''; > img = runCommand "nix-binary-tarball-test" { > diskImage = vmTools.diskImages.ubuntu1204x86_64; > #QEMU_OPTS = "-device virtio-rng-pci"; >} script; > in > vmTools.runInLinuxImage img > > I read somewhere that adding a virtio-rng-pci device could solve this, > but it made no difference. > > Could someone confirm this behavior? And maybe one of you has an idea on > how to fix this. > ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] vmTools.runInLinuxImage with ubuntu 1204 image blocks on getrandom()
2016-07-16 15:39 GMT+02:00 Maarten Hoogendoorn: > Could someone confirm this behavior? And maybe one of you has an idea on how to fix this. I can confirm the behaviour (and that adding the virtio device makes no difference), but cannot solve it :) ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] vmTools.runInLinuxImage with ubuntu 1204 image blocks on getrandom()
Hi there, I'm trying to run some tests on a binary program on ubuntu 1204 using vmTools.runInLinuxImage. It just blocks on getrandom(). I've created a minimal reproducible example: with import {}; with pkgs; let script = '' # /dev/urandom works fine dd if=/dev/urandom of=/dev/null bs=1M count=1 # /dev/random does not work! ${pkgs.strace}/bin/strace \ dd if=/dev/random of=/dev/null bs=1M count=1 ''; img = runCommand "nix-binary-tarball-test" { diskImage = vmTools.diskImages.ubuntu1204x86_64; #QEMU_OPTS = "-device virtio-rng-pci"; } script; in vmTools.runInLinuxImage img I read somewhere that adding a virtio-rng-pci device could solve this, but it made no difference. Could someone confirm this behavior? And maybe one of you has an idea on how to fix this. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev