Skip to content

Confusing permission errors really implicate udev issues with /dev/kvm #2

Open
@nealmcb

Description

@nealmcb

Thanks for making it easier to run fushcia!

I was puzzled by a variety of confusing kvm permission errors trying to get configured on Ubuntu 18.04. E.g.

$ ./fimage-headless 2048
...
cannot add library /home/usr/fuchsia/fimage-210528/linux-x64/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
added library /home/usr/fuchsia/fimage-210528/linux-x64/lib64/vulkan/libvulkan.so
cannot add library /home/usr/fuchsia/fimage-210528/linux-x64/lib64/vulkan/libvulkan.so.1: full
Could not access KVM kernel module: Permission denied
qemu-system-x86_64-headless: failed to initialize KVM: Permission denied
./fimage-headless: line 2: 27139 User defined signal 1   linux-x64/emulator -feature VirtioInput,GLDirectMem,VirtioMouse,KVM,Vulkan -window-size 1280x800 -gpu swiftshader_indirect -no-location-ui -no-window -no-hidpi-scaling -fuchsia -kernel default/multiboot.bin -initrd init/fuchsia-ssh.zbi -m $1 -serial stdio -vga none -device virtio-keyboard-pci -smp 4 -device virtio-mouse-pci -machine q35 -device isa-debug-exit,iobase=0xf4,iosize=0x04 -enable-kvm -cpu host,migratable=no,+invtsc -netdev type=tap,ifname=qemu,id=net0,script=scripts/start-unsecure-internet.sh,downscript=no -device virtio-net-pci,vectors=8,netdev=net0,mac=52:54:00:63:5e:7a -drive file=init/fvm_raw.blk,format=raw,if=none,id=vdisk -device virtio-blk-pci,drive=vdisk -append 'TERM=xterm-256color zircon.nodename=fuchsia_fimage kernel.serial=legacy kernel.entropy-mixin=ec98e395c5dd4771931a91dfe7e044a651c3b8b0be2828c8bf6544d151f62e2f kernel.halt-on-panic=false '

I had my account properly set up for kvm, since it tells me that the KVM line in /etc/group should end with ":" followed by your username. and that's true...

That file /home/usr/fuchsia/fimage-210528/linux-x64/lib64/vulkan/libvulkan.so.1 exists, but I don't know what full means in that context and don't see good tips on the web.

That problem turned out to be incorrect permissions on /dev/kvm itself. But note you can't just change the permissions with chmod. You need to configure udev, as described concisely in Gerd's answer at Android Studio: /dev/kvm device permission denied.

Since the error is misleading, it would help to have the shell scripts check for that explicitly and give better hints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions