Android and LXC

Hi,

I have a Sony xperia 1 ii and currently have a ubuntu chroot set up. This setup has some sbort comings, cant install snap packages and if i plug in a flash drive, i need to manually mount it.

I have the stock android and i have checked on claude and it tells me i do not have the correct flags enabled for LXC to function.

Does anyone here have LineageOS installed? Does stock LineageOS have the correct flags enabled for lxc?

If not, i understand i need to compile my own linage os kernel with the correct flags. I want to double check what those flags are. Is there a list available?

Thank you,

LineageOS would require quite some effort to get the Linux kernel to work with LXC, in terms of re-compiling the Linux kernel with the appropriate features, then generating a bootloader image and flashing the bootloader image.

Perhaps an easier option would be to check whether PostmarketOS can be installed on the phone. Because PostmarketOS is just a Linux distribution (no Android environment) and uses a recent or latest version of the Linux kernel.
Have a look at Making sure you're not a bot!

I have had a look at postmarket but according to the wiki, it can only be installed on the sd card and most of the phone’s features dont work. So i dont think its a viable option at this time.

If i do set up a lxc with Ubuntu, and i plug in a flash drive, will ubuntu automatically see it or ill have to mount it manually?

Sounds like https://xyproblem.info/

@Captain please describe the original problem you want to solve.

You are asking @Captain about the original problem.
The request is to run LXC onto a certain Android phone, probably using the stock firmware.

You are asking why they need to run LXC on an Android phone. Because such a request, although technically possible, is not a common request. They have already installed a Linux runtime on the phone, which should solve most use-cases of running Linux on a phone. With LXC (and certain additional kernel/userspace support), it would be possible to run several separate and independent Linux runtimes on the device. That’s the main benefit of LXC. Therefore, is there a requirement to run several separate and independent Linux runtimes on the same actual device?

The idea is to get a full Ubuntu experience on a old phone that i can make use of

My current chroot setup works but it does not work with snap and some other programs, because it had some limitations that are too technical for me to explain.

A LXC seems to be the closest option but i did some research, hoping with LXC i could plug and play flash drives and harddrives, but it turns out i need to mount them manually and that this may be more difficult than in the chroot setup. So i am thinking now it may not be worth it to follow the LXC route.

However i did have a even older android 8/9 phone which i can root and i am thinking of modifying its kernel and flashing the correct flags so i can enable LXC, to just try it out, and maybe even just because i can be happy with myself if i acheived that.