Trying to install anbox, but "anbox-installer: command not found"

I’m trying to install Anbox. (anbox.io)

I first install snap
From https://snapcraft.io/docs/core/install-ubuntu, I learn to to the following command (in bold):

sudo apt install snapd

Terminal prints out the following (in preformatted text):

[sudo] password for me: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gyp libjs-inherits libjs-node-uuid libjs-underscore libssl-dev libuv1
  libuv1-dev zlib1g-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  apparmor libapparmor-perl snap-confine squashfs-tools
Suggested packages:
  apparmor-profiles apparmor-profiles-extra apparmor-docs apparmor-utils
The following NEW packages will be installed:
  apparmor libapparmor-perl snap-confine snapd squashfs-tools
0 upgraded, 5 newly installed, 0 to remove and 35 not upgraded.
Need to get 9,371 kB of archives.
After this operation, 53.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

I type “Y” for yes.

Get:1 http://gpl.savoirfairelinux.net/pub/mirrors/ubuntu xenial-updates/main amd64 libapparmor-perl amd64 2.10.95-0ubuntu2.6 [31.4 kB]
0% [1 libapparmor-perl 31.4 kB/31.4 kB 100%]                                   
Get:2 http://gpl.savoirfairelinux.net/pub/mirrors/ubuntu xenial-updates/main amd64 apparmor amd64 2.10.95-0ubuntu2.6 [450 kB]
Get:3 http://gpl.savoirfairelinux.net/pub/mirrors/ubuntu xenial-updates/main amd64 snap-confine amd64 2.22.6 [39.0 kB]
Get:4 http://gpl.savoirfairelinux.net/pub/mirrors/ubuntu xenial/main amd64 squashfs-tools amd64 1:4.3-3ubuntu2 [105 kB]
Get:5 http://gpl.savoirfairelinux.net/pub/mirrors/ubuntu xenial-updates/main amd64 snapd amd64 2.22.6 [8,745 kB]
96% [5 snapd 8,745 kB/8,745 kB 100%] 

http://anbox.io/#get-started gives the further steps:

snap install --classic anbox-installer

96% [5 snapd 8,745 kB/8,745 kB 100%]
    Fetched 9,371 kB in 5min 9s (30.3 kB/s)
    Preconfiguring packages ...
    Selecting previously unselected package libapparmor-perl.
    (Reading database ... 270217 files and directories currently installed.)
    Preparing to unpack .../libapparmor-perl_2.10.95-0ubuntu2.6_amd64.deb ...
    Unpacking libapparmor-perl (2.10.95-0ubuntu2.6) ...
    Selecting previously unselected package apparmor.
    Preparing to unpack .../apparmor_2.10.95-0ubuntu2.6_amd64.deb ...
    Unpacking apparmor (2.10.95-0ubuntu2.6) ...
    Selecting previously unselected package snap-confine.
    Preparing to unpack .../snap-confine_2.22.6_amd64.deb ...
    Unpacking snap-confine (2.22.6) ...
    Selecting previously unselected package squashfs-tools.
    Preparing to unpack .../squashfs-tools_1%3a4.3-3ubuntu2_amd64.deb ...
    Unpacking squashfs-tools (1:4.3-3ubuntu2) ...
    Selecting previously unselected package snapd.
    Preparing to unpack .../snapd_2.22.6_amd64.deb ...
    Unpacking snapd (2.22.6) ...
    Processing triggers for ureadahead (0.100.0-19) ...
    ureadahead will be reprofiled on next reboot
    Processing triggers for systemd (229-4ubuntu4) ...
    Processing triggers for man-db (2.7.5-1) ...
    Setting up libapparmor-perl (2.10.95-0ubuntu2.6) ...
    Setting up apparmor (2.10.95-0ubuntu2.6) ...
    update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
    diff: /var/lib/apparmor/profiles/.apparmor.md5sums: No such file or directory
    Setting up snap-confine (2.22.6) ...
    Setting up squashfs-tools (1:4.3-3ubuntu2) ...
    Setting up snapd (2.22.6) ...
    Processing triggers for ureadahead (0.100.0-19) ...
    Processing triggers for systemd (229-4ubuntu4) ...

sudo anbox-installer
Android in a Box - Installer

IMPORTANT: THIS IS ALPHA LEVEL SOFTWARE. EXPECT INSTABILITY AND
           BUGS !!!!!

IMPORTANT: ALSO PLEASE BE AWARE THAT WE DON'T PROVIDE FULL
           CONFINEMENT FOR THE SNAP YET !!!!


PLEASE NOTE: This script will require root access on your system
to install all necessary things. It will prompt you to enter your
password when required.


ERROR: Don't run the anbox-installer as root or via sudo. Simply
       invoke it with your regular user. The script will use sudo
       on its own when needed.

anbox-installer
anbox-installer: command not found


Why is the “anbox-installer” command not found?

UPDATE

In filemanager, I see a “snap” folder. When I double-click that, I see an “anbox-installer” folder. Inside “anbox-installer”, I see 3 things:

  1. A link named “current” that links to “10”;
  2. A folder named “common”;
  3. A folder named “10”.

There’s nothing in the three folders. (And I have “Show hidden files” enabled.)

This is probably because your PATH was not updated after the installation of snapd (either it did not affect your system or you did not logout and in again). To get around that, try using the absolute path: sudo /snap/bin/anbox-installer

1 Like

My “snap” folder does not contain a “bin” folder. But, I did as you said:
sudo /snap/bin/anbox-installer

Android in a Box - Installer

IMPORTANT: THIS IS ALPHA LEVEL SOFTWARE. EXPECT INSTABILITY AND
           BUGS !!!!!

IMPORTANT: ALSO PLEASE BE AWARE THAT WE DON'T PROVIDE FULL
           CONFINEMENT FOR THE SNAP YET !!!!


PLEASE NOTE: This script will require root access on your system
to install all necessary things. It will prompt you to enter your
password when required.


ERROR: Don't run the anbox-installer as root or via sudo. Simply
       invoke it with your regular user. The script will use sudo
       on its own when needed.

Finally installed anbox
Someone on https://rocket.ubuntu.com/channel/snapcraft suggested the following command:

snap run anbox-installer

Android in a Box - Installer


IMPORTANT: THIS IS ALPHA LEVEL SOFTWARE. EXPECT INSTABILITY AND
           BUGS !!!!!

IMPORTANT: ALSO PLEASE BE AWARE THAT WE DON'T PROVIDE FULL
           CONFINEMENT FOR THE SNAP YET !!!!


PLEASE NOTE: This script will require root access on your system
to install all necessary things. It will prompt you to enter your
password when required.



What do you want to do?

 1. Install Anbox
 2. Uninstall Anbox

Please enter your choice [1-2]: 
1


This is the installer for the anbox runtime environment. It will
install certain things on your system to ensure all requirements
are available for anbox to work correctly.

In summary we will install the following things:

 * Add the anbox-support ppa ppa:morphis/anbox-support to the
   host system
 * Install the anbox-modules-dkms deb package from the ppa
   which will add kernel modules for ashmem and binder which are
   required for the Android container to work.
 * Configure binder and ashmem kernel modules to be loaded
   automatically on boot.
 * Add an upstart job for the current user me which will
   start the anbox runtime on login.
 * Add a X11 session configuration file to allow the system
   application launcher (Unity7, Gnome Shell, ..) to find
   available Android applications.

Please type 'I AGREE' followed by pressing ENTER to continue
or type anything else to abort:
I AGREE


Starting installation process ...

+ '[' '!' -e /etc/udev/rules.d/99-anbox.rules ']'
+ sudo tee /etc/udev/rules.d/99-anbox.rules
+ sudo apt install -y software-properties-common linux-headers-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  linux-headers-4.4.0-72 linux-headers-4.4.0-72-generic
The following packages will be REMOVED:
  linux-kernel-generic
The following NEW packages will be installed:
  linux-headers-4.4.0-72 linux-headers-4.4.0-72-generic linux-headers-generic
  software-properties-common
0 upgraded, 4 newly installed, 1 to remove and 35 not upgraded.
Need to get 10.7 MB of archives.
After this operation, 77.9 MB of additional disk space will be used.
Get:1 http://mirrors.kernel.org/linuxmint-packages serena/upstream amd64 software-properties-common all 1.6.4 [5,206 B]
Get:2 http://gpl.savoirfairelinux.net/pub/mirrors/ubuntu xenial-updates/main amd64 linux-headers-4.4.0-72 all 4.4.0-72.93 [9,888 kB]
Get:3 http://gpl.savoirfairelinux.net/pub/mirrors/ubuntu xenial-updates/main amd64 linux-headers-4.4.0-72-generic amd64 4.4.0-72.93 [784 kB]
Get:4 http://gpl.savoirfairelinux.net/pub/mirrors/ubuntu xenial-updates/main amd64 linux-headers-generic amd64 4.4.0.72.78 [2,302 B]
Fetched 10.7 MB in 5s (2,033 kB/s)                
(Reading database ... 270202 files and directories currently installed.)
Removing linux-kernel-generic (4.4.0-53) ...
Selecting previously unselected package linux-headers-4.4.0-72.
(Reading database ... 270200 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.4.0-72_4.4.0-72.93_all.deb ...
Unpacking linux-headers-4.4.0-72 (4.4.0-72.93) ...
Selecting previously unselected package linux-headers-4.4.0-72-generic.
Preparing to unpack .../linux-headers-4.4.0-72-generic_4.4.0-72.93_amd64.deb ...
Unpacking linux-headers-4.4.0-72-generic (4.4.0-72.93) ...
Selecting previously unselected package linux-headers-generic.
Preparing to unpack .../linux-headers-generic_4.4.0.72.78_amd64.deb ...
Unpacking linux-headers-generic (4.4.0.72.78) ...
Selecting previously unselected package software-properties-common.
Preparing to unpack .../software-properties-common_1.6.4_all.deb ...
Unpacking software-properties-common (1.6.4) ...
Setting up linux-headers-4.4.0-72 (4.4.0-72.93) ...
Setting up linux-headers-4.4.0-72-generic (4.4.0-72.93) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.4.0-72-generic /boot/vmlinuz-4.4.0-72-generic
Setting up linux-headers-generic (4.4.0.72.78) ...
Setting up software-properties-common (1.6.4) ...
+ sudo add-apt-repository -y ppa:morphis/anbox-support
You are about to add the following PPA:
 More info: https://launchpad.net/~morphis/+archive/ubuntu/anbox-support
Executing: /tmp/tmp.2JmWG3u2DZ/gpg.1.sh --keyserver
hkp://keyserver.ubuntu.com:80
--recv-keys
875B67B7
gpg: requesting key 875B67B7 from hkp server keyserver.ubuntu.com
gpg: key 875B67B7: public key "Launchpad PPA for morphis" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
+ sudo apt update
Ign:1 http://mirrors.kernel.org/linuxmint-packages serena InRelease
Hit:2 http://mirrors.kernel.org/linuxmint-packages serena Release              
Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]     
Ign:5 http://dl.google.com/linux/chrome/deb stable InRelease                   
Ign:6 http://dl.google.com/linux/talkplugin/deb stable InRelease               
Hit:7 http://ppa.launchpad.net/audio-recorder/ppa/ubuntu xenial InRelease      
Hit:8 http://dl.google.com/linux/chrome/deb stable Release                     
Hit:9 http://archive.canonical.com/ubuntu xenial InRelease                     
Hit:10 http://dl.google.com/linux/talkplugin/deb stable Release                
Hit:11 http://gpl.savoirfairelinux.net/pub/mirrors/ubuntu xenial InRelease     
Get:12 http://ppa.launchpad.net/morphis/anbox-support/ubuntu xenial InRelease [17.5 kB]
Ign:13 http://repo.vivaldi.com/stable/deb stable InRelease                     
Hit:15 http://repo.vivaldi.com/stable/deb stable Release                       
Hit:16 http://gpl.savoirfairelinux.net/pub/mirrors/ubuntu xenial-updates InRelease
Hit:18 http://gpl.savoirfairelinux.net/pub/mirrors/ubuntu xenial-backports InRelease
Hit:19 http://ppa.launchpad.net/shutter/ppa/ubuntu xenial InRelease      
Hit:20 https://deb.opera.com/opera-stable stable InRelease
Get:22 http://ppa.launchpad.net/morphis/anbox-support/ubuntu xenial/main Sources [548 B]
Get:23 http://ppa.launchpad.net/morphis/anbox-support/ubuntu xenial/main amd64 Packages [476 B]
Get:24 http://ppa.launchpad.net/morphis/anbox-support/ubuntu xenial/main i386 Packages [476 B]
Get:25 http://ppa.launchpad.net/morphis/anbox-support/ubuntu xenial/main Translation-en [268 B]
Fetched 121 kB in 1s (74.8 kB/s)  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
35 packages can be upgraded. Run 'apt list --upgradable' to see them.
+ sudo apt install -y anbox-modules-dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  anbox-modules-dkms
0 upgraded, 1 newly installed, 0 to remove and 35 not upgraded.
Need to get 33.0 kB of archives.
After this operation, 342 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/morphis/anbox-support/ubuntu xenial/main amd64 anbox-modules-dkms all 4~xenial1 [33.0 kB]
Fetched 33.0 kB in 0s (60.4 kB/s)           
Selecting previously unselected package anbox-modules-dkms.
(Reading database ... 296901 files and directories currently installed.)
Preparing to unpack .../anbox-modules-dkms_4~xenial1_all.deb ...
Unpacking anbox-modules-dkms (4~xenial1) ...
Setting up anbox-modules-dkms (4~xenial1) ...
Loading new anbox-modules-ashmem-4~xenial1 DKMS files...
First Installation: checking all kernels...
Building only for 4.4.0-71-generic
Building for architecture amd64
Building initial module for 4.4.0-71-generic
Done.

ashmem_linux:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.4.0-71-generic/updates/

depmod.....

DKMS: install completed.
Loading new anbox-modules-binder-4~xenial1 DKMS files...
First Installation: checking all kernels...
Building only for 4.4.0-71-generic
Building for architecture amd64
Building initial module for 4.4.0-71-generic
Done.

binder_linux:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.4.0-71-generic/updates/

depmod....

DKMS: install completed.
+ '[' '!' -e /etc/modules-load.d/anbox.conf ']'
+ sudo tee /etc/modules-load.d/anbox.conf
+ sudo modprobe binder_linux
+ sudo modprobe ashmem_linux
+ snap info anbox
+ grep -q installed:
+ sudo snap install --edge --devmode anbox
anbox (edge) 1-dev from 'morphis' installed
+ '[' '!' -e /etc/X11/Xsession.d/68anbox ']'
+ echo 'Installing application launcher detection for X11 ..'
Installing application launcher detection for X11 ..
+ sudo tee /etc/X11/Xsession.d/68anbox
+ mkdir -p /home/me/.config/upstart
+ echo 'Installing upstart session job ..'
Installing upstart session job ..
+ cat
+ initctl start anbox
anbox start/running, process 10649
+ mkdir -p /home/me/.config/systemd/user
+ echo 'Installing systemd user session service ..'
Installing systemd user session service ..
+ cat
+ systemctl --user daemon-reload
Failed to execute operation: Process org.freedesktop.systemd1 exited with status 1
+ true
+ systemctl --user enable --now anbox
Failed to execute operation: Process org.freedesktop.systemd1 exited with status 1
+ true
+ set +x

Done!

To ensure all changes made to your system you should now reboot
your system. If you don't do this no Android applications will
show up in the system application launcher.

have you tried this command?
> snap run anbox-installer

1 Like

According to the instructions in the snap, you need to either run /snap/bin/anbox-installer, or run snap run anbox-installer. Either of these without sudo.

Note that in your attempt above the command did run, which implies you have the /snap/bin folder in place as usual. The reason it did not work as expected was pointed out in the error message it printed:

So no sudo.

1 Like

Thanks, @niemeyer, @jagamypriera I successfully ran the anbox-installer command.

Thanks also to @sergiusens.

I have a same problem,but I’m just runing on ArchLinux.Help me Please

[root@Ailick_Mj ailick]# snap install --classic anbox-installer && anbox-installer
anbox-installer 1 from 'morphis' installed
bash: anbox-installer: Command not found
[root@Ailick_Mj ailick]# snap install --classic anbox-installer && anbox-installer
snap "anbox-installer" is already installed, see "snap refresh --help"
bash: anbox-installer: Command not found
[root@Ailick_Mj ailick]# exit
exit
[ailick@Ailick_Mj bin]$ snap run anbox-installer
execv failed: No such file or directory
[ailick@Ailick_Mj ~]$ /snap/bin/anbox-installer
execv failed: No such file or directory
[ailick@Ailick_Mj ~]$ cd /snap/bin
[ailick@Ailick_Mj bin]$ ls -l
lrwxrwxrwx 1 root root 25 Aug 24 09:33 anbox-installer -> /usr/bin/snap

I might be wrong (@zyga-snapd may correct me here) but i think arch does currently not support classic snaps …
(though i dont get why snapd lets you install it without warning in that case, that should probably be fixed)

(i see in the anbox forum that it actually warns on fedora)

1 Like

That is correct. Arch does not support classic confinement at the moment.

1 Like

Thank you,maybe it is going well someday by your hardworking.

Hello!

When I do anbox-installer , /snap/bin/anbox-installer or snap run anbox-installer

I get:

snap-confine has elevated permissions and is not confined but should be. Refusing to continue to avoid permission escalation attacks

When I do sudo anbox-installer , sudo /snap/bin/anbox-installer or sudo snap run anbox-installer ,

I get:

Anbox (Android in a Box) - Installer

IMPORTANT: THIS IS ALPHA LEVEL SOFTWARE. EXPECT INSTABILITY AND BUGS !!!

IMPORTANT: ALSO PLEASE BE AWARE THAT WE DON’T PROVIDE FULL CONFINEMENT FOR THE SNAP YET !!!

PLEASE NOTE: This script will require root access on your system to install all necessary things. It will prompt you to enter your password when required.

ERROR: Don’t run the anbox-installer as root or via sudo. Simply invoke it with your regular user. The script will use sudo on its own when needed.

What could I try else?

Tanks in advanced.

(Sorry for my bad English :wink: )

As most of the features are available in Arch Linux now except (AppArmor), would like a cross-distribution support for Anbox-Instalelr :slight_smile:

:arrow_forward: snap run anbox-installer Anbox (Android in a Box) - Installer

IMPORTANT: THIS IS ALPHA LEVEL SOFTWARE. EXPECT INSTABILITY AND BUGS !!!

IMPORTANT: ALSO PLEASE BE AWARE THAT WE DON’T PROVIDE FULL CONFINEMENT FOR THE SNAP YET !!!

PLEASE NOTE: This script will require root access on your system to install all necessary things. It will prompt you to enter your password when required.

/snap/anbox-installer/17/installer.sh: line 34: lsb_release: command not found ERROR: You are running the installer on an unsupported distribution. At the moment we only support the following distributions:

Ubuntu, LinuxMint, neon, elementary

If your distribution is in the list but you still see this message, open an issue here: https://github.com/anbox/anbox-installer

1 Like

Hey !! I want to ask if anbox could be run at i386 architecture (Xenial 16.04) ?
I’ve got “The anbox-installer is deprecated” message.

And using snap install --devmode --beta anbox to install returns “i386 is not supported” sadly too ((