Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

line 164: /etc/systemd/system/anbox-container-manager.service.d/override.conf: Permission denied #76

Open
englianhu opened this issue Dec 1, 2021 · 6 comments

Comments

@englianhu
Copy link

englianhu commented Dec 1, 2021

Install Anbox.

+ sudo apt install anbox
+ sudo apt install android-tools-adb
+ sudo apt install lzip

1st attempt error:

+ wget -O -  https://raw.githubusercontent.com/geeks-r-us/anbox-playstore-installer/master/install-playstore.sh | bash
2021-12-02 07:07:39--  https://raw.githubusercontent.com/geeks-r-us/anbox-playstore-installer/master/install-playstore.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11661 (11K) [text/plain]
Saving to: ‘STDOUT’

                     100%[======================>]  11.39K  --.-KB/s    in 0s      

2021-12-02 07:07:54 (37.9 MB/s) - written to stdout [11661/11661]

Creating /etc/systemd/system/anbox-container-manager.service.d/ directory
- bash: line 164: /etc/systemd/system/anbox-container-manager.service.d/override.conf: Permission denied

2nd attempt error:

Added sudo as sudo wget -O - https://raw.githubusercontent.com/geeks-r-us/anbox-playstore-installer/master/install-playstore.sh | bash doesn't work as well, same permission error.

3rd attempt error:

+ wget https://raw.githubusercontent.com/geeks-r-us/anbox-playstore-installer/master/install-playstore.sh
2021-12-02 07:41:07--  https://raw.githubusercontent.com/geeks-r-us/anbox-playstore-installer/master/install-playstore.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.111.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11661 (11K) [text/plain]
Saving to: ‘install-playstore.sh’

install-playstore.sh  100%[=========================>]  11.39K  --.-KB/s    in 0s      

2021-12-02 07:41:23 (26.2 MB/s) - ‘install-playstore.sh’ saved [11661/11661]
+ chmod +x install-playstore.sh
+ ./install-playstore.sh
- ./install-playstore.sh: line 164: /etc/systemd/system/anbox-container-manager.service.d/override.conf: Permission denied

4th attempt error:

+ sudo ./install-playstore.sh
- /var/lib/anbox/rootfs-overlay
- Overlay no enabled ! Please check error messages!

Desktop (please complete the following information):

lsb_release -a
LSB Version:    core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

Additional context

Wonder why chmod +x install-playstore.sh doesn't granted permission?


References

@englianhu
Copy link
Author

englianhu commented Dec 2, 2021

Content

If you ever rebooted your ubuntu, you may get that failure.

  1. run sudo modprobe binder_linux and sudo modprobe ashmem_linux

If it fails, try the following way:

  1. go to /usr/src/anbox-modules-ashmem-6~xenial1 and usr/src/anbox-modules-binder-6~xenial1,
    run make & make install
    ps: the directory name may vary according to the module version and system.
  2. sudo insmod /binder_linux.ko & sudo insmod /ashmem_linux.ko

source: anbox/anbox#211 (comment)


no such files or directory /usr/src/anbox********************

source: anbox/anbox#211 (comment)

same with me, no such folder


I have installed these and it worked:

:~$ sudo add-apt-repository ppa:morphis/anbox-support
:~$ sudo apt update
:~$ sudo apt install anbox-modules-dkms

Then run the anbox session-manager as service and then start anbox application manager

source: anbox/anbox#211 (comment)

By refer to above and run, then the error shown as below.

+ :~$ sudo add-apt-repository ppa:morphis/anbox-support
...
...
...
- Err:50 http://ppa.launchpad.net/morphis/anbox-support/ubuntu focal Release             
-   404  Not Found [IP: 91.189.95.85 80]
Hit:29 https://github.com/retorquere/zotero-deb/releases/download/apt-get ./ InRelease 
Reading package lists... Done                           
- E: The repository 'http://ppa.launchpad.net/morphis/anbox-support/ubuntu focal Release' does not have a Release file.
- N: Updating from such a repository can't be done securely, and is therefore disabled by default.
- N: See apt-secure(8) manpage for repository creation and user configuration details.
+ :~$ sudo apt install anbox-modules-dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
- E: Unable to locate package anbox-modules-dkms

As we know from below, sudo anbox-installer and then refered to https://github.com/anbox/anbox/blob/master/docs/install.md doesn't work.

+ :~$ sudo anbox-installer
The anbox-installer is deprecated. Please find updated installation
instructions here https://github.com/anbox/anbox/blob/master/docs/install.md

For any further questions please ask on the #anbox IRC channel on the
FreeNode network or in the Anbox telegram group (https://t.me/anbox).
+ :~$ sudo modprobe ashmem_linux
- modprobe: ERROR: could not insert 'ashmem_linux': Operation not permitted
+ :~$ sudo mokutil --sb-state
SecureBoot enabled
+ :~$ ls -1 /dev/{ashmem,binder}
- ls: cannot access '/dev/ashmem': No such file or directory
- ls: cannot access '/dev/binder': No such file or directory
+ :~$ lsmod |grep linux                    
binder_linux          196608  0

Reference

  1. Failed to start as either binder or ashmem kernel drivers are not loaded anbox/anbox#211
  2. Anbox remains "starting" but never actually starts anbox/anbox#367
  3. anbox session-manager [ 2021-06-16 20:46:21] [session_manager.cpp:133@operator()] Failed to start as either binder or ashmem kernel drivers are not loaded anbox/anbox#1835
  4. https://askubuntu.com/questions/909629/how-to-launch-anbox#_=_
  5. https://askubuntu.com/questions/903924/anbox-isnt-starting-up-on-my-pc-at-all/903959#903959
  6. https://bugs.launchpad.net/ubuntu/+source/anbox/+bug/1884810
  7. https://github.com/anbox/anbox/blob/master/docs/install.md
  8. If wanting to run Anbox on Ubuntu 20.04 with Secure Boot enabled (which is possible!), must use “kmodsign” for the “ashmem” module anbox/anbox#1570

@englianhu
Copy link
Author

englianhu commented Dec 3, 2021

$ snap set anbox rootfs-overlay.enable=true
$ snap restart anbox.container-manager

Source: https://docs.anbox.io/userguide/advanced/rootfs_overlay.html

Refered to above link (enable and also grant permission sudo chown -R...) doesn't work.


It worked for me:

  1. First run
sudo mkdir /etc/systemd/system/anbox-container-manager.service.d/
  1. Open install-playstore.sh in editor
  2. Search for the following snippet:
if ( [ -d '/var/snap' ] || [ -d '/snap' ] ) && \
	( [ ${ANBOX} = "/snap/bin/anbox" ] || [ ${ANBOX} == /var/lib/snapd/snap/bin/anbox ] );then
  1. Change it to this (remove the second set of conditions)
if ( [ -d '/var/snap' ] || [ -d '/snap' ] );then

Source: #49 (comment)

Changed above 2 lines (133 & 134) and ./install-playstore.sh is work !

@englianhu
Copy link
Author

englianhu commented Dec 3, 2021

:~$ ./install-playstore.sh installed as mentioned in https://github.com/geeks-r-us/anbox-playstore-installer/issues/76#issuecomment-985556238`

:~$ anbox.appmgr
[ 2021-12-03 14:26:09] [daemon.cpp:61@Run] Failed to connect to DBus

Source: https://www.how2shout.com/linux/how-to-install-anbox-on-ubuntu-20-04-lts-focal-fossa

EGL_PLATFORM=x11 anbox.appmgr by refer to anbox/anbox#1889 doen't work.


you do not need the ppa on ubuntu 20.04, you can skip ahead to

sudo snap install --edge --devmode anbox

Can I install it without the-devmode flag

no, snap will complain that the maintainer has not deemed it ready, in the current state we still need the devmode flag

Ok thanks.....

Source: anbox/anbox#1886 (comment)

Refer to above doesn't work as well.


when i run EGL_PLATFORM=x11 anbox session-manager but no output is coming so i opened another terminal at same time an ran EGL_PLATFORM=x11 anbox.appmgr but output is [ 2021-08-28 03:49:56] [launch.cpp:202@operator()] Session manager failed to become ready

Source: anbox/anbox#1889 (comment)

+ :~$ anbox.appmgr[ 2021-12-03 17:53:39] [launch.cpp:168@operator()] Session manager is not yet running, trying to start it
[ 2021-12-03 17:53:39] [launch.cpp:117@launch_session_manager] Started session manager, will now try to connect ..
[ 2021-12-03 17:53:39] [splash_screen.cpp:55@SplashScreen] Window has no associated renderer yet, creating one ...
- [ 2021-12-03 17:54:29] [daemon.cpp:61@Run] [org.freedesktop.DBus.Error.ServiceUnknown] The name org.anbox was not provided by any .service files

Above doesn't work as well, and then trying to check systemctl --user status anbox-session-manager.

+ :~$ systemctl --user status anbox-session-manager
● anbox-session-manager.service - Anbox Session Manager
     Loaded: loaded (/usr/lib/systemd/user/anbox-session-manager.service>
-      Active: failed (Result: exit-code) since Sat 2021-12-04 04:09:03 JS>
       Docs: man:anbox(1)
   Main PID: 145127 (code=exited, status=1/FAILURE)

Dec 04 04:09:03 Scibrokes-Trading systemd[1942]: Started Anbox Session M>
- Dec 04 04:09:03 Scibrokes-Trading anbox[145127]: Failed to start as eith>
Dec 04 04:09:03 Scibrokes-Trading systemd[1942]: anbox-session-manager.s>
Dec 04 04:09:03 Scibrokes-Trading systemd[1942]: anbox-session-manager.s>

sudo apt install build-essential cmake cmake-data debhelper dbus google-mock \
    libboost-dev libboost-filesystem-dev libboost-log-dev libboost-iostreams-dev \
    libboost-program-options-dev libboost-system-dev libboost-test-dev \
    libboost-thread-dev libcap-dev libexpat1-dev libsystemd-dev libegl1-mesa-dev \
    libgles2-mesa-dev libglm-dev libgtest-dev liblxc1 \
    libproperties-cpp-dev libprotobuf-dev libsdl2-dev libsdl2-image-dev lxc-dev \
    pkg-config protobuf-compiler python3-minimal

Source: https://github.com/anbox/anbox

Information about the currently available versions of the snap is available via snap info anbox by refer to https://docs.anbox.io/userguide/install.html#install-kernel-modules / https://github.com/anbox/anbox/blob/master/docs/install.md#verify-that-kernel-modules-are-loaded


synapse is a semantic launcher that takes advantage of zeitergeist to open recent files and to launch applications
to make use of it download by right clicking below and selecting "save link as"
download
save it in your downloads folder and run the following commands:

sudo mv ~/Downloads/synapse.service /etc/systemd/user/synapse.service
systemctl --user start synapse
systemctl --user enable synapse

if synapse is runnning properly you should be able to trigger it with it's shortcut, that is ctrl+space

Source: https://github.com/Fuseteam/systemd-service-files

@janranz
Copy link

janranz commented Dec 5, 2021

have you tried manually modifying the permissions of anbox-container-manager.service.d/?

Was facing the same error. As reckless as it may seem chmod a+w anbox-container-manager.service.d allowed the script to execute successfully as suggested here.

@englianhu
Copy link
Author

englianhu commented Dec 10, 2021

:~$ chmod a+w anbox-container-manager.service.d
chmod: cannot access 'anbox-container-manager.service.d': No such file or directory
:~$ ls anbox-container-manager.service.d            
ls: cannot access 'anbox-container-manager.service.d': No such file or directory
:~$ find | grep 'anbox-container-manager.service*'
find:./anbox-work/squashfs-root/storage: Permission denied
find:./anbox-work/squashfs-root/config: Permission denied
find:./anbox-work/squashfs-root/cache: Permission denied
find:./anbox-work/squashfs-root/data: Permission denied
find:./anbox-work/squashfs-root/system/lost+found: Permission denied
find:./anbox-work/squashfs-root/sbin: Permission denied
+:~$ systemctl --user status anbox-session-manager
● anbox-session-manager.service - Anbox Session Manager
     Loaded: loaded (/etc/xdg/systemd/user/anbox-session-manager.service; enab>
+     Active: failed (Result: exit-code) since Tue 2021-12-14 19:17:37 JST; 2mi>
   Main PID: 40696 (code=exited, status=1/FAILURE)

Dec 14 19:17:37 Scibrokes-Trading systemd[2253]: Started Anbox Session Manager.
Dec 14 19:17:37 Scibrokes-Trading anbox[40696]: Failed to start as either bind>
Dec 14 19:17:37 Scibrokes-Trading systemd[2253]: anbox-session-manager.service>
Dec 14 19:17:37 Scibrokes-Trading systemd[2253]: anbox-session-manager.service>
+:~$ systemctl --user status synapse● synapse.service - synapse service
     Loaded: loaded (/etc/xdg/systemd/user/synapse.service; enabled; vendor pr>
+     Active: active (running) since Tue 2021-12-14 19:17:49 JST; 2min 34s ago
   Main PID: 40836 (synapse)
     Memory: 38.6M
     CGroup: /user.slice/user-1000.slice/user@1000.service/synapse.service
             └─40836 /usr/bin/synapse --startup --display=:0

Dec 14 19:17:49 Scibrokes-Trading systemd[2253]: Started synapse service.

By refered from https://github.com/englianhu/systemd-service-files

@runswithd6s
Copy link

The current error on line 164 is that the cat command is being executed with sudo, but the subsequent redirect is being executed as the current user's permission, and is thus unable to write to the file. kwart's method works nicely, but if you don't want to also see the output, you can wrapper a shell command for the redirect: sudo sh -c 'cat >OUTPUT_PATH'<<-EOF...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants