Is a LineageOS VM doable on 4.2?

Found an interesting article (for me at least) on creating a VM for Lineage OS and using that for comms and managing IDs on apps such as Whatsapp, Telegram, Cashapp etc.

Anyone with experience with a LineageOS VM care to comment? I’m interested to set it up.

2 Likes

I have no experience nor interest with creating any Android ROM VMs, but I appreciate you sharing the article; I read all of it.

You can use Waydroid with Weston in AppVM.

2 Likes

Some unfinished notes about creating Waydroid template.
You can use them as starting point.

Waydroid template

Install debian-12-minimal template using “Qubes Template Manager” tool if you don’t have it.

Update debian-12-minimal template using “Qubes Update” tool.

Clone debian-12-minimal and name it d12m-waydroid.

Start d12m-waydroid and open its root terminal using this command in dom0 terminal:

qvm-run -u root d12m-waydroid xterm &

Install Xfce and Weston:

apt install qubes-core-agent-networking xfce4 xfce4-goodies weston

Install Waydroid:

apt install curl ca-certificates -y
curl --proxy http://127.0.0.1:8082/ --tlsv1.2 --proto =https --max-time 180 https://repo.waydro.id | https_proxy=http://127.0.0.1:8082 bash
apt install waydroid -y

NOTE: I couldn’t make clipboard sharing work in Weston and in Waydroid, but still some notes for reference:

Install Waydroid clipboard support:

apt install pip python3-venv
python3 -m venv /opt/venv/pyclip
source /opt/venv/pyclip/bin/activate
pip install --proxy http://127.0.0.1:8082 pyclip
deactivate
echo 'export PATH="/opt/venv/pyclip/bin:$PATH"' >> /etc/profile.d/python-venv.sh
echo 'export PYTHONPATH="/opt/venv/pyclip/lib/python3.11:$PYTHONPATH"' >> /etc/profile.d/python-venv.sh

Initialize Waydroid

Run this command to init Waydroid, It’ll download VANILLA Android image:

https_proxy=http://127.0.0.1:8082 http_proxy=http://127.0.0.1:8082 waydroid init

Or this command for Waydroid image with GApps support:

https_proxy=http://127.0.0.1:8082 http_proxy=http://127.0.0.1:8082 waydroid init -s GAPPS

Update Waydroid image

In template run:

https_proxy=http://127.0.0.1:8082 http_proxy=http://127.0.0.1:8082 waydroid upgrade

You also need to add firewall rules in AppVM to allow networking:

nft add rule ip qubes custom-forward iifname "waydroid0" oifgroup 1 accept
nft add rule ip qubes custom-forward oifname "waydroid0" iifgroup 1 accept
nft add rule ip qubes custom-input iifname "waydroid0" meta l4proto {tcp, udp} th dport { 53, 67 } accept

Restart the container after applying the rules:

systemctl restart waydroid-container

Aurora Store newer than version 4.2.5 crashes on Waydroid:

Info about Weston and Waydroid usage:
https://wiki.archlinux.org/title/Weston
https://wiki.archlinux.org/title/Waydroid

Some example script to start Waydroid in Weston:

5 Likes

@apparatus Many thanks for putting all this together

1 Like

I’ve updated nftables rules:

You also need to add firewall rules in AppVM to allow networking:

nft add rule ip qubes custom-forward iifname "waydroid0" oifgroup 1 accept
nft add rule ip qubes custom-forward oifname "waydroid0" iifgroup 1 accept
nft add rule ip qubes custom-input iifname "waydroid0" meta l4proto {tcp, udp} th dport { 53, 67 } accept
2 Likes

I’ve finished the guide:

4 Likes

I have an Android hvm Qube. I used LineageOS x86 and it works pretty seamlessly from the start. The only problem is that it has no interface at all with other Qubes. So no global clipboard, file coping between qubes…etc.

2 Likes

I don’t understand why this was posted in All around Qubes Category. It seems very much Qubes-related. I moved it to the General Discussion Category.

3 Likes

@fsflover Yep, got it wrong, I guess. I remember hesitating where to put it. I’m sure the move will provide more input. Many thanks.

1 Like