Wednesday, June 6, 2018

HostBridge and permissions headaches on Linux (solved!)

I've been informed on AROS-EXEC that with current Icaros releases, Hostbridge doesn't work as expected on Linux. Adding a host program ends up in this Lua error:

lua:amiluaS:Replacer.lua:161attempt to index global 'filehdl' (a nil value) stack traceback:
S:Replacer.lua:161in main chunk
[C]:  in ?

This is not, obviously, the expected behavior. After some tests with Linux, Windows and older releases, I finally discovered that the root cause of the problem was wrong grants on the SYS:System/Hosted drawer (and files) from the Linux side. In practice, when the Linux-hosted install script of Icaros Desktop copies Hostbridge files from the installation media, it preserves their read-only nature and does not add the correct +RW flags to them. I've fixed the issue adding proper chmod commands to the install script and, while I were at it, I've also added some missing redirections to >NIL: which caused scripts to show unwanted AROS shell outputs, during first-time configuration of hosted Icaros.

Hotsbridge now works correctly on Linux
If you've already installed Icaros Desktop 2.2.2 onto your Linux system, you can fix the issue by opening a shell, and changing directory to your IcarosDesktop drawer

cd /your/path/to/IcarosDesktop

and then running this command:

chmod -R +rw System/Hosted

Another permissions issue I've been informed about, although completely unrelated, is crashing hosted Icaros on Linux, when using Wanderer. AROS' default file manager does not seem to be able to show the HOST: drive (mapped to Linux root '/' directory) and crashes hard, forcing the user to kill the AROSBootstrap process from the Linux side:

[KRN] Trap signal 11, SysBase 985d01e0, KernelBase 985d0f20
    SP=9905595c  FP=990559f8  PC=00363ba7
    R0=00000000  R1=98693130  R2=ffffffc8  R3=986961d0
    R4=99a87350  R5=000000d4

The workaround for this is starting Icaros launch script with the sudo command, although I totally discourage it. Please notice that sudoing Icaros Desktop would grant root access to the whole system, so any badly-written command or script ran by Hostbridge might harm it considerably. For the time being, I suggest to use Magellan instead (as by default on Icaros Desktop).


Neil Cafferkey has fixed this issue. You can find the necessary files here:

Running Icaros as root, or with the sudo command, lets Wanderer show Host: contents, but we heavily discourage this.

Both corrections will be added to Icaros Desktop 2.2.3.