unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23838: Guix on Debian 8.3 'guix system vm ...' -> "ERROR: qemu failed "qemu-system-x86_64"
@ 2016-06-24 13:53 myglc2
  2016-06-24 14:47 ` Leo Famulari
  2016-06-24 15:52 ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: myglc2 @ 2016-06-24 13:53 UTC (permalink / raw)
  To: 23838

[-- Attachment #1: Type: text/plain, Size: 3726 bytes --]


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


[-- Attachment #2: c01glc.scm --]
[-- Type: application/octet-stream, Size: 188 bytes --]

(use-package-modules
 ghostscript ;; gs-fonts
 fonts ;; font-dejavu font-gnu-freefont-ttf
 base
 ) 
(packages->manifest
 (list
  gs-fonts font-dejavu font-gnu-freefont-ttf
  gnu-make
  ))

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23838: Guix on Debian 8.3 'guix system vm ...' -> "ERROR: qemu failed "qemu-system-x86_64"
  2016-06-24 13:53 bug#23838: Guix on Debian 8.3 'guix system vm ...' -> "ERROR: qemu failed "qemu-system-x86_64" myglc2
@ 2016-06-24 14:47 ` Leo Famulari
  2016-06-24 15:52 ` Ludovic Courtès
  1 sibling, 0 replies; 6+ messages in thread
From: Leo Famulari @ 2016-06-24 14:47 UTC (permalink / raw)
  To: myglc2; +Cc: 23838

On Fri, Jun 24, 2016 at 09:53:12AM -0400, myglc2 wrote:
> g1@e3b:~/dev/vms$ guix system vm ../configs/c01system.scm --expose=$HOME --share=$HOME/tmp=/exchange --verbosity=1

[...]

> Could not access KVM kernel module: Permission denied
> failed to initialize KVM: Permission denied

On Debian, /dev/kvm is by default not accessible to unprivileged users.
I manually do `chmod 666 /dev/kvm` when I need to use QEMU with KVM,
after each reboot.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23838: Guix on Debian 8.3 'guix system vm ...' -> "ERROR: qemu failed "qemu-system-x86_64"
  2016-06-24 13:53 bug#23838: Guix on Debian 8.3 'guix system vm ...' -> "ERROR: qemu failed "qemu-system-x86_64" myglc2
  2016-06-24 14:47 ` Leo Famulari
@ 2016-06-24 15:52 ` Ludovic Courtès
  2016-06-24 19:34   ` myglc2
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2016-06-24 15:52 UTC (permalink / raw)
  To: myglc2; +Cc: 23838

Hi!

myglc2 <myglc2@gmail.com> skribis:

> 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

Please make sure the guixbuild* user accounts have write permission for
/dev/kvm.

Usually, /dev/kvm is has “kvm” as its group and is group-writable.  So
all you need is to add the guixbuild* users to the “kvm” group.

The manual mentions this pitfall (info "(guix) Invoking guix system")
but I guess it’s easily missed.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23838: Guix on Debian 8.3 'guix system vm ...' -> "ERROR: qemu failed "qemu-system-x86_64"
  2016-06-24 15:52 ` Ludovic Courtès
@ 2016-06-24 19:34   ` myglc2
  2016-06-24 22:15     ` myglc2
  2016-06-26 10:20     ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: myglc2 @ 2016-06-24 19:34 UTC (permalink / raw)
  To: 23838

ludo@gnu.org (Ludovic Courtès) writes:
>
> Usually, /dev/kvm is has “kvm” as its group and is group-writable.  So
> all you need is to add the guixbuild* users to the “kvm” group.

Thank you, it does.

> The manual mentions this pitfall (info "(guix) Invoking guix system")
> but I guess it’s easily missed.

Thank you, so I did this ...

adduser guixbuilder1 kvm
adduser guixbuilder2 kvm
adduser guixbuilder3 kvm
adduser guixbuilder4 kvm
adduser guixbuilder5 kvm
adduser guixbuilder6 kvm
adduser guixbuilder7 kvm
adduser guixbuilder8 kvm

... but maybe the manual should say this ...

# 2.4.1 Build Environment Setup
# -----------------------------
# [...]   
# On a GNU/Linux system, a build user pool may be created like this
# (using Bash syntax and the ‘shadow’ commands):
#
#      # groupadd --system guixbuild
#      # for i in `seq -w 1 10`;
#        do
#          useradd -g guixbuild -G guixbuild,kvm       \
#                  -d /var/empty -s `which nologin`    \
#                  -c "Guix build user $i" --system    \
#                  guixbuilder$i;
#        done

... anyway, now I get ...

g1@e3b:~/dev/vms$ guix system vm ../configs/c01system.scm --expose=$HOME --share=$HOME/tmp=/exchange --verbosity=1
substitute: warning: failed to install locale: Invalid argument
/gnu/store/7rv558c43bwnmmkc85izv1b69ards5qy-run-vm.sh
g1@e3b:~/dev/vms$ /gnu/store/7rv558c43bwnmmkc85izv1b69ards5qy-run-vm.sh
qemu-system-x86_64: -virtfs local,path=/home/g1/tmp,security_model=none,mount_tag=TAG_home_g1_tmp: 9pfs Failed to initialize fs-driver with id:TAG_home_g1_tmp and export path:/home/g1/tmp
g1@e3b:~/dev/vms$

TIA, George

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23838: Guix on Debian 8.3 'guix system vm ...' -> "ERROR: qemu failed "qemu-system-x86_64"
  2016-06-24 19:34   ` myglc2
@ 2016-06-24 22:15     ` myglc2
  2016-06-26 10:20     ` Ludovic Courtès
  1 sibling, 0 replies; 6+ messages in thread
From: myglc2 @ 2016-06-24 22:15 UTC (permalink / raw)
  To: 23838

myglc2 <myglc2@gmail.com> writes:

> ludo@gnu.org (Ludovic Courtès) writes:
>>
>> Usually, /dev/kvm is has “kvm” as its group and is group-writable.  So
>> all you need is to add the guixbuild* users to the “kvm” group.
>
> Thank you, so I did this ...
>
> adduser guixbuilder1 kvm
...
>
> ... anyway, now I get ...
>
> g1@e3b:~/dev/vms$ guix system vm ../configs/c01system.scm --expose=$HOME --share=$HOME/tmp=/exchange --verbosity=1
> substitute: warning: failed to install locale: Invalid argument
> /gnu/store/7rv558c43bwnmmkc85izv1b69ards5qy-run-vm.sh
> g1@e3b:~/dev/vms$ /gnu/store/7rv558c43bwnmmkc85izv1b69ards5qy-run-vm.sh
> qemu-system-x86_64: -virtfs local,path=/home/g1/tmp,security_model=none,mount_tag=TAG_home_g1_tmp: 9pfs Failed to initialize fs-driver with id:TAG_home_g1_tmp and export path:/home/g1/tmp
> g1@e3b:~/dev/vms$

OOH! DUH! Nevermind ...

mkdir /home/g1/tmp

... fixes this.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#23838: Guix on Debian 8.3 'guix system vm ...' -> "ERROR: qemu failed "qemu-system-x86_64"
  2016-06-24 19:34   ` myglc2
  2016-06-24 22:15     ` myglc2
@ 2016-06-26 10:20     ` Ludovic Courtès
  1 sibling, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2016-06-26 10:20 UTC (permalink / raw)
  To: myglc2; +Cc: 23838

myglc2 <myglc2@gmail.com> skribis:

> ... but maybe the manual should say this ...
>
> # 2.4.1 Build Environment Setup
> # -----------------------------
> # [...]   
> # On a GNU/Linux system, a build user pool may be created like this
> # (using Bash syntax and the ‘shadow’ commands):
> #
> #      # groupadd --system guixbuild
> #      # for i in `seq -w 1 10`;
> #        do
> #          useradd -g guixbuild -G guixbuild,kvm       \
> #                  -d /var/empty -s `which nologin`    \
> #                  -c "Guix build user $i" --system    \
> #                  guixbuilder$i;
> #        done

I’ve added something along these lines, thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-06-26 10:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-24 13:53 bug#23838: Guix on Debian 8.3 'guix system vm ...' -> "ERROR: qemu failed "qemu-system-x86_64" myglc2
2016-06-24 14:47 ` Leo Famulari
2016-06-24 15:52 ` Ludovic Courtès
2016-06-24 19:34   ` myglc2
2016-06-24 22:15     ` myglc2
2016-06-26 10:20     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).