termux-archlinux icon indicating copy to clipboard operation
termux-archlinux copied to clipboard

Userspace mount

Open gordol opened this issue 3 years ago • 6 comments

The discussion over here got locked...

https://github.com/termux/termux-app/issues/376

but

https://libguestfs.org/

it is possible...

Sorry if this isn't the best way to contact you.

Good luck!

gordol avatar Dec 02 '20 12:12 gordol

Thank you for contributing to make this project better😎 Keep up and follow to solve this issue.

github-actions[bot] avatar Dec 02 '20 13:12 github-actions[bot]

Thank you for contributing to make this project better😎 Keep up and follow to solve this issue.

github-actions[bot] avatar Dec 09 '20 16:12 github-actions[bot]

Thank you for sharing that the libguestfs project exists @gordol; have you tried the command yay libguestfs?

[user11:42~]$ yay libguestfs
2 aur/libguestfs-git 1.42.0.r21.g4837698d8-1 (+0 0.00)
    Access and modify virtual machine disk image
1 aur/python-libguestfs 1.40.2-1 (+1 0.00)
    Python bindings for libguestfs
==> Packages to install (eg: 1 2 3, 1-3 or ^4)
==>

It appears that there are two versions of libguestfs via yay. To create the yay command, you can use either makeaurhelpers or makeyay which attempt to build yay in Termux PRoot, with or without QEMU emulated architecture support.

SDRausty avatar Dec 09 '20 17:12 SDRausty

got locked

Because you found the solution we seek. Integrating this code with PRoot like the QEMU option should probably solve the mount issue.

I have tried yay guestfs multiple times. I am not getting a successful package build. Are you having any luck building the Arch Linux guestfs packages in Termux PRoot?

SDRausty avatar Dec 10 '20 23:12 SDRausty

citing Originally posted by @xeffyr in https://github.com/termux/termux-app/issues/376#issuecomment-737185447

Look my answers above. No one here will bother to implement a tool for userspace image mounting. Please understand that possibilities of Termux maintainers are finite.

Those who really needs mounting as non-root can use QEMU system-mode.

citing Originally posted by @xeffyr in https://github.com/termux/termux-packages/issues/6141#issuecomment-743797540

Start with these:

  • x86 (32bit): https://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86/alpine-virt-3.12.2-x86.iso
  • x86_64 (64bit): https://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/alpine-virt-3.12.2-x86_64.iso

Boot downloaded image (basic):

qemu-system-i386 -m 512M -nographic -cdrom alpine-virt-3.12.2-x86.iso

Modified to boot from URL with no local image:

qemu-system-i386 -m 512M -nographic -boot d -drive file=https://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86/alpine-virt-3.12.2-x86.iso,readonly=on,media=cdrom

In both cases output is printed directly to console as image supports serial line emulated by QEMU. CTRL+a x to terminate VM.

qemu

Extending command line by switching to VirtIO devices (rng, nic, drives), increasing TCG cache (e.g. by -accel tcg,tb-size=512), using musl-based & non-systemd distributions like Alpine Linux makes execution under QEMU faster.


Arch Linux can be booted too, yet it is slower and ISO will require many RAM (1-2 GB, maybe more). Probably will have issues with text-only mode and you will need a VNC.

SDRausty avatar Dec 13 '20 14:12 SDRausty

it is possible...

@gordol it seems to be possible to build libguestfs with command makelibguestfs; Can you please try command makelibguestfs and share your results?

SDRausty avatar Jun 14 '22 04:06 SDRausty

Stale issue message

github-actions[bot] avatar Aug 14 '22 01:08 github-actions[bot]

silly bot. I'll try this soon, thanks @SDRausty

gordol avatar Aug 22 '22 01:08 gordol