Giter Site home page Giter Site logo

linuxruntime's Introduction

Linux Runtime

Debian userland contained within a compressed read-only disk image for use with compat.linux.emul_path.

helloSystem comes with a utility to download and install the runtime.

image

Background

FreeBSD comes with the Linuxulator, an implementation of Linux APIs on top of the FreeBSD kernel. This is not emulation and does not slow down execution. It is just an additional set of APIs available on FreeBSD. To run applications made for Linux, a Linux userland must be available. The FreeBSD Ports and Packages contain a CentOS el7 based userland. Desktop applications, however, are mostly optimized to run on Ubuntu. And since Ubuntu is based on Debian, that his what we are using for the Linux Runtime in helloSystem.

License

The components contained in the compressed filesystem image are subject to their respective license terms; please see /usr/share/doc/ inside the compressed filesystem image for more information.

linuxruntime's People

Contributors

probonopd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cneira

linuxruntime's Issues

Cosmetic: LD_PRELOAD cannot be preloaded (ELF file OS ABI invalid): ignored

In helloSystem we are using LD_PRELOAD to load a library into each application.

Natually this does not work for Linux binaries, resulting in lots of these errors:

ERROR: ld.so: object '/usr/local/lib/libQKeySequenceOverride.so.1.0.0' from LD_PRELOAD cannot be preloaded (ELF file OS ABI invalid): ignored.

Is there a way to tell the Linuxulator not to LD_PRELOAD non-Linux libraries into Linux binaries?

cc @trasz

Make PulseAudio unnecessary

Currently PulseAudio needs to run on the FreeBSD for sound to work (e.g., in Spotify).
It would be nice if this requirement could be dropped, e.g., by having a tiny extension to the FreeBSD sound system that would mimic the parts of PulseAudio the Linuxulator needs for sound to work.

This work is outside of the scope of helloSystem, but we would like to incorporate it once a solution exists.

libfontconfig.so.1: undefined symbol: FT_Done_MM_Var

Debian 11 Bullseye (Build 4) has the following issue:

./AppRun: symbol lookup error: /usr/lib/x86_64-linux-gnu/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var

Debian 11 Bullseye (Build 3) did not have the issue.

How can it be that such things break from one build to the next?

I am so sick and tired of this kind of BS.

Just confirming that the proposed fix of excluding libharfbuzz.so.0 and libfreetype.so.6 from the AppImage works for me as well to get my own AppImage of Peek run again on Arch.

See which files in the Linux userland are actually used

I would like to see which files in the Linux userland are actually used so that I can slim down the set of shipped files accordingly.

According to https://forums.FreeBSD.org/threads/linux-compatability-monitor-files-accessed-by-linux-app.62029/post-358476 this should work but it doesn't:

FreeBSD% sudo kldload dtrace
FreeBSD% sudo dtrace -n ':linux64:linux_open:entry { printf("%s", copyinstr((uintptr_t)args[1]->path)); }'
dtrace: invalid probe specifier :linux64:linux_open:entry { printf("%s", copyinstr((uintptr_t)args[1]->path)); }: probe description :linux64:linux_open:entry does not match any probes

According to https://wiki.freebsd.org/DTrace/One-Liners this should

Trace file opens with process and filename:

FreeBSD% sudo dtrace -n 'syscall::open*:entry { printf("%s %s", execname, copyinstr(arg0)); }'
dtrace: invalid probe specifier syscall::open*:entry { printf("%s %s", execname, copyinstr(arg0)); }: probe description syscall::open*:entry does not match any probes

What am I missing?

Make the Chrome sandbox work

On Debian it needs sysctl -w kernel.unprivileged_userns_clone=1 but on FreeBSD we get /proc/sys/kernel/unprivileged_userns_clone: No such file or directory.

Workaround:
Launch Chromium/Electron based applications with --no-sandbox --no-zygote --test-type --v=0 "$@". Which is not ideal because a) it disables the sandbox b) it shows a warning message in some application GUIs, confusing users c) many existing AppImages don't come like that

cc @trasz

Reference:
https://wiki.freebsd.org/LinuxApps

E.g., REAPER: failed to load driver: swrast

Cannot launch e.g, REAPER with the Debian Runtime (at least on a machine with a Nvidia GPU). Terminal shows:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

TODO: Check whether it works on non-Nvidia (e.g., Intel) machines?

Could installing mesa-utils and libgl1-mesa-glx in the Linux userland improve this? Would we also need to install Nvidia drivers on the Linux userland side?

FreeBSD% strings /media/.debian/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so | grep 'lib.*so.*' 
libglapi.so.0
libdrm.so.2
libLLVM-11.so.1
libexpat.so.1
libz.so.1
libzstd.so.1
libdl.so.2
libsensors.so.5
libdrm_radeon.so.1
libelf.so.1
libdrm_amdgpu.so.1
libdrm_nouveau.so.2
libvulkan.so.1
libstdc++.so.6
libm.so.6
libgcc_s.so.1
libpthread.so.0
libc.so.6s
libgallium_dri.so

It seems like Nouveau is hardcoded in swrast_dri.so in the Linux userland rather than the official Nvidia driver?

(if we can't find a solution, we may need to contact Aaron Plattner at Nvidia who knows about these things)

/usr/local/sbin/debootstrap: Permission denied

Why are we getting /usr/local/sbin/debootstrap: Permission denied all of a sudden?

+ /usr/local/sbin/debootstrap '--arch=amd64' --no-check-gpg bullseye /compat/debian
./prepare-debian-userland.sh: /usr/local/sbin/debootstrap: Permission denied
+ bail 'debootstrap failed'
+ [ 1 -gt 0 ]
+ echo 'prepare-debian-userland.sh: Error: debootstrap failed'
prepare-debian-userland.sh: Error: debootstrap failed

Install/configure locales

FreeBSD% ./SuperSlicer-ubuntu_18.04-gtk2-2.4.58.2.AppImage --appimage-extract-and-run
Initializing StaticPrintConfigs
An error occured while setting up locale.
You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands.
SuperSlicer will now terminate.

locale::facet::_S_create_c_locale name not valid

Workaround:

FreeBSD% export LOCALE=C
FreeBSD% export LANG=C  
FreeBSD% ./SuperSlicer-ubuntu_18.04-gtk2-2.4.58.2.AppImage --appimage-extract-and-run

libEGL.so.1 should be bundled

Ultimaker-Cura-5.0.0-beta+1-linux.AppImage fails with

Traceback (most recent call last):
  File "cura_app.py", line 27, in <module>
  File "PyInstaller/loader/pyimod03_importers.py", line 495, in exec_module
  File "cura/CrashHandler.py", line 24, in <module>
    from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit, QGroupBox, QCheckBox, QPushButton
ImportError: libEGL.so.1: cannot open shared object file: No such file or directory
[3672] Failed to execute script 'cura_app' due to unhandled exception!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.