Howto android on linux: Difference between revisions

From Vidalinux Wiki
Jump to navigation Jump to search
No edit summary
 
(45 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= waydroid =
= waydroid =
to run waydroid we need wayland, follow this howto:
https://wiki.vidalinux.org/index.php/Howto_wayland
install chaotic repo:
install chaotic repo:
  pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
  sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
  pacman-key --lsign-key 3056513887B78AEB
  sudo pacman-key --lsign-key 3056513887B78AEB
  pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' \
  sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' \
  'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
  'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
add the following to /etc/pacman.conf:
run the following command to add chaotic repo to /etc/pacman.conf:
cat >> /etc/pacman.conf << EOF
  [chaotic-aur]
  [chaotic-aur]
  Include = /etc/pacman.d/chaotic-mirrorlist  
  Include = /etc/pacman.d/chaotic-mirrorlist
EOF
install yay:
sudo pacman -Sy yay --noconfirm
install xanmod kernel and headers:
install xanmod kernel and headers:
  pacman -S linux-xanmod linux-xanmod-headers --noconfirm
  sudo pacman -Sy linux-xanmod linux-xanmod-headers --noconfirm
install binder_linux modules:
install binder_linux modules:
  yay -S binder_linux-dkms
  sudo pacman -S binder_linux-dkms --noconfirm
load modules:
add the following to /etc/default/grub:
  depmod -a
  #GRUB_CMDLINE_LINUX_DEFAULT="quiet ...."
  modprobe binder_linux
GRUB_CMDLINE_LINUX="psi=1"
update grub configuration:
  sudo grub-mkconfig -o /boot/grub/grub.cfg
install waydroid:
install waydroid:
  yay -S waydroid
  sudo pacman -S waydroid python-pyclip wl-clipboard --noconfirm
configure waydroid:
reboot the system and boot with xanmod kernel:
reboot
confirm android binder devices are present on kernel config:
zcat /proc/config.gz | grep 'ANDROID_BINDER_DEVICES\|ASHMEM'
if devices are present you should get the following result:
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
 
= waydroid usage =
configure waydroid without google apps:
  sudo waydroid init
  sudo waydroid init
configure waydroid with google apps:
configure waydroid with google apps:
  sudo waydroid init -s GAPPS
  sudo waydroid init -s GAPPS
start and enable waydroid-container.service:
start and enable waydroid-container.service:
  sudo systemctl enable waydroid-container.service  
  sudo systemctl enable --now waydroid-container
launch waydroid in fullscreen mode:
waydroid show-full-ui
remove existing container:
sudo waydroid init -f
or remove the waydroid image directory:
sudo rm -rf /var/lib/waydroid
shutdown waydroid container:
sudo waydroid container stop
fix application screen rotation:
sudo waydroid shell wm set-fix-to-user-rotation enabled
enter android shell as root:
sudo waydroid shell
 
= google apps =
install waydroid-script-git:
sudo pacman -S waydroid-script-git
get device id and register with google:
sudo waydroid-extras
select android version 11 then get google device id option:
489589697978983
copy the returned numeric ip open browser on the following url:
https://google.com/android/uncertified/?pli=1
enter the id and register it, you may need to wait up to 10-20 minutes for device to get registered.
= smartdock =
install waydroid-script-git:
sudo pacman -S waydroid-script-git
install f-droid on android:
wget https://f-droid.org/F-Droid.apk -O /tmp/F-Droid.apk && \
sudo waydroid app install /tmp/F-Droid.apk
install dependencies:
sudo pacman -S gtk3 webkit2gtk vte3
install waydroid-settings:
yay -S waydroid-settings-git
launch waydroid settings and disable navbar:
sudo waydroid-settings
 
= reset waydroid =
stop waydroid service:
sudo systemctl stop waydroid-container.service
cleanup directories:
sudo rm -rf /var/lib/waydroid /home/.waydroid ~/waydroid ~/.share/waydroid ~/.local/share/applications/*aydroid* ~/.local/share/waydroid
initialise:
waydroid init -f -s GAPPS
start the service:
  sudo systemctl start waydroid-container.service
  sudo systemctl start waydroid-container.service
= references =
* https://lineageos.org/
* https://waydro.id/
* https://wiki.archlinux.org/title/Waydroid
* https://forum.garudalinux.org/t/ultimate-guide-to-install-waydroid-in-any-arch-based-distro-especially-garuda/15902
* https://github.com/casualsnek/waydroid_script/blob/main/README.md
* https://github.com/axel358/waydroid-settings

Latest revision as of 14:17, 7 October 2023

waydroid

to run waydroid we need wayland, follow this howto:

https://wiki.vidalinux.org/index.php/Howto_wayland

install chaotic repo:

sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
sudo pacman-key --lsign-key 3056513887B78AEB
sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' \
'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'

run the following command to add chaotic repo to /etc/pacman.conf:

cat >> /etc/pacman.conf << EOF
[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist
EOF

install yay:

sudo pacman -Sy yay --noconfirm

install xanmod kernel and headers:

sudo pacman -Sy linux-xanmod linux-xanmod-headers --noconfirm

install binder_linux modules:

sudo pacman -S binder_linux-dkms --noconfirm

add the following to /etc/default/grub:

#GRUB_CMDLINE_LINUX_DEFAULT="quiet ...."
GRUB_CMDLINE_LINUX="psi=1"

update grub configuration:

sudo grub-mkconfig -o /boot/grub/grub.cfg

install waydroid:

sudo pacman -S waydroid python-pyclip wl-clipboard --noconfirm

reboot the system and boot with xanmod kernel:

reboot

confirm android binder devices are present on kernel config:

zcat /proc/config.gz | grep 'ANDROID_BINDER_DEVICES\|ASHMEM'

if devices are present you should get the following result:

CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"

waydroid usage

configure waydroid without google apps:

sudo waydroid init

configure waydroid with google apps:

sudo waydroid init -s GAPPS

start and enable waydroid-container.service:

sudo systemctl enable --now waydroid-container

launch waydroid in fullscreen mode:

waydroid show-full-ui

remove existing container:

sudo waydroid init -f

or remove the waydroid image directory:

sudo rm -rf /var/lib/waydroid

shutdown waydroid container:

sudo waydroid container stop

fix application screen rotation:

sudo waydroid shell wm set-fix-to-user-rotation enabled

enter android shell as root:

sudo waydroid shell

google apps

install waydroid-script-git:

sudo pacman -S waydroid-script-git

get device id and register with google:

sudo waydroid-extras 

select android version 11 then get google device id option:

489589697978983

copy the returned numeric ip open browser on the following url:

https://google.com/android/uncertified/?pli=1 

enter the id and register it, you may need to wait up to 10-20 minutes for device to get registered.

smartdock

install waydroid-script-git:

sudo pacman -S waydroid-script-git

install f-droid on android:

wget https://f-droid.org/F-Droid.apk -O /tmp/F-Droid.apk && \
sudo waydroid app install /tmp/F-Droid.apk

install dependencies:

sudo pacman -S gtk3 webkit2gtk vte3

install waydroid-settings:

yay -S waydroid-settings-git

launch waydroid settings and disable navbar:

sudo waydroid-settings

reset waydroid

stop waydroid service:

sudo systemctl stop waydroid-container.service

cleanup directories:

sudo rm -rf /var/lib/waydroid /home/.waydroid ~/waydroid ~/.share/waydroid ~/.local/share/applications/*aydroid* ~/.local/share/waydroid

initialise:

waydroid init -f -s GAPPS

start the service:

sudo systemctl start waydroid-container.service

references