Subject: Guix on Debian 8.3 'guix system vm ...' -> "ERROR: qemu failed "qemu-system-x86_64"

From: myglc2 <[email-masked]>
Date: Fri, 24 Jun 2016 09:53:12 -0400

Apologies in advance if I missed a required step & this is operator
error as it is my first attempt to use QEMU/Debian.

Running Guix on Debian 8.3, I set up qemu like this ...

su
apt-get update
apt-get upgrade
apt-get install qemu
apt-get install qemu-kvm
apt-get install libvirt-bin
adduser g1 kvm
adduser g1 libvirt

... then, as user g1, I checked that virsh commands work ...

g1@e3b:~/dev/vms$ virsh list --all
 Id    Name                           State
----------------------------------------------------

g1@e3b:~/dev/vms$ virsh --connect qemu:///system list --all
 Id    Name                           State
----------------------------------------------------

g1@e3b:~/dev/vms$ virsh version --daemon
Compiled against library: libvirt 1.2.9
Using library: libvirt 1.2.9
Using API: QEMU 1.2.9
Running hypervisor: QEMU 2.1.2
Running against daemon: 1.2.9

... then, using this version of guix ...

git branch -av | grep '* master'
* master                                  bae0636 bournish: Add 'wc' command.
g1@e3b:~/dev/guix$ stat /home/g1/.config/guix/latest | grep File:
  File: ‘/home/g1/.config/guix/latest’ -> ‘../../dev/guix’

... I tried making a guix vm ...

g1@e3b:~/dev/vms$ guix system vm ../configs/c01system.scm --expose=$HOME --share=$HOME/tmp=/exchange --verbosity=1
;;; note: source file /home/g1/.config/guix/latest/gnu/packages/screen.scm
;;;       newer than compiled /home/g1/.config/guix/latest/gnu/packages/screen.go
;;; compiling /home/g1/.config/guix/latest/gnu/packages/screen.scm
;;; compiled /home/g1/.cache/guile/ccache/2.0-LE-8-2.0/home/g1/dev/guix/gnu/packages/screen.scm.go
substitute: warning: failed to install locale: Invalid argument
substitute: updating list of substitutes from 'http://hydra.gnu.org'... 100.0%
The following derivations will be built:
   /gnu/store/jz6mlhlz7f5sp4g93spac69bxfjpjbqg-run-vm.sh.drv
   /gnu/store/5f6zfsx0fa0bzkl4ynqb1lf5pk3m4rfs-qemu-image.drv
warning: failed to install locale: Invalid argument
building path(s) `/gnu/store/nbppjjb2kkb17nr8jqas7hchkg669nv9-qemu-image'
Formatting 'image.qcow2', fmt=qcow2 size=31457280 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
Could not access KVM kernel module: Permission denied
failed to initialize KVM: Permission denied
Backtrace:
In ice-9/boot-9.scm:
 157: 10 [catch #t #<catch-closure 8c9720> ...]
In unknown file:
   ?: 9 [apply-smob/1 #<catch-closure 8c9720>]
In ice-9/boot-9.scm:
  63: 8 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 7 [eval # #]
In ice-9/boot-9.scm:
2401: 6 [save-module-excursion #<procedure 8e6800 at ice-9/boot-9.scm:4045:3 ()>]
4050: 5 [#<procedure 8e6800 at ice-9/boot-9.scm:4045:3 ()>]
1724: 4 [%start-stack load-stack #<procedure 8f97c0 at ice-9/boot-9.scm:4041:10 ()>]
1729: 3 [#<procedure 8fb9c0 ()>]
In unknown file:
   ?: 2 [primitive-load "/gnu/store/kfakhvdns3vjpivw6pk0bkdqafywr9s9-qemu-image-builder"]
In ./gnu/build/vm.scm:
 127: 1 [load-in-linux-vm "/gnu/store/9yprr0vmwnpvlkr2a0jgylpf9py6cf83-linux-vm-loader" ...]
In unknown file:
   ?: 0 [scm-error misc-error #f "~A ~S" ("qemu failed" "qemu-system-x86_64") #f]

ERROR: In procedure scm-error:
ERROR: qemu failed "qemu-system-x86_64"
environment variable `PATH' set to `/gnu/store/nk0z0qs8g3i03jfyi6hr2rwnd9pg2qnv-qemu-minimal-2.6.0/bin:/gnu/store/34j2zmi69mqwrslpyizbi9mcxmn2hzgb-coreutils-8.24/bin'
builder for `/gnu/store/5f6zfsx0fa0bzkl4ynqb1lf5pk3m4rfs-qemu-image.drv' failed with exit code 1
cannot build derivation `/gnu/store/jz6mlhlz7f5sp4g93spac69bxfjpjbqg-run-vm.sh.drv': 1 dependencies couldn't be built
guix system: error: build failed: build of `/gnu/store/jz6mlhlz7f5sp4g93spac69bxfjpjbqg-run-vm.sh.drv' failed
g1@e3b:~/dev/vms$

tia, - George