Linux subsystem
Provides 100% CPU,RAM,GPU performance same as running Linux natively. OpenGL and Vulkan works. X11 renders directly using KMS/DRM to screen.
But you have access to two OS simultaneously this way with less resource consumption unlike other methods like VMs/containers.
- Have an Linux installation on the same machine.
- Copying
/run/udev
from a booted Linux to the chroot rootfs or Xorg doesn’t recognize keyboard and mouse
Boot into the Linux installation and copy /run/udev
cp -a /run/udev ~/Documents
Then after rebooting and chroot into linux from Android, symlink it to /run
ln -s ~/Documents/udev /run/
Make a simple script to chroot into it, this can be taken for reference.
#!/data/adb/ksu/bin/busybox shUSER=user# If already mountedtest -f /mnt/arch/etc/os-release && exec chroot /mnt/arch /bin/su $USER -l "$@"[ ! -d /mnt/arch ] && mkdir /mnt/arch# Partition containing root file systemmount /dev/block/nvme0n1p2 /mnt/arch -o noatime# EFI system partition (optional)mount /dev/block/nvme0n1p1 /mnt/arch/bootcd /mnt/arch
mount -t proc proc proc/ -o nosuid,noexec,nodevmount -t sysfs sys sys/ -o nosuid,noexec,nodevmount -o bind /dev dev/ -o mode=0755,nosuidmount -o bind /system/lib/modules usr/lib/modulesmount -o rw,nosuid,noexec,gid=5,mode=620,ptmxmode=000 -t devpts devpts dev/ptsmount -t tmpfs tmpfs tmp/
mkdir dev/shm && mount -t tmpfs shmfs dev/shm -o rw,nosuid,nodev,inode64chmod 777 tmp dev/shm
# For X11 serverchroot /mnt/arch /bin/chown -hR $USER /dev/input /dev/dri /dev/tty1 /dev/tty2ls /dev/nvme0n1p2 2>/dev/null || ln -s /dev/block/* /dev/# Usually your router IP address, required for networkingecho nameserver 192.168.1.1 > etc/resolv.confexec chroot /mnt/arch /bin/su $USER -l "$@"
openvt requires busybox, we can use the binary from KernelSU.
In a root shell:
/data/adb/ksu/bin/busybox openvt -s /path/to/arch-chroot.sh
Now you should enter a tty with the login shell.
Use Alt+F7 / Alt+F1 / Alt+(left/right) arrow keys to switch between Android and Linux.
If you have xinitrc configured:
dbus-run-session startx
Ctrl+Alt+F7 / Ctrl+Alt+F1 to switch between Android and Linux.