I have been trying to get Cuttlefish working on Windows's Subsystem for Linux (WSL2) running Ubuntu 22.0.4.4 to emulate Android, and after rebuilding the Linux kernel to fix some vsock issues, per the recommendation of this guide https://github.com/5ec1cff/my-notes/blob/master/cuttlefish-on-wsl.md, I'm now running into an issue where after starting cuttlefish with HOME=$PWD ./bin/launch_cvd --daemon
it quickly fails, with Google's virtual machine monitor (Crosvm) unable to mount some directories:
crosvm D 06-07 10:03:32 65542 65542 log_tee.cpp:175] crosvm[1]: libminijail[1]: cannot mount '/usr/lib' as '/var/empty/usr/lib' with flags 0x1001: Invalid argument
crosvm D 06-07 10:03:32 65542 65542 log_tee.cpp:175] crosvm[1]: libminijail[1]: mount_one failed with /dev at '(null)'
The guide recommends using GDB to inspect, and the author claims that the mounting issue cleared up after some initial probing. Unfortunately, that has not been the case for me. I'm pretty inexperienced when it comes to GDB, Cuttlefish, and Android development in general, so any expertise is welcomed!
I had the same issue and just created the '/var/empty/usr/lib' path, then I created a new group (sudo groupadd yournewgroup
), added my user to that group (sudo usermod -aG yournewgroup yourusername
) and changed the group ownership of '/var/empty/usr/lib' to the new group (sudo chown root:yournewgroup /var/empty/usr/lib
). I even changed 'usr' and 'empty', but I'm not sure if that was actually needed.
This fixed the issue for me. Note that this is just a workaround, it is not the solution to the problem.