crosvm+ubuntu with GUI support failed using virglrenderer

404 views
Skip to first unread message

Shirley Zhao

unread,
Oct 11, 2022, 4:52:16 AM10/11/22
to crosvm-dev
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 

Daniel Verkamp

unread,
Oct 12, 2022, 2:21:08 PM10/12/22
to Shirley Zhao, crosvm-dev
Hi Shirley,

The arg parsing failure is related to the --gpu option (not --x-display); --gpu now requires at least one argument, `backend`, and since it has no arguments specified, the next thing in the list (--x-display) is being treated as that argument.

You should be able to use --gpu backend=2d --x-display :0 etc.

Thanks,
-- Daniel

--
You received this message because you are subscribed to the Google Groups "crosvm-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crosvm-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/crosvm-dev/2a7ac724-c8d6-45f2-83af-ae2ac1e6daean%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Shashank Dangi

unread,
Nov 2, 2023, 5:49:07 AM11/2/23
to crosvm-dev, Daniel Verkamp, crosvm-dev, Shirley Zhao
Hi ,
I am running crosvm on aws graviton(arm64) . If I run simple examples of crosvm I am able to boot the vm's . when I want graphics or when I try to run desktop example in /tools/example/example_desktop I am getting this error.


     Running `/home/ubuntu/shashank/crosvm/target/debug/crosvm run --cpus 4 --mem 4096 --gpu backend=virglrenderer,width=1920,height=1080 --display-window-keyboard --display-window-mouse --net tap-name=crosvm_tap --rwdisk ./rootfs --initrd ./initrd.img-5.4.0-65-generic -p root=/dev/vda5 ./vmlinuz-5.4.0-65-generic`
[2023-11-02T09:40:42.814839178+00:00 INFO  crosvm] crosvm started.
[2023-11-02T09:40:42.815705471+00:00 INFO  crosvm] CLI arguments parsed.
[2023-11-02T09:40:42.851505700+00:00 INFO  crosvm::crosvm::sys::unix] crosvm entering multiprocess mode
[2023-11-02T09:40:42.852051954+00:00 INFO  crosvm::crosvm::sys::unix::device_helpers] Trying to attach block device: ./rootfs
[2023-11-02T09:40:42.852107962+00:00 INFO  disk] disk size 6442450944,
[2023-11-02T09:40:42.852138791+00:00 INFO  disk] Disk image file is hosted on file system type ef53
[2023-11-02T09:40:43.167136502+00:00 ERROR crosvm] exiting with error 1: the architecture failed to build the vm

Caused by:
    failed to create a PCI root hub: failed to create proxy device: Failed to configure tube: failed to receive packet: Connection reset by peer (os error 104)

Vikram Auradkar

unread,
Nov 2, 2023, 10:17:51 AM11/2/23
to Shashank Dangi, crosvm-dev, Daniel Verkamp, Shirley Zhao
Hi Shahank,

I can reproduce the failure "[2023-11-02T09:40:43.167136502+00:00 ERROR crosvm] exiting with error 1: the architecture failed to build the vm". A simple workaround is to disable the sandbox by passing "--disable-sandbox" - patch here. (Haven't tried yet the other issues you mentioned.) Let me know with that patch the example_desktop works.

Thanks,
Vikram

Reply all
Reply to author
Forward
0 new messages