Hi, all,
I met the following issue to use crosvm boot Ubuntu with GUI.
The following steps works on crosvm of a very old version, but failed the newest main branch.
1. Build crosvm with virglrenderer enabled
cargo build --features=gpu,x,virgl_renderer_next
2. Using virglrenderer to boot Ubuntu
sudo ./target/debug/crosvm run --cpus 4 --mem 4096 --disable-sandbox --gpu --x-display :0 --gpu backend=virglrenderer,width=1920,height=1080 --display-window-keyboard --display-window-mouse --host-ip 192.168.0.1 --netmask 255.255.255.0 --mac AA:BB:CC:00:00:01 --rwdisk ubuntu.img -p "root=/dev/vda5" vmlinux
It resulted in the error as below:
[2022-10-11T15:32:23.610227708+08:00 INFO crosvm] crosvm started.
arg parsing failed: Error parsing option '--gpu' with value '--x-display': expected an identifier at position 0
It seems the use of --x-display is changed in new version, but I don't know how to correct it. Can you help me?
3. Since --x-display can't work, we change to wayland as below:
sudo ./target/debug/crosvm run --cpus 1 --mem 3072 --disable-sandbox --host_ip 102.168.0.1 --netmask 255.255.255.0 --mac AA:BB:CC:00:00:01 --wayland-sock /run/user/1000/wayland-0 --gpu backend=virglrenderer --display-window-keyboard --display-window-mouse --rwdisk ubuntu.img -p "root=/dev/vda5" vmlinux
But the GUI is failed to start up, and there is an error message shown during boot.
[ 0.626339] Linux agpgart interface v0.103
[ 0.627720] [drm] pci: virtio-gpu-pci detected at 0000:00:04.0
[ 0.629795] [drm] Host memory window: 0x400000000 +0x200000000
[ 0.631325] [drm] features: +virgl +edid +resource_blob +host_visible
[ 0.635378] [drm] number of scanouts: 1
[ 0.636418] [drm] number of cap sets: 0
[2022-10-11T15:54:58.889270122+08:00 ERROR devices::virtio::gpu::virtio_gpu] failed to build rutabaga invalid rutabaga build parameters: virgl renderer feature not enabled
[ 5.821612] [drm] Initialized virtio_gpu 0.1.0 0 for virtio3 on minor 0
[ 5.830062] fbcon: Deferring console take-over
[ 5.830650] virtio_gpu virtio3: [drm] fb0: virtio_gpudrmfb frame buffer device
[ 5.833289] loop: module loaded
[ 5.836143] virtio_blk virtio4: [vda] 20971520 512-byte logical blocks (10.7 GB/10.0 GiB)
So what's the root cause, how to fix it?
Can you help me?
Thanks.
Shirley