2023-12-21
Waydroid Installation Steps

cursed by the wall.

install waydroid package (for ubuntu)

visit and save https://repo.waydro.id/ as waydroid_init_repo.sh, https://repo.waydro.id/waydroid.gpg as waydroid.gpg (using proxy)

comment out the download part in waydroid_init_repo.sh

1
2
# curl --progress-bar --proto '=https' --tlsv1.2 -Sf https://repo.waydro.id/waydroid.gpg --output /usr/share/keyrings/waydroid.gpg

move waydroid.gpg to /usr/share/keyrings/waydroid.gpg

execute sudo bash waydroid_init_repo.sh to setup waydroid repository

on ubuntu you need to use proxy during apt mirror syncing.

to setup proxy (relay local proxy to host):

1
2
3
4
proxy --port <port> --host <host> \
--plugins proxy.plugin.ProxyPoolPlugin \
--proxy-pool localhost:<local_proxy_port>

to use proxy:

1
2
3
sudo env https_proxy=http://<host>:<port> http_proxy=http://<host>:<port> all_proxy=http://<host>:<port> apt update
sudo env https_proxy=http://<host>:<port> http_proxy=http://<host>:<port> all_proxy=http://<host>:<port> apt install waydroid -y

after installation you should comment out the mirror at: /etc/apt/sources.list.d/waydroid.list

initialize waydroid

start waydroid service: sudo systemctl enable --now waydroid-container

the download speed of sourceforge is very slow, unless you use mirror like liquidtelecom

modify the file /usr/lib/waydroid/tools/helpers/http.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
## added part
def is_sourceforge_download_url(url: str):
keywords = ["sourceforge.net", "download"]
return all([kw in url for kw in keywords])
def use_liquidtelecom_mirror(url: str):
# example: https://sourceforge.net/projects/waydroid/files/images/system/lineage/waydroid_x86_64/lineage-18.1-20231216-VANILLA-waydroid_x86_64-system.zip/download
# -> https://sourceforge.net/projects/waydroid/files/images/system/lineage/waydroid_x86_64/lineage-18.1-20231216-VANILLA-waydroid_x86_64-system.zip/download?use_mirror=liquidtelecom
keyword = "use_mirror=liquidtelecom"
if is_sourceforge_download_url(url):
if keyword not in url:
conn_symbol = "?" if "?" not in url else "&"
url += conn_symbol + keyword
return url
## modified part
def download(args, url, prefix, cache=True, loglevel=logging.INFO, allow_404=False):
...
url = use_liquidtelecom_mirror(url)
...
...

restart service: sudo systemctl restart waydroid-container

run command sudo waydroid init

run waydroid in xorg

install weston: apt install weston

configure weston at ~/.config/weston.ini

1
2
3
[core]
xwayland=true

run weston, launch terminal at top left corner, run waydroid

network issue

in addition to the official guide, you also need to enable firewalld or ufw to make it work.

the wifi switch is irrelevant to network. it won’t be turned on.

Read More

2022-12-05
Raspberry Pi Tweaks

openai says i should edit /etc/wpa_supplicant/wpa_supplicant.conf like this to connect to 5G wifi:

1
2
3
4
5
6
network={
ssid="<SSID>"
psk="<password>"
frequency=5180
}

also set frequency of wifi card like this:

1
2
3
sudo ifdown wlan0 && sudo ifup wlan0
sudo iw dev wlan0 set freq 5180

unplug ethernet, then we are golden.

1
2
traceroute baidu.com

how to check avaliable wifi ssids without network-manager:

1
2
sudo iwlist wlan0 scan | grep ESSID

default login (maybe not):

1
2
3
username: pi
password: raspberry

in order to start sshd, touch ssh under boot partition

recover dhcpcd service:

1
2
3
sudo systemctl enable dhcpcd.service
sudo systemctl restart dhcpcd.service

config the password with proot -S <path_to_rootfs> -b <boot_partition>:/boot -q qemu-arm /usr/bin/bash and passwd

you’ve installed raspap on this device. you use the default credentials. this shit will not connect to our wifi automatically, thus block your way of running docker containers on it with only macbook.

seriously? do you really need docker on macos? or just on raspberry pi?

change apt sources:

1
2
3
4
5
sudo sed -i 's|raspbian.raspberrypi.org|mirrors.ustc.edu.cn/raspbian|g' /etc/apt/sources.list
sudo sed -i 's|mirrordirector.raspbian.org|mirrors.ustc.edu.cn/raspbian|g' /etc/apt/sources.list
sudo sed -i 's|archive.raspbian.org|mirrors.ustc.edu.cn/raspbian|g' /etc/apt/sources.list
sudo sed -i 's|archive.raspberrypi.org/debian|mirrors.ustc.edu.cn/archive.raspberrypi.org/debian|g' /etc/apt/sources.list.d/raspi.list

using nmcli to scan and connect wifi

1
2
3
sudo nmcli dev wifi rescan
sudo nmcli dev wifi connect <SSID> password <PASSWORD>

sharing network:

1
2
ssh -R 1080 pi@10.42.0.33

edit /etc/network/interfaces:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.42.0.33
netmask 255.255.255.0
gateway 10.42.0.1
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wpa-ssid "<SSID>"
wpa-psk "<PASSWORD>"

install packages:

1
2
3
sudo apt-get -o Acquire::http::proxy="socks5h://127.0.0.1:1080/"  -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update --allow-releaseinfo-change
sudo apt-get -o Acquire::http::proxy="socks5h://127.0.0.1:1080/" -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false upgrade -y

Read More