Waydroid: Difference between revisions
imported>PedroHLC Enable it through the service because of the environment; add the GApps support parameters; Teach how to know if it worked; Add GPU Adjustments |
Jackyliu16 (talk | contribs) Add suggestions about running arm in x86_64 from the web to the document |
||
(19 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
[https://waydro.id Waydroid] is an application which uses LXC containers to run Android applications on a non-Android system. | |||
{{Warning| | {{Warning|Waydroid requires a Wayland desktop session and cannot be used on X11 directly, but can be run in a nested Wayland session, using e.g. [https://www.hjdskes.nl/projects/cage cage].}} | ||
{{Warning|Installing Waydroid on your system before running nixos-generate-config will create unnecessary fstab entries that may interfere with system functionality.}} | |||
== | == Installation == | ||
Enable Waydroid in your system configuration: | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | {{file|/etc/nixos/configuration.nix|nix|<nowiki> | ||
{ | { | ||
virtualisation | virtualisation.waydroid.enable = true; | ||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
After rebuilding and switching, finish the Waydroid install in your shell. | |||
<syntaxhighlight lang="console"> | |||
Fetch Waydroid images. | |||
sudo waydroid init | You can add the parameters "-s GAPPS -f" to have GApps support. | ||
$ sudo waydroid init | |||
</syntaxhighlight> | |||
Before the following steps, you might need to do some GPU adjustments. See the troubleshooting section. | |||
== Usage == | |||
Start the container | |||
<syntaxhighlight lang="console"> | |||
Start the Waydroid LXC container | |||
$ sudo systemctl start waydroid-container | |||
You'll know it worked by checking the journal You should see "Started Waydroid Container". | |||
$ sudo journalctl -u waydroid-container | |||
Start Waydroid session | |||
You'll know it is finished when you see the message "Android with user 0 is ready". | |||
$ waydroid session start | |||
</syntaxhighlight> | |||
General usage | |||
<syntaxhighlight lang="console"> | |||
Start Android UI | |||
$ waydroid show-full-ui | |||
List Android apps | |||
$ waydroid app list | |||
Start an Android app | |||
$ waydroid app launch <application name> | |||
Install an Android app | |||
$ waydroid app install </path/to/app.apk> | |||
Enter the LXC shell | |||
$ sudo waydroid shell | |||
Overrides the full-ui width | |||
$ waydroid prop set persist.waydroid.width 608 | |||
</syntaxhighlight> | |||
== Customization == | |||
=== Running applications that differ from the current host architecture via libhoudini<ref>Need help with activating libhoudini for waydroid on NixOS | |||
https://www.reddit.com/r/NixOS/comments/15k2jxc/need_help_with_activating_libhoudini_for_waydroid/</ref> === | |||
# Add NUR to your flake or shell or something like that base on [https://github.com/nix-community/NUR readme] | |||
# Add nur.repos.ataraxiasjel.waydroid-script to your packages, if you were using nixos then set it as a item in environment.systemPackages, HM then home.packages. | |||
# Use `sudo waydroid-script` to run the script | |||
# Select Android 11 >> Install >> libhoudini, which the script only support libhoudini in this version. | |||
== Maintenance == | |||
=== Update Android === | |||
Use following command to upgrade Android (LineageOS) to a newer version if available | |||
<syntaxhighlight lang="console"> | |||
$ sudo waydroid upgrade | |||
</syntaxhighlight> | |||
=== Resetting Android Container === | |||
{{Warning|All files of your Android container will be lost}} | |||
<syntaxhighlight lang="console"> | |||
waydroid | Stop Waydroid container | ||
$ sudo systemctl stop waydroid-container | |||
Removing images and user data | |||
$sudo rm -r /var/lib/waydroid/* ~/.local/share/waydroid | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==GPU Adjustments== | == Troubleshooting == | ||
=== GPU Adjustments === | |||
In case you have an NVIDIA card or an RX 6800 series, you'll need to disable GBM and mesa-drivers: | In case you have an NVIDIA card or an RX 6800 series, you'll need to disable GBM and mesa-drivers: | ||
{{file|/var/lib/waydroid/waydroid_base.prop|prop|<nowiki> | {{file|/var/lib/waydroid/waydroid_base.prop|prop|<nowiki> | ||
Line 46: | Line 107: | ||
</nowiki>}} | </nowiki>}} | ||
== | === Linux 5.18+ === | ||
< | |||
Linux 5.18 and later removed ashmem in favor of memfd, so you may need to tell Waydroid (1.2.1 and later) to use the new module: | |||
waydroid | {{file|/var/lib/waydroid/waydroid_base.prop|prop|<nowiki> | ||
sys.use_memfd=true | |||
</nowiki>}} | |||
waydroid | === Changing keyboard layout === | ||
According to [https://github.com/waydroid/waydroid/issues/209 an upstream issue], changing the keyboard layout doesn't seem possible at the moment. | |||
=== Missing UTF-8 support === | |||
</ | |||
According to [https://github.com/waydroid/waydroid/issues/536 an upstream issue], Android might fail to display special characters correctly. | |||
=== Waydroid interferes with suspend/hybernation === | |||
According to [https://github.com/waydroid/waydroid/issues/168 an upstream issue], Waydroid might interfere with suspend or hybernation. You might have to stop the Android session and container to suspend your machine correctly. | |||
=== Clipboard sharing === | |||
Add <code>wl-clipboard</code> to <code>environment.systemPackages</code>. | |||
==See Also:== | ==See Also:== | ||
[https://wiki.archlinux.org/title/Waydroid | |||
* [https://wiki.archlinux.org/title/Waydroid Waydroid article on the Archlinux Wiki] |