talex5 / wayland-proxy-virtwl

Allow guest VMs to open windows on the host
Apache License 2.0
111 stars 12 forks source link

No keymap and *ERROR* response 0x1200 (command 0x208) #37

Open talex5 opened 2 years ago

talex5 commented 2 years ago

After upgrading to NixOS 22.05, crosvm often logs messages like this:

[drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (command 0x208)
[drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (command 0x208)
[drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (command 0x209)
[drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (command 0x209)

Also, keymaps don't work (seems to have reverted to a US layout, where e.g. £ doesn't work).

Setting the GUI jail to None and adding logging shows:

[INFO:devices/src/virtio/gpu/mod.rs:622] ResourceMapBlob
[ERROR:vm_control/src/lib.rs:914] register_memory:SystemCallFailed: Permission denied (os error 13)
[WARNING:devices/src/virtio/gpu/virtio_gpu.rs:752] RegisterMemory failed base: Error(13)
[DEBUG:devices/src/virtio/gpu/mod.rs:702] Some(ResourceMapBlob) -> ErrBase(Error(13))
[drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (command 0x208)

This is because Sway now passes a read-only FD for the keymap (https://github.com/swaywm/wlroots/pull/3092), but crosvm tries to mmap it as read-write, which then fails.

talex5 commented 2 years ago

Here's a hacky patch to make crosvm try a read-only map if a read-write one fails: https://github.com/talex5/nixpkgs/commit/121dbc90d0d516e71ebdac56cbff3e74761381ef

With that, it works.