Anyone got WayDroid or Genymotion working

Maybe I’m just dumb but I can’t seem to get any Android emulator to work.
Running Sway in Wayland on unstable nixos.

I’ve followed the Wiki for Waydroid. I can get all the way to $ waydroid show-full-ui and I get no UI. I don’t get anything in the logs either.
Anyone?

Then for Genymotion. It uses QEMU which I already have installed, with a few VMs.
I try to run a test Genymotion Android VM and it complains about QEMU already being used and unable to start the VM. wtf?
Any clues from anyone using this on QEMU?

Very frustrated at the moment. Any help would be greatly appreciated

2 Likes

I’ve gotten it working, although to be honest, I have no idea how. I remember it being a pain, but I can’t piece together exactly what I did. I am also on Sway and unstable NixOS.

My only explicitly Waydroid related configuration is:

virtualisation.waydroid.enable = true;

Searching my shell history for waydroid, I see the following commands:

 3126  sudo waydroid init -s GAPPS -f
 3127  waydroid show-full-ui
 3128  waydroid prop set persist.waydroid.multi_windows true
 3129  waydroid session start
 3130  waydroid app launch "Google Play Store"
 3131  waydroid app list
 3132  waydroid app launch com.android.vending
 3133  waydroid session stop
 3134  sudo waydroid-extras -a 11 certified
 3135  waydroid-extras
 3650  sudo waydroid shell
 3651  waydroid --help
 3652  waydroid status
 3653  sudo systemctl restart waydroid-container.service
 3654  waydroid app
 3655  waydroid app -h
 3656  waydroid app install
 3657  waydroid show-full-ui

Doesn’t lend many hints unfortunately. When you say you get “no UI”, do you mean the command hangs and there’s no window? Is there a window, but it is black?

Re: Genymotion, I don’t believe Waydroid uses QEMU, so I can’t imagine it is related to this too much, but I could be wrong. Can you maybe get a screenshot or copy of the actual full error? Maybe there’s a hint hidden in there somewhere. I believe Genymotion will want to use KVM in particular, so you may need to make sure hardware virtualization extensions are enabled in your machine’s firmware.

P.S.: If you are using Virtualbox, this may prevent QEMU-KVM based virtualization software from working. If you want to be able to use both simultaneously, you might be interested in the virtualisation.virtualbox.host.enableKvm option, which enables a (somewhat experimental) Virtualbox patch to use KVM instead of Virtualbox’s own virtualization kernel extensions. (You may need to reboot after turning this option on, though.)

Thanks so very much for your reply @jchw

Is there a window, but it is black?

Yeah that’s exactly what’s happening. When I run the waydroid show-full-ui I’ve presented with a black box fulled with nothing. Kinda weird.

For the Virtualbox side, I’ll check out virtualisation.virtualbox.host.enableKvm and see if that works in some way. thanks for that tip

Very strange.

My first thought is that Waydroid is very odd with how the windowing works. I am pretty sure at least by default with show-full-ui it’s actually meant to take up the whole screen. Maybe you can try fullscreening that surface with $mod+f or whichever bindsym you might have for the fullscreen command? I wonder if it’s possible there’s some Android message box on a black background that’s just out of view, or something like that.

(You may indeed find a traditional Android emulator like Genymotion is indeed better for your purposes, though there are some ways to change the way Waydroid behaves/integrates. Hopefully we can get both of them to work.)

@jchw Well, I’ve got Virtbox running but Genymotion looks to fail to start because it can’t connect to a host-only network.
Trying to add one inside Virtualbox then gives a NS_ERROR_FAILURE (0X80004005)
So currently stuck between virtualbox and getting Genymotion to connect to it.

Error - VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory.

Have you had Genymotion running with the virtualisation.virtualbox.host.enableKvm option yourself?

.......
2024-04-30T09:29:48+07:00 [Genymotion:43501] [debug] [VMTools] Loading "virtualbox" plugin
2024-04-30T09:29:48+07:00 [Genymotion:43501] [debug] [VMTools] Constructing engine
2024-04-30T09:29:48+07:00 [Genymotion:43501] [debug] [VMTools] Chipset: "GenuineIntel"
2024-04-30T09:29:48+07:00 [Genymotion:43501] [debug] [VMTools] CPUID 0x1 (Intel): ECX= "7ffafbff"
2024-04-30T09:29:48+07:00 [Genymotion:43501] [debug] [VMTools] Path: "/run/current-system/sw/bin/VBoxManage"
2024-04-30T09:29:48+07:00 [Genymotion:43501] [debug] [VMTools] Initializing engine
2024-04-30T09:29:48+07:00 [Genymotion:43501] [debug] [VMTools] Call: ("--version")
2024-04-30T09:29:48+07:00 [Genymotion:43501] [debug] [VMTools] Return code: 0
2024-04-30T09:29:48+07:00 [Genymotion:43501] [debug] [VMTools] get "" from virtualbox.host_only_interface_name
2024-04-30T09:29:48+07:00 [Genymotion:43501] [debug] [VMTools] [findHostOnlyInterface] Looking for compatible host-only interface
2024-04-30T09:29:48+07:00 [Genymotion:43501] [debug] [VMTools] Call: ("list", "hostonlyifs")
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [VMTools] Return code: 0
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [VMTools] Empty interface name
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [VMTools] Creating new host-only interface
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [VMTools] Call: ("hostonlyif", "create")
2024-04-30T09:29:49+07:00 [Genymotion:43501] [critical] [VMTools] Return code: 1
2024-04-30T09:29:49+07:00 [Genymotion:43501] [critical] [VMTools] Output command: "0%...NS_ERROR_FAILURE\nVBoxManage: error: Failed to create the host-only adapter\nVBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory\nVBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface\nVBoxManage: error: Context: \"RTEXITCODE handleCreate(HandlerArg*)\" at line 105 of file VBoxManageHostonly.cpp"
2024-04-30T09:29:49+07:00 [Genymotion:43501] [warning] [VMTools] 1 "0%...NS_ERROR_FAILURE\nVBoxManage: error: Failed to create the host-only adapter\nVBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory\nVBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface\nVBoxManage: error: Context: \"RTEXITCODE handleCreate(HandlerArg*)\" at line 105 of file VBoxManageHostonly.cpp\n" ""
2024-04-30T09:29:49+07:00 [Genymotion:43501] [critical] [VMTools] Failed to create interface
2024-04-30T09:29:49+07:00 [Genymotion:43501] [critical] [VMTools] Unable to initialize engine from "virtualbox"
2024-04-30T09:29:49+07:00 [Genymotion:43501] [critical] "Loading VM Engine failed: state=2"
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] Generate all logs
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] VM engine not available
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Creating temporary folder: "/tmp/genymotion-logs-tmp"
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Running "/nix/store/w6q60afgvllgjh7l815kiicpqw0ib6qk-genymotion-3.6.0/libexec/genymotion/tools/glewinfo" with args ()
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Running "lsmod" with args ()
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Running "lspci" with args ()
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Running "ip" with args ("rule")
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Running "ip" with args ("route")
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Running "free" with args ()
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Running "ps" with args ("afx")
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Running "df" with args ("-kh")
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Running "dmesg" with args ()
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Running "cat" with args ("/proc/cpuinfo")
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Copying file "/home/martin/.Genymobile/genymotion.log" to "/tmp/genymotion-logs-tmp/general-genymotion.log"
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] [LogCollector] Removing temporary folder: "/tmp/genymotion-logs-tmp"
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] "User martin@cooney.com.au logged on Hub"
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] POST "https://cloud.genymotion.com/licenses/activation/"
2024-04-30T09:29:49+07:00 [Genymotion:43501] [warning] HTTP response is an error
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] HTTP status code: 429, from cache: 0
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] HTTP headers:
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - Date: Tue, 30 Apr 2024 02:29:49 GMT
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - Content-Type: text/plain; charset=UTF-8
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - Content-Length: 16
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - Connection: close
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - Retry-After: 30832
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - X-Frame-Options: SAMEORIGIN
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - Referrer-Policy: same-origin
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - Cache-Control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - Expires: Thu, 01 Jan 1970 00:00:01 GMT
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - Vary: Accept-Encoding
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - Server: cloudflare
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] - CF-RAY: 87c41b391c7945b9-BKK
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] HTTP content (first 127 bytes): error code: 1015
2024-04-30T09:29:49+07:00 [Genymotion:43501] [warning] [tokenError] AbstractAuthService::Error::TooManyRequests "Error transferring https://cloud.genymotion.com/licenses/activation/ - server replied: Too Many Requests. "
2024-04-30T09:29:49+07:00 [Genymotion:43501] [warning] License validity reaches the minimum acceptable value.
2024-04-30T09:29:49+07:00 [Genymotion:43501] [debug] GET "https://cloud.genymotion.com/launchpad/last_version/linux/x64/"
2024-04-30T09:29:50+07:00 [Genymotion:43501] [debug] Genymotion is up-to-date
2024-04-30T09:31:23+07:00 [Genymotion:43501] [debug] ==== STOPPING GENYMOTION ====
2024-04-30T09:31:23+07:00 [Genymotion:43501] [debug] Exit status: 3 Launchpad::ExitCode::VM_ENGINE_ERROR

Sorry to say that I have no recent experience with Genymotion (I don’t have an account…) and I may have led you astray here. I have used Virtualbox KVM with success on its own, not with Genymotion, but unfortunately I did indeed miss that it seems like creating a host-only network is broken; I just filed an upstream issue that will hopefully clarify things. It’s definitely an issue in the Virtualbox KVM patches, not your fault.

To be honest, I actually wasn’t even meaning to suggest using Virtualbox-KVM with Genymotion. I was guessing that you may be running Virtualbox, because running Virtualbox (even just having its kernel modules loaded on your machine) would be one reason why QEMU+KVM would fail to initialize, and in that case, using Virtualbox-KVM instead of regular Virtualbox would’ve allowed both of them to run at the same time with no conflict. If you were running Virtualbox, and now you are able to use Virtualbox-KVM, you can try to use QEMU+KVM with Genymotion again; QEMU+KVM should co-exist on the same machine as Virutalbox-KVM. On the other hand, if you haven’t tried running Genymotion with normal Virtualbox (that is, with enableKvm unset) that would be worth a try, too.

Sorry this has been so frustrating.

If you have the patience to spare, please feel free to dump the exact errors you get when trying to use Qemu as well, or if you happen to try it, regular Virtualbox. Even though I don’t really have much recent experience with Genymotion, I remain optimistic that we could get this working.

@jchw Maybe I wasn’t as clear as I should have been in the OP.

I’d much rather use Genymotion.
I also use QEMU for other VMs such as Windows etc.

Since Genymotion ships with it’s own built-in QEMU, that conflicts with another QEMU installation and any Genymotion VMs can not start.

That leaves the Genymotion VirtualBox Hypervisor as the remaining option.

And that doesn’t work (at least for me) since Virtualbox running under KVM doesn’t allow host-only networking which is required by Genymotion.

I notice at GitHub - cyberus-technology/virtualbox-kvm: KVM Backend for VirtualBox. With our current development model, we cannot easily accept pull requests here. If you'd like to contribute, feel free to reach out to us, we are happy to find a solution. under Network that they mention More complex setups will need manual configuration, e.g., using tun/tap devices.

Is tun/tap devices something that is related to configuring host-only networking or is that just wishful thinking on my part?

That’s strange, I would not have expected an embedded QEMU to have any issues with another copy of QEMU. Are you sure that is what the error is actually saying? It’s not that I don’t believe you, just curious about why exactly it doesn’t work.

I’m hoping to get an answer by reaching out. I tried digging through Virtualbox code but it’s pretty impenetrable.

geny-qemu

I would have thought that too.
I would have thought the program would have detected QEMU running and used it’s resources but, alas, no

I wonder what it means by “the same resources”. I can’t find another single reference to the exact phrase “Another QEMU process appears to be using the same resources” across the entire Internet, which is somewhat surprising.

Unfortunately I’m not really sure where to go from here. I think I need to set up a Genymotion account to see if I can figure anything else out. I’m also running QEMU+KVM virtual machines in the background with libvirt, so if there is any conflict it ought to hit me, too, and maybe I can figure out what resource it’s talking about.

@jchw Yeah I did the same search a few times. Nothing found which is bizarre.
I would have thought it commonplace for QEMU to already be installed on a developers machine prior to getting to Genymotion.

Why it doesn’t play nice in this situation is beyond. I don’t rule out the nix package has issues either but the few people I know that have tried Genymotion have given up with a shrug.

If you can figure out then you get this week’s ‘Nix Hero Award’ :slight_smile:

I have encountered the same Another QEMU process appears to be using the same resources, please stop it and retry. I’m running into this on X11. What’s strange is that I’m able to run other virtual machines just fine on VirtualBox. So it might not be a Wayland thing.

I’ve added a bug report for this Genymotion - does not work with QEMU · Issue #308396 · NixOS/nixpkgs · GitHub

Waydroid works for me. I usually use it to run Android apps from my laptop/computer.

After installing in Nix, there’s a series of things you have to do to set it up:

@ccyanide @jchw
a colleague helped with this and made a flake from a github work-around
You can find it and instructions at GitHub - fillon/nix-genymotion: Genymotion

Works great and Genymotion QEMU is working great for me now.
Hope it helps you and others and that the broken package eventually gets fixed.

2 Likes

I’m glad to hear. Sorry I couldn’t get to this sooner, it was coming up on my TODO list to give it a go myself. I’ll take a look at that and hopefully we can figure out a way to get this fixed in Nixpkgs.

1 Like