Ultimate Guide to install Waydroid in any Arch-based distro(especially Garuda)

Did you find any way to automate it?

You can create an alias for this command:

waydroid show-full-ui & sleep 10 && pkexec waydroid shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh

This should work, but you will have to put in your password every time you run it.

1 Like

best I got was adding

waydroid show-full-ui && kdesu waydroid shell sh /storage/emulated/0/Android/data/moe.shizuku.privile
ged.api/start.sh

to the waydroid show-full-ui desktop file like this

File: /home/zany130/.local/share/applications/Waydroid.desktop
[Desktop Entry]
Type=Application
Name=Waydroid
Exec=waydroid show-full-ui && kdesu waydroid shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh
Categories=X-WayDroid-App;
X-Purism-FormFactor=Workstation;Mobile;
NoDisplay=false
Icon=waydroid

tried modifying the systemd service to see if I could add it there but that only starts the container. the full android session needs to be running first

kdesu is obvisly specfic to kde on gnome for exanple i think its gksu

1 Like

gksu is deprecated. It is available in the chaotic-aur but doesn’t work (it has some glitches).
I think we should not have it in the chaotic-aur anymore.

You should use pkexec instead.


Does this command work?
It should be & instead of && for it to work.
Also you would need to wait for the Waydroid session to start before you run moe.shizuku.privileged.api/start.sh. So it shouldn’t work without sleep 10?

Also I would recommend you to keep .local/share/applications/Waydroid.desktop as is.
It will get overwritten whenever you will have to reinitialize waydroid. You should create another .desktop file (check out menulibre app for editing menus).

2 Likes

From my testing it seems to work with the && and no sleep.

though was wondering why it kept reverting my Waydroid.desktop file guess I know why know :sweat_smile:

1 Like

My bad apparently, my command was not working like I thought it was. It was just starting the full UI. It asks for a password and runs the command, but I guess it runs too soon. Needed to add a sleep command of 60 (10 was too short 60 prompted me for the password a few seconds after Android fully boots up)

What I think happened was I ran the desktop file several times ( I got impatient waiting for it to load :sweat_smile: ) so that caused it to run my command several times, eventually running late enough.

BTW with kdesu can remember the password so I only have to enter the password once (this persists across reboots) pkexec doesn't have this feature

EDIT: my new .desktop file

cat .local/share/applications/WaydroidShizuku.desktop
File: .local/share/applications/WaydroidShizuku.desktop
[Desktop Entry]
Categories=X-WayDroid-App;
Comment=
Exec=waydroid show-full-ui & sleep 60 && kdesu waydroid shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh
Icon=waydroid
Name=Waydroid-Shizuku
NoDisplay=false
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
X-Purism-FormFactor=Workstation;Mobile;

EDIT 2:

It looks like the behavior of

waydroid show-full-ui & sleep 60 && kdesu waydroid shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh

is different in a terminal and when ran as through a desktop file
in a terminal it works as expected

  1. starts waydroid in the background
  2. sleeps for 60 seconds
  3. run kdesu and the awaydroid shell command

but when run from the .desktop file it seems like it never does step 3 until you terminate the show-full-ui process

1 Like

Yup, the same case with pkexec.

I would recommend you create a permanent alias for

waydroid show-full-ui & sleep 10 && pkexec waydroid shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh

and run it from the terminal only.


I am using fish.

Instead of & try using ; instead.

waydroid show-full-ui; sleep 60; kdesu waydroid shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh
1 Like
  • & operator is used to run a command in the background, which means that the command will continue to run even after the terminal session is closed.
  • && is used when you want to execute a command only if the previous command succeeded.
  • ; is used when you want to execute a command regardless of the outcome.

So the issue when I run waydroid show-full-ui, even after the Waydroid UI launches waydroid show-full-ui doesn’t return the command prompt, it just goes on…
I would have to end it with Ctrl-C to stop it.

Yes but we don’t have a terminal session to end here. We are just daisy chaining a command now for a desktop file. I suspect that the .desktop file is treating & as && in terminal and hence why it’s waiting for the first command to finish successfully with no errors before starting the execution of next command however using ; instead of && would mean that the next command in dasiy chain executes regardless of the status of the ones before it.

In future if you have accidentally launched a process without & at the end of the process that has taken away your shell prompt and you need it back/wanna close the terminal you can ctrl+z to pause the process and you will have your shell prompt back then bg to send the process to background where it will resume working then just use disown to disown the process and then close the terminal.

1 Like

; is a comment in desktop files I believe so this just runs waydroid show-full-ui

1 Like
  • Adding this to the .desktop file doesn’t work
Exec=waydroid show-full-ui; sleep 10; kdesu waydroid shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh
  • Adding this to the .desktop file prompts for the root privileges only after the waydroid session is stopped
Exec=/bin/bash -c "waydroid show-full-ui; sleep 10; pkexec waydroid shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh"
  • Adding this to the .desktop file works as expected!
Exec=/bin/bash -c "waydroid show-full-ui & sleep 10 && pkexec waydroid shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh"
2 Likes
File: ~/.local/share/applications/Waydroid_Rooted.desktop

[Desktop Entry]
Type=Application
Name=Waydroid_Rooted
Exec=bash -c "~/Apps\&Scripts/Waydroid_Rooted.sh"
Categories=X-WayDroid-App;
X-Purism-FormFactor=Workstation;Mobile;
Icon=waydroid
File: ~/Apps&Scripts/Waydroid_Rooted.sh
#!/bin/bash

# Check the status of Waydroid session
waydroid_status=$(waydroid status | grep -E 'Session:')

if grep -q "RUNNING" <<< "$waydroid_status"; then
    waydroid show-full-ui
elif grep -q "STOPPED" <<< "$waydroid_status"; then
    waydroid show-full-ui &  # Start Waydroid environment in the background
    notify-send "Waydroid is starting"
    sleep 10
    pkexec waydroid shell sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh
else
    notify-send "Waydroid status is unknown or not found"
fi

Cheers

1 Like

New update!
Completed over 150 edits to the Wiki!!

4 Likes


A circular cut-out of this image here: Waydroid logo by Radosław Błędowski on Dribbble


An icon I created similar to the previous one but with a darker background and a larger logo.

3 Likes

?
g22

This one wasn’t as fast as your simple circle cutout, but I wouldn’t call it my ceated icon even though I made it all myself. It is a remix of existing works.
Maybe it’s just a translation problem again :slight_smile:

Waydroid_Logo

4 Likes

Setting up Waydroid only Sessions

Follow the instructions here,

Don't forget to make the session start-script executable.
[
/usr/bin/wayfire-session.sh
or
/usr/bin/mutter-session.sh
or
/usr/bin/weston-session.sh
]

Else, the /usr/share/wayland-sessions/*.desktop file will fail to start the session.

You can make it executable by: sudo chmod a+x /usr/bin/*-session.sh

Waydroid launches just fine in the Mutter session.

The instructions didn't seem to work in the cases of Weston and Wayfire.

(Even when I try to launch Waydroid from the Wayfire desktop normally, Waydroid would launch as a blank black window.)

2 Likes

waydroid-01

waydroid-02

4 Likes
1 Like

anyone been able to use waydroid since the 6.5 kernel? just doesn’t seem to want to load
tried running sudo waydroid init -f

and psi=1 in the kernel options
just getting stuck here

waydroid show-full-ui
[21:07:53] Starting waydroid session
systemctl status waydroid-container.service
● waydroid-container.service - Waydroid Container
     Loaded: loaded (/usr/lib/systemd/system/waydroid-container.service; enabled; preset: disabled)
     Active: active (running) since Sat 2023-09-23 20:42:51 EDT; 25min ago
   Main PID: 835 (python3)
      Tasks: 6 (limit: 38367)
     Memory: 23.8M
        CPU: 174ms
     CGroup: /system.slice/waydroid-container.service
             ├─  835 python3 /usr/bin/waydroid -w container start
             └─84000 dnsmasq --conf-file=/dev/null -u dnsmasq --strict-order --bind-interfaces --pid-file>

Sep 23 20:42:51 Garuda-Linux systemd[1]: Started Waydroid Container.
Sep 23 21:07:53 Garuda-Linux dnsmasq[84000]: started, version 2.89 cachesize 150
Sep 23 21:07:53 Garuda-Linux dnsmasq[84000]: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2>
Sep 23 21:07:53 Garuda-Linux dnsmasq-dhcp[84000]: DHCP, IP range 192.168.240.2 -- 192.168.240.254, lease >
Sep 23 21:07:53 Garuda-Linux dnsmasq-dhcp[84000]: DHCP, sockets bound exclusively to interface waydroid0
Sep 23 21:07:53 Garuda-Linux dnsmasq[84000]: reading /etc/resolv.conf
Sep 23 21:07:53 Garuda-Linux dnsmasq[84000]: using nameserver 192.168.2.1#53
Sep 23 21:07:53 Garuda-Linux dnsmasq[84000]: using nameserver 2600:1700:5230:84d0::41#53
Sep 23 21:07:53 Garuda-Linux dnsmasq[84000]: read /etc/hosts - 12 names
Sep 23 21:07:53 Garuda-Linux waydroid[835]: [21:07:53] waiting 10 seconds for container to start..
garuda-inxi
System:
  Kernel: 6.5.4-1-cachyos arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    clocksource: tsc available: hpet,acpi_pm
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-linux
    root=UUID=53e270ad-dfd5-4874-a125-69d21ada6b8d rw rootflags=subvol=@
    rd.udev.log_priority=3 vt.global_cursor_default=0 loglevel=3
    sysrq_always_enabled=1 amdgpu.ppfeaturemask=0xffffffff nowatchdog
    nmi_watchdog=0 initrd=@\boot\initramfs-linux-cachyos.img
  Desktop: KDE Plasma v: 5.27.8 tk: Qt v: 5.15.10 wm: kwin_wayland vt: 1
    dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: ASRock model: X470 Taichi serial: <superuser required>
    UEFI: American Megatrends v: P5.10 date: 10/20/2022
Battery:
  Device-1: hidpp_battery_0 model: Logitech Wireless Mouse MX Master 3
    serial: <filter> charge: 100% (should be ignored) rechargeable: yes
    status: discharging
CPU:
  Info: model: AMD Ryzen 5 5600X bits: 64 type: MT MCP arch: Zen 3+ gen: 4
    level: v3 note: check built: 2022 process: TSMC n6 (7nm) family: 0x19 (25)
    model-id: 0x21 (33) stepping: 2 microcode: 0xA20120A
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB desc: 6x512 KiB
    L3: 32 MiB desc: 1x32 MiB
  Speed (MHz): avg: 4443 high: 4650 min/max: 2200/4650 boost: enabled
    scaling: driver: acpi-cpufreq governor: performance cores: 1: 4602 2: 4650
    3: 4359 4: 4649 5: 4426 6: 4070 7: 4606 8: 4647 9: 4066 10: 4650 11: 4373
    12: 4223 bogomips: 88797
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
Graphics:
  Device-1: AMD Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
    vendor: Gigabyte driver: amdgpu v: kernel arch: RDNA-2 code: Navi-2x
    process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 4 speed: 16 GT/s
    lanes: 16 ports: active: DP-1,DP-2,HDMI-A-2 empty: HDMI-A-1
    bus-ID: 10:00.0 chip-ID: 1002:73df class-ID: 0300
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.2.1
    compositor: kwin_wayland driver: X: loaded: amdgpu
    unloaded: modesetting,radeon alternate: fbdev,vesa dri: radeonsi
    gpu: amdgpu d-rect: 5120x2592 display-ID: 0
  Monitor-1: DP-1 pos: bottom-r res: 2048x864 size: N/A modes: N/A
  Monitor-2: DP-2 pos: primary,top-left res: 1536x864 size: N/A modes: N/A
  Monitor-3: HDMI-A-2 pos: middle-c res: 1536x864 size: N/A modes: N/A
  API: OpenGL v: 4.6 Mesa 23.1.8-arch1.1 renderer: AMD Radeon RX 6700 XT
    (navi22 LLVM 16.0.6 DRM 3.54 6.5.4-1-cachyos) direct-render: Yes
Audio:
  Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel pcie:
    gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 10:00.1 chip-ID: 1002:ab28
    class-ID: 0403
  Device-2: AMD Starship/Matisse HD Audio vendor: ASRock
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 12:00.4 chip-ID: 1022:1487 class-ID: 0403
  Device-3: Sony INZONE H9 / H7
    driver: cdc_acm,hid-generic,snd-usb-audio,usbhid type: USB rev: 2.0
    speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 5-3:3 chip-ID: 054c:0e53
    class-ID: 0a00
  API: ALSA v: k6.5.4-1-cachyos status: kernel-api with: aoss
    type: oss-emulator tools: N/A
  Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
  Server-2: PipeWire v: 0.3.80 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi
    v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 08:00.0
    chip-ID: 8086:24fb class-ID: 0280
  IF: wlp8s0 state: down mac: <filter>
  Device-2: Intel I211 Gigabit Network vendor: ASRock driver: igb v: kernel
    pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: d000 bus-ID: 0a:00.0
    chip-ID: 8086:1539 class-ID: 0200
  IF: enp10s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: vethL4HwPh state: up speed: 10000 Mbps duplex: full mac: <filter>
  IF-ID-2: virbr0 state: down mac: <filter>
  IF-ID-3: waydroid0 state: up speed: 10000 Mbps duplex: unknown
    mac: <filter>
Bluetooth:
  Device-1: Edimax Bluetooth Adapter driver: btusb v: 0.8 type: USB rev: 1.1
    speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-5:3 chip-ID: 7392:c611
    class-ID: e001 serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 5.1
    lmp-v: 10 status: discoverable: no pairing: yes class-ID: 7c0104
  Device-2: Intel Wireless-AC 3168 Bluetooth driver: btusb v: 0.8 type: USB
    rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-9:5 chip-ID: 8087:0aa7
    class-ID: e001
  Report: ID: hci1 rfk-id: 2 state: up address: <filter> bt-v: 4.2 lmp-v: 8
    status: discoverable: no pairing: yes class-ID: 7c0104
Drives:
  Local Storage: total: 2.96 TiB used: 2.42 TiB (82.0%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:3 vendor: Samsung model: SSD 980 1TB
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: 3B4QFXO7 temp: 41.9 C
    scheme: GPT
  ID-2: /dev/nvme1n1 maj-min: 259:0 vendor: Samsung model: SSD 970 EVO 250GB
    size: 232.89 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: 2B2QEXE7 temp: 35.9 C
    scheme: GPT
  ID-3: /dev/sda maj-min: 8:0 vendor: Seagate model: ST2000DX002-2DV164
    size: 1.82 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    tech: HDD rpm: 7200 serial: <filter> fw-rev: CC41 scheme: GPT
Partition:
  ID-1: / raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 877.86 GiB (94.3%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:5
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 29.8 MiB (10.0%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:4
  ID-3: /home raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 877.86 GiB (94.3%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:5
  ID-4: /var/log raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 877.86 GiB (94.3%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:5
  ID-5: /var/tmp raw-size: 931.22 GiB size: 931.22 GiB (100.00%)
    used: 877.86 GiB (94.3%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:5
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: zram size: 31.26 GiB used: 3.7 GiB (11.9%)
    priority: 100 comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 12
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 61.4 C mobo: 36.0 C gpu: amdgpu temp: 54.0 C
    mem: 56.0 C
  Fan Speeds (rpm): fan-1: 0 fan-2: 2177 fan-3: 0 fan-4: 0 fan-5: 0
    gpu: amdgpu fan: 0
  Power: 12v: N/A 5v: N/A 3.3v: 3.20 vbat: 3.28 gpu: amdgpu watts: 28.00
Info:
  Processes: 661 Uptime: 26m wakeups: 107 Memory: total: 32 GiB
  available: 31.26 GiB used: 14.67 GiB (46.9%) Init: systemd v: 254
  default: graphical tool: systemctl Compilers: gcc: 13.2.1 clang: 16.0.6
  Packages: 2751 pm: pacman pkgs: 2711 libs: 598 tools: octopi,paru
  pm: appimage pkgs: 0 pm: flatpak pkgs: 40 Shell: fish v: 3.6.1
  running-in: alacritty inxi: 3.3.29
Garuda (2.6.16-1):
  System install date:     2023-09-06
  Last full system update: 2023-09-23 ↻
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager dracut
  Windows dual boot:       Probably (Run as root to verify)
  Failed units:            waydroid_magisk_ota.service
1 Like