I’m interested in installing waydroid, but there are setup guides for only the other distros. Will waydroid work properly on Clear and if so, has someone successfully got it running?
CL Version as of time of writing: 40310
UPDATED: CL version: 40620
UPDATE 2: Guide no longer assumes anything! Removed games-dev
and added actual dependencies.
UPDATE 3: CL version: 41230, added /usr/local/lib64 to LD_LIBRARY_PATH
UPDATE 4: get around sudo waydroid init
being unable to run lxc commands
UPDATE 5: Rewritten for CL 42050+
FINAL: Added to CL in 42200, see latest post for official instructions
Swupd dependencies
sudo swupd bundle-add c-basic c-basic-legacy dev-utils devpkg-dbus devpkg-systemd devpkg-glib devpkg-libseccomp devpkg-openssl devpkg-libcap devpkg-Linux-PAM
Fulfilling prerequisites
Part 1. Gbinder-Python
Part 2. LXC
Libglibutil → Libgbinder → Gbinder-Python
git clone https://github.com/sailfishos/libglibutil.git
make
sudo make install-dev LIBDIR=/usr/lib64
git clone https://github.com/mer-hybris/libgbinder.git
make
sudo make install-dev LIBDIR=/usr/lib64
git clone https://github.com/erfanoabdi/gbinder-python.git
python setup.py build --cython
sudo python setup.py install
Part 2. LXC
setup the .conf file under /etc/kernel/cmdline.d/
//enter root with sudo -s
# mkdir -p /etc/kernel/cmdline.d
# echo psi=1 >> /etc/kernel/cmdline.d/lxc.conf
# clr-boot-manager update
Once you’re done, restart the system and build LXC
git clone https://github.com/lxc/lxc.git
meson --libdir=lib64 \
--prefix=/usr \
-Dsystemd-unitdir=/usr/lib/systemd/system \
-Dinit-script=systemd \
-Ddistrosysconfdir=/etc/default \
-Dapparmor=false \
-Dselinux=false \
-Dman=false \
build
ninja -v -C build
sudo ninja -C build install
Installing Waydroid
git clone https://github.com/waydroid/waydroid.git
sudo make install
sudo waydroid init /* or sudo waydroid init -s GAPPS */
sudo sed -i '/^lxc\.apparmor\.profile/s/^/# /' /var/lib/waydroid/lxc/waydroid/config
sudo systemctl enable waydroid-container.service
sudo systemctl start waydroid-container.service
waydroid session start OR waydroid show-full-ui
Check post below for troubleshooting
Common issues
OSError: container failed to start
lxc was built without apparmor support, comment it out in the config file for waydroid, expect to see this error usually after major updates when the config file gets reloaded
sudo sed -i '/^lxc\.apparmor\.profile/s/^/# /' /var/lib/waydroid/lxc/waydroid/config
Skipping clipboard manager server because of missing pyclip package
Install pyclip
git clone https://github.com/spyoungtech/pyclip.git
python setup.py build
sudo python setup.py install
DBusException: org.freedesktop.DBus.Error.AccessDenied: Connection ":1.77" is not allowed to own the service "id.waydro.Container" due to security policies in the configuration file
I came across this issue once in KDE run the following command, more details here DBusException: org.freedesktop.DBus.Error.AccessDenied: Connection ":1.77" is not allowed to own the service "id.waydro.Container" due to security policies in the configuration file · Issue #854 · waydroid/waydroid · GitHub
dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
How many Waydroid & LXC dependencies aren’t available in Clear? Thinking about adding Waydroid to CF.
libglibutil
libgbinder
gbinder-python
lxc
pyclip
waydroid (sudo make install)
These are all the packages.
Weird quirks:
- waydroid-container.service can only find libgbinder.so only if the
python-data-science
bundle is added after waydroid is installed. Probably can get around this by specifying --prefix=/usr when building the first three packages but I’m not sure. - I build lxc without apparmor support so updates or installing libhoudini/libndk/widevine/etc will cause waydroid to cause OS Error under my common issues post. Will have to rerun that sed command to comment it out (I haven’t tested building lxc with apparmor support)
- lxc must specify prefix when building or waydroid will be unable to use lxc commands like lxc-info, they will error out with liblxc.so shared library cannot be found. If commands were run normally they work, but within waydroid they fail. Before I figured out the specify --prefix I tried to build lxc statically but I fail due to skill issue.
Yeah, that’s tricky task, especially getting it to work from /opt
. So contributors are welcome
waydroid-container.service can only find libgbinder.so only if the
python-data-science
My guess your PYTHONPATH
is broken or there’s some unknown gbinder dependency.
lxc must specify prefix when building or waydroid will be unable to use lxc commands like lxc-info
The PATH
isn’t enough? Anyway, think it’s hard to make it work from /opt
without patching Waydroid launcher.
My guess your
PYTHONPATH
is broken or there’s some unknown gbinder dependency.
This is tested off a clean install of CL with no bundles (last done at 41230), as you can see, i have not set a PYTHONPATH
anywhere in my guide.
Extra quirk: python-data-science
bundle can be removed later after installing waydroid and waydroid will still work as normal afterwards.
The
PATH
isn’t enough? Anyway, think it’s hard to make it work from/opt
without patching Waydroid launcher.
Where do I sign up to contribute?
Though I feel like this is going to be a long road
Where do I sign up to contribute?
Welcome to the club
Extra quirk:
python-data-science
bundle can be removed later after installing waydroid and waydroid will still work as normal afterwards.
Weird, maybe this bundle include some useful Python tools or something.
Hi, is this a common error when building lxc?
gcc -o liblxc.so.1.8.0 -flto -Wl,--no-undefined -shared -fPIC -Wl,-soname,liblxc.so.1 -Wl,--whole-archive -Wl,--start-group src/lxc/liblxc.a -Wl,--no-whole-archive -Wl,--no-as-needed -Wl,--gc-sections -Wl,-z,relro -Wl,-z,now -fstack-protector -fstack-protector-strong -Wl,-fuse-ld=gold -Wl,--warn-common -g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -Wl,--copy-dt-needed-entries -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -malign-data=abi -fno-semantic-interposition -ftree-vectorize -ftree-loop-vectorize -Wl,-rpath,/lib64 -Wl,-rpath-link,/lib64 -DPIC /usr/lib64/libdbus-1.so -pthread /usr/lib64/libseccomp.so /usr/lib64/libssl.so /usr/lib64/libcrypto.so /lib64/libcap.so -lutil -Wl,--end-group
/usr/bin/ld.gold: error: --copy-dt-needed-entries is not supported but is required for libsystemd.so.0 in /usr/lib64/libdbus-1.so
collect2: error: ld returned 1 exit status
[350/533] Compiling C object src/lxc/tools/lxc-info.p/.._network.c.o
ninja: build stopped: subcommand failed.
I’ve rewritten lxc, and tested on CL 42050. I recommend reinstalling libgbinder, libglibutil and gbinder-python to change to the new LIBDIR location. If you want to delete the old installs, they should be found under /usr/lib. You can purge them with sudo swupd repair --extra-files-only
(this will purge any additional files on your system)
If you want to reconfigure your meson in lxc again, delete the build
folder your Makefile creates
Added in 42200 Waydroid · Issue #3154 · clearlinux/distribution · GitHub
// add waydroid bundle (unified bundle in next update)
sudo swupd bundle-add waydroid libgbinder dhcp-server
// initialize waydroid (Use either one)
sudo waydroid init
sudo waydroid init -s GAPPS
// workaround for apparmor after init
sudo sed -i '/^lxc\.apparmor\.profile/s/^/# /' /var/lib/waydroid/lxc/waydroid/config
// start services
sudo systemctl enable waydroid-container.service
sudo systemctl start waydroid-container.service
// start waydroid (use any method)
waydroid session start
waydroid show-full-ui
open the .desktop file