sailfish-containers / harbour-containers Goto Github PK
View Code? Open in Web Editor NEWA LXC manager and runner for SailfishOS
License: GNU General Public License v3.0
A LXC manager and runner for SailfishOS
License: GNU General Public License v3.0
The Containers app stops showing content after icons are added...
It would be cool to add the output of du
to the info text to show the current size of the rootfs as well as snapshots, and it would help managing containers too.
Any chance of an aarch64 build?
To help to discuss and share info, I have created a topic in TMO: Full linux distros on Sailfish OS
Probably low priority
Wiki entries with some basic guidelines on how to set up xfce4
, i3
, i3-gaps
and other DEs and WMs could be useful. I reckon a good fraction of new users would be pretty excited about LXC and install it on their phone, then be overwhelmed and give up before their containers are actually well configured to be easily used on mobile. Either because configuring an OS is time consuming, let alone on a mobile device that requires some specific tricks they might not know about, or because at first a desktop OS on small screen with no adequate controls or DPI could appear as a bad idea. Yet we know it's not cumbersome to use once configured (at least on Pro¹).
Messy and non-exhaustive list of things that could be mentioned:
Shift
+ tap, some just have no support for touch right clicks; this could be mentioned)-plugin evdevmouse
to LIPSTICK_OPTIONS:
in /var/lib/environment/compositor/droid-hal-device.conf
); no visible cursor for nowdconf
during X setup; there should be a security if the setup button is pressed when configuration files already exist: either abort, or ask for confirmation to reset to default/home/nemo
either as an additional mount, or merge it with /merge/user
Wiki entries shouldn't be too verbose though. Exactly the opposite of this message. We know nobody reads wikis. But pictures and some guidelines on which files to edit on the first run, possibly from lxc-attach
until the DPI is adjusted, would be cool. Scripts for "sane mobile default configurations" too.
Answering @edp17's comment in another issue:
@Kabouik : Yeah, some settings are not easy to set in the xfce4. Especially when a dropdown is involved. When I tap on it, the dropdown opens but immediately closes before I can select any options. (This is not limited to the onboard setup but for anything else e.g. setting the tree pane icon size of File Manager is a mission impossible task. :)
I don't currently have a container running xfce4 but I don't remember that, and I don't think I had that in sailfish_ubu_chroot
(maybe check this in case you observe the same issue and I just didn't notice it in real use). I do observe, however, Firefox context menu being a bit difficult sometimes. But not all the time, and when this happens, just keeping my finger on the screen and sliding it to select the menu entry I want works. Can you try that in the file manager too?
I installed the 0.6 version from Chum on Xperia 10 III (aarch64).
I launched it, created new Debian container that was supposed to have a GUI. It got stuck at "starting setup" so I left it overnight, in the morning it still said the same thing. So I deleted the cobtainer, it didn't disappear, so I deleted it again. When I launched the app again it showed an empty screen, with no container or option to add the new one.
If I launch it from the terminal I am getting
[W] unknown:12 - file:///usr/share/harbour-containers/qml/harbour-containers.qml:12:5: QML Daemon: QDBusError("org.freedeskto
p.DBus.Python.subprocess.CalledProcessError", "Traceback (most recent call last):\n File \"/usr/lib64/python3.8/site-package
s/dbus/service.py\", line 711, in _message_cb\n retval = candidate_method(self, *args, **keywords)\n File \"/usr/share/ha
rbour-containers/service/daemon.py\", line 477, in get_containers\n self._refresh()\n File \"/usr/share/harbour-container
s/service/daemon.py\", line 115, in _refresh\n self.containers = lxc.get_containers()\n File \"/usr/share/harbour-contain
ers/service/libs/lxc.py\", line 41, in get_containers\n cmd_out = subprocess.check_output(['lxc-info', '-n', container,'-p
','-s','-S']).decode().split(\"\\n\")\n File \"/usr/lib64/python3.8/subprocess.py\", line 415, in check_output\n return r
un(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n File \"/usr/lib64/python3.8/subprocess.py\", line 516, in run\n
raise CalledProcessError(retcode, process.args,\nsubprocess.CalledProcessError: Command '['lxc-info', '-n', 'Debian', '-p',
'-s', '-S']' returned non-zero exit status 1.\n")
[W] unknown:12 - file:///usr/share/harbour-containers/qml/harbour-containers.qml:12:5: QML Daemon: QDBusError("org.freedeskto
p.DBus.Python.subprocess.CalledProcessError", "Traceback (most recent call last):\n File \"/usr/lib64/python3.8/site-package
s/dbus/service.py\", line 711, in _message_cb\n retval = candidate_method(self, *args, **keywords)\n File \"/usr/share/ha
rbour-containers/service/daemon.py\", line 477, in get_containers\n self._refresh()\n File \"/usr/share/harbour-container
s/service/daemon.py\", line 115, in _refresh\n self.containers = lxc.get_containers()\n File \"/usr/share/harbour-contain
ers/service/libs/lxc.py\", line 41, in get_containers\n cmd_out = subprocess.check_output(['lxc-info', '-n', container,'-p
','-s','-S']).decode().split(\"\\n\")\n File \"/usr/lib64/python3.8/subprocess.py\", line 415, in check_output\n return r
un(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n File \"/usr/lib64/python3.8/subprocess.py\", line 516, in run\n
raise CalledProcessError(retcode, process.args,\nsubprocess.CalledProcessError: Command '['lxc-info', '-n', 'Debian', '-p',
'-s', '-S']' returned non-zero exit status 1.\n")
[W] unknown:12 - file:///usr/share/harbour-containers/qml/harbour-containers.qml:12:5: QML Daemon: QDBusError("org.freedeskto
p.DBus.Python.subprocess.CalledProcessError", "Traceback (most recent call last):\n File \"/usr/lib64/python3.8/site-package
s/dbus/service.py\", line 711, in _message_cb\n retval = candidate_method(self, *args, **keywords)\n File \"/usr/share/ha
rbour-containers/service/daemon.py\", line 477, in get_containers\n self._refresh()\n File \"/usr/share/harbour-container
s/service/daemon.py\", line 115, in _refresh\n self.containers = lxc.get_containers()\n File \"/usr/share/harbour-contain
ers/service/libs/lxc.py\", line 41, in get_containers\n cmd_out = subprocess.check_output(['lxc-info', '-n', container,'-p
','-s','-S']).decode().split(\"\\n\")\n File \"/usr/lib64/python3.8/subprocess.py\", line 415, in check_output\n return r
un(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n File \"/usr/lib64/python3.8/subprocess.py\", line 516, in run\n
raise CalledProcessError(retcode, process.args,\nsubprocess.CalledProcessError: Command '['lxc-info', '-n', 'Debian', '-p',
'-s', '-S']' returned non-zero exit status 1.\n")
[W] unknown:12 - file:///usr/share/harbour-containers/qml/harbour-containers.qml:12:5: QML Daemon: QDBusError("org.freedeskto
p.DBus.Python.subprocess.CalledProcessError", "Traceback (most recent call last):\n File \"/usr/lib64/python3.8/site-package
s/dbus/service.py\", line 711, in _message_cb\n retval = candidate_method(self, *args, **keywords)\n File \"/usr/share/ha
rbour-containers/service/daemon.py\", line 477, in get_containers\n self._refresh()\n File \"/usr/share/harbour-container
s/service/daemon.py\", line 115, in _refresh\n self.containers = lxc.get_containers()\n File \"/usr/share/harbour-contain
ers/service/libs/lxc.py\", line 41, in get_containers\n cmd_out = subprocess.check_output(['lxc-info', '-n', container,'-p
','-s','-S']).decode().split(\"\\n\")\n File \"/usr/lib64/python3.8/subprocess.py\", line 415, in check_output\n return r
un(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n File \"/usr/lib64/python3.8/subprocess.py\", line 516, in run\n
raise CalledProcessError(retcode, process.args,\nsubprocess.CalledProcessError: Command '['lxc-info', '-n', 'Debian', '-p',
'-s', '-S']' returned non-zero exit status 1.\n")
[W] unknown:12 - file:///usr/share/harbour-containers/qml/harbour-containers.qml:12:5: QML Daemon: QDBusError("org.freedeskto
p.DBus.Python.subprocess.CalledProcessError", "Traceback (most recent call last):\n File \"/usr/lib64/python3.8/site-package
s/dbus/service.py\", line 711, in _message_cb\n retval = candidate_method(self, *args, **keywords)\n File \"/usr/share/ha
rbour-containers/service/daemon.py\", line 477, in get_containers\n self._refresh()\n File \"/usr/share/harbour-container
s/service/daemon.py\", line 115, in _refresh\n self.containers = lxc.get_containers()\n File \"/usr/share/harbour-contain
ers/service/libs/lxc.py\", line 41, in get_containers\n cmd_out = subprocess.check_output(['lxc-info', '-n', container,'-p
','-s','-S']).decode().split(\"\\n\")\n File \"/usr/lib64/python3.8/subprocess.py\", line 415, in check_output\n return r
un(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n File \"/usr/lib64/python3.8/subprocess.py\", line 516, in run\n
raise CalledProcessError(retcode, process.args,\nsubprocess.CalledProcessError: Command '['lxc-info', '-n', 'Debian', '-p',
'-s', '-S']' returned non-zero exit status 1.\n")
[W] unknown:12 - file:///usr/share/harbour-containers/qml/harbour-containers.qml:12:5: QML Daemon: QDBusError("org.freedeskto
p.DBus.Python.subprocess.CalledProcessError", "Traceback (most recent call last):\n File \"/usr/lib64/python3.8/site-package
s/dbus/service.py\", line 711, in _message_cb\n retval = candidate_method(self, *args, **keywords)\n File \"/usr/share/ha
rbour-containers/service/daemon.py\", line 477, in get_containers\n self._refresh()\n File \"/usr/share/harbour-container
s/service/daemon.py\", line 115, in _refresh\n self.containers = lxc.get_containers()\n File \"/usr/share/harbour-contain
ers/service/libs/lxc.py\", line 41, in get_containers\n cmd_out = subprocess.check_output(['lxc-info', '-n', container,'-p
','-s','-S']).decode().split(\"\\n\")\n File \"/usr/lib64/python3.8/subprocess.py\", line 415, in check_output\n return r
un(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n File \"/usr/lib64/python3.8/subprocess.py\", line 516, in run\n
raise CalledProcessError(retcode, process.args,\nsubprocess.CalledProcessError: Command '['lxc-info', '-n', 'Debian', '-p',
'-s', '-S']' returned non-zero exit status 1.\n")
I guess there is something leftover from the debian container, how can I delete it?
I wanted to add an Alpine container but during setup it froze. After I killed the app and opened it again the main screen is now blank. I have already deleted the Alpine LXC files but it seems like the app is still looking for them even after a reinstall. How can I reset everything?
Below is the terminal output from launching the app:
[D] unknown:0 - Using Wayland-EGL
[D] onCompleted:12 - DB created.
[W] unknown:12 - file:///usr/share/harbour-containers/qml/harbour-containers.qml:12:5: QML Daemon: QDBusError("org.freedesktop.DBus.Python.subprocess.CalledProcessError", "Traceback (most recent call last):\n File \"/usr/lib/python3.8/site-packages/dbus/service.py\", line 711, in _message_cb\n retval = candidate_method(self, *args, **keywords)\n File \"/usr/share/harbour-containers/service/daemon.py\", line 475, in get_containers\n self._refresh()\n File \"/usr/share/harbour-containers/service/daemon.py\", line 113, in _refresh\n self.containers = lxc.get_containers()\n File \"/usr/share/harbour-containers/service/libs/lxc.py\", line 41, in get_containers\n cmd_out = subprocess.check_output(['lxc-info', '-n', container,'-p','-s','-S']).decode().split(\"\\n\")\n File \"/usr/lib/python3.8/subprocess.py\", line 415, in check_output\n return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n File \"/usr/lib/python3.8/subprocess.py\", line 516, in run\n raise CalledProcessError(retcode, process.args,\nsubprocess.CalledProcessError: Command '['lxc-info', '-n', 'Alpine', '-p', '-s', '-S']' returned non-zero exit status 1.\n")
The incoming calls do not ring when the LXC is running. Even if I stop the container, the sound doesn't come back. I need to reboot the phone for that.
This is a little glitch in the GUI. When I open the 'advanced controls' option only half of the 'init container config' button is visible. (The screen is not tall enough to display the whole button.) And when I manage to tap on the button, the button disappears. (More precisely the button is still there I guess, only its position is "outside" of the screen's view.)
xsession setup
setup process seems to work fine using debian.sh
xsession start
Xwayland immediately crash after connecting to qxdisplay's socket
start_desktop.sh output on ubuntu eoan:
root@ubu-xfce:/# /mnt/guest/start_desktop.sh 5 user
glamor: 'wl_drm' not supported
Missing Wayland requirements for glamor GBM backend
Failed to initialize glamor, falling back to sw
xinit: XFree86_VT property unexpectedly has 0 items instead of 1
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning: Unsupported maximum keycode 774, clipping.
> X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
xinit: connection to X server lost
waiting for X server to shut down ....
......
xinit: X server slow to shut down, sending KILL signal
waiting for server to die
When I uninstall the harbour-containers app, it leaves some files in the '/usr/share/harbour-containers/service/libs/__ pycache__':
init.cpython-38.pyc
lxc.cpython-38.pyc
qxcompositor.cpython-38.pyc
It also leaves the configuration of the created container in the '/var/lib/lxc/' folder and doesn't remove the files from the '/home/.lxc' folder.
I know these folders/files are kept because of SFOS' uninstall working order, but if you could include a button that runs a script, that is doing housekeeping before somebody decides to uninstall the app, that would be beneficial. (The downloaded data in 'home/.lxc' can be painful as eating a lot of storage.)
sudo
and run the debian.sh
script from https://talk.maemo.org/showthread.php?t=101080X session
If there is no password set for device lock, the gui doesn't create containers. (Once I set up a device lock, it works.)
Some devices can run Alien Dalvik, but there are some limitations such as no Bluetooth or no camera, and not all devices have an AD version. I believe @0312birdzhang has been working on porting Anbox to SailfishOS because I saw some rpms on OBS, but as far as I understand it is not working yet.
I was stumbling upon this article: https://stgraber.org/2013/12/23/lxc-1-0-some-more-advanced-container-usage/
This looks interesting, Would the part on "Android containers" work with sailfish-containers
? @0312birdzhang, what do you think?
I pasted the corresponding section below:
I’ve often been asked whether it was possible to run Android in an LXC container. Well, the short answer is yes. However it’s not very simple and it really depends on what you want to do with it.
The first thing you’ll need if you want to do this is get your machine to run an Android kernel, you’ll need to have any modules needed by Android built and loaded before you can start the container.
Once you have that, you’ll need to create a new container by hand.
Let’s put it in /var/lib/lxc/android/
, in there, you need a configuration file similar to this one:
lxc.rootfs = /var/lib/lxc/android/rootfs
lxc.utsname = armhf
lxc.network.type = none
lxc.devttydir = lxc
lxc.tty = 4
lxc.pts = 1024
lxc.arch = armhf
lxc.cap.drop = mac_admin mac_override
lxc.pivotdir = lxc_putold
lxc.hook.pre-start = /var/lib/lxc/android/pre-start.sh
lxc.aa_profile = unconfined
/var/lib/lxc/android/pre-start.sh
is where the interesting bits happen. It needs to be an executable shell script, containing something along the lines of:
#!/bin/sh
mkdir -p $LXC_ROOTFS_PATH
mount -n -t tmpfs tmpfs $LXC_ROOTFS_PATH
cd $LXC_ROOTFS_PATH
cat /var/lib/lxc/android/initrd.gz | gzip -d | cpio -i
# Create /dev/pts if missing
mkdir -p $LXC_ROOTFS_PATH/dev/pts
Then get the initrd for your device and place it in /var/lib/lxc/android/initrd.gz
.
At that point, when starting the LXC container, the Android initrd will be unpacked on a tmpfs (similar to Android’s ramfs) and Android’s init will be started which in turn should mount any partition that Android requires and then start all of the usual services.
Because there are no apparmor
, cgroup
or even network configuration applied to it, the container will have a lot of rights and will typically completely crash the machine. You unfortunately have to be familiar with the way Android works and not be afraid to modify its init scripts if not even its init process to only start the bits you actually want.
I can’t provide a generic recipe there as it completely depends on what you’re interested on, what version of Android and what device you’re using. But it’s clearly possible to do and you may want to look at Ubuntu Touch to see how we’re doing it by default there.
One last note, Android’s init script isn’t in /sbin/init
, so you need to tell LXC where to load it with:
lxc-start -n android -- /init
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.