LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2020, 02:24 AM   #1
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Rep: Reputation: Disabled
Can't run Firefox from chroot


I want to run firefox from chroot directory. I copy firefox installation files which i get by running 'sudo dpkg -L firefox', then i copy the shared libraries which i get by running 'ldd /usr/bin/firefox-esr'. But when i try to start firefox i get this:

Code:
bash-5.0# firefox-esr 
Couldn't find the application directory.
This is my chroot directory:

Code:
Firefox/
├── bin
│   └── bash
├── etc
│   └── firefox-esr
│       └── firefox-esr.js
├── lib
│   └── x86_64-linux-gnu
│       ├── libc.so.6
│       ├── libdl.so.2
│       └── libtinfo.so.6
├── lib64
│   └── ld-linux-x86-64.so.2
└── usr
    ├── bin
    │   ├── firefox
    │   └── firefox-esr -> ../lib/firefox-esr/firefox-esr
    ├── lib
    │   ├── firefox-esr
    │   │   ├── application.ini
    │   │   ├── browser
    │   │   │   ├── blocklist.xml
    │   │   │   ├── chrome -> ../../../share/firefox-esr/browser/chrome
    │   │   │   ├── chrome.manifest
    │   │   │   ├── crashreporter-override.ini
    │   │   │   ├── defaults -> ../../../share/firefox-esr/browser/defaults
    │   │   │   ├── features
    │   │   │   │   ├── formautofill@mozilla.org.xpi
    │   │   │   │   ├── fxmonitor@mozilla.org.xpi
    │   │   │   │   ├── screenshots@mozilla.org.xpi
    │   │   │   │   ├── webcompat@mozilla.org.xpi
    │   │   │   │   └── webcompat-reporter@mozilla.org.xpi
    │   │   │   └── omni.ja
    │   │   ├── chrome.manifest
    │   │   ├── crashreporter
    │   │   ├── crashreporter.ini
    │   │   ├── defaults
    │   │   │   └── pref
    │   │   │       └── channel-prefs.js
    │   │   ├── dependentlibs.list
    │   │   ├── distribution -> ../../share/firefox-esr/distribution
    │   │   ├── firefox-bin -> firefox-esr
    │   │   ├── firefox-esr
    │   │   ├── fonts
    │   │   │   └── TwemojiMozilla.ttf
    │   │   ├── gmp-clearkey
    │   │   │   └── 0.1
    │   │   │       ├── libclearkey.so
    │   │   │       └── manifest.json
    │   │   ├── gtk2
    │   │   │   └── libmozgtk.so
    │   │   ├── libfreeblpriv3.chk
    │   │   ├── libfreeblpriv3.so
    │   │   ├── liblgpllibs.so
    │   │   ├── libmozavcodec.so
    │   │   ├── libmozavutil.so
    │   │   ├── libmozgtk.so
    │   │   ├── libmozsandbox.so
    │   │   ├── libmozsqlite3.so
    │   │   ├── libmozwayland.so
    │   │   ├── libnspr4.so
    │   │   ├── libnss3.so
    │   │   ├── libnssckbi.so
    │   │   ├── libnssdbm3.chk
    │   │   ├── libnssdbm3.so
    │   │   ├── libnssutil3.so
    │   │   ├── libplc4.so
    │   │   ├── libplds4.so
    │   │   ├── libsmime3.so
    │   │   ├── libsoftokn3.chk
    │   │   ├── libsoftokn3.so
    │   │   ├── libssl3.so
    │   │   ├── libxul.so
    │   │   ├── minidump-analyzer
    │   │   ├── omni.ja
    │   │   ├── pingsender
    │   │   ├── platform.ini
    │   │   ├── plugin-container
    │   │   └── Throbber-small.gif
    │   ├── gcc
    │   │   └── x86_64-linux-gnu
    │   │       └── 8
    │   │           └── libgcc_s.so.1
    │   ├── mime
    │   │   └── packages
    │   │       └── firefox-esr
    │   ├── mozilla
    │   │   ├── extensions
    │   │   │   └── {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
    │   │   └── plugins
    │   └── x86_64-linux-gnu
    │       ├── libgcc_s.so.1
    │       ├── libm.so.6
    │       ├── libpthread.so.0
    │       └── libstdc++.so.6
    └── share
        ├── applications
        │   └── firefox-esr.desktop
        ├── bug
        │   └── firefox-esr
        │       ├── control
        │       ├── presubj
        │       └── script
        ├── doc
        │   └── firefox-esr
        │       ├── changelog.Debian.gz
        │       ├── copyright
        │       ├── NEWS.Debian.gz
        │       └── README.Debian
        ├── firefox-esr
        │   ├── browser
        │   │   ├── chrome
        │   │   │   └── icons
        │   │   │       └── default
        │   │   │           ├── default128.png
        │   │   │           ├── default16.png
        │   │   │           ├── default32.png
        │   │   │           ├── default48.png
        │   │   │           └── default64.png
        │   │   └── defaults
        │   │       ├── preferences
        │   │       │   ├── debugger.js
        │   │       │   ├── devtools-client.js
        │   │       │   ├── devtools-startup.js
        │   │       │   ├── firefox-branding.js
        │   │       │   ├── firefox.js
        │   │       │   ├── vendor.js
        │   │       │   └── webide.js
        │   │       └── syspref -> /etc/firefox-esr
        │   └── distribution
        │       └── searchplugins
        │           └── common
        │               └── debsearch.xml
        ├── icons
        │   └── hicolor
        │       ├── 128x128
        │       │   └── apps
        │       │       └── firefox-esr.png -> ../../../../firefox-esr/browser/chrome/icons/default/default128.png
        │       ├── 16x16
        │       │   └── apps
        │       │       └── firefox-esr.png -> ../../../../firefox-esr/browser/chrome/icons/default/default16.png
        │       ├── 32x32
        │       │   └── apps
        │       │       └── firefox-esr.png -> ../../../../firefox-esr/browser/chrome/icons/default/default32.png
        │       ├── 48x48
        │       │   └── apps
        │       │       └── firefox-esr.png -> ../../../../firefox-esr/browser/chrome/icons/default/default48.png
        │       ├── 64x64
        │       │   └── apps
        │       │       └── firefox-esr.png -> ../../../../firefox-esr/browser/chrome/icons/default/default64.png
        │       └── symbolic
        │           └── apps
        │               └── firefox-esr-symbolic.svg
        ├── lintian
        │   └── overrides
        │       └── firefox-esr
        ├── man
        │   └── man1
        │       └── firefox-esr.1.gz
        └── mozilla
            └── extensions
                └── {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
 
69 directories, 92 files

I am testing this on virtual machine with debian 10.
 
Old 02-11-2020, 03:06 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
There is more to running a jailed application then just coping files to another directory. Did you configure your chroot environment using schroot?

https://wiki.debian.org/chroot

https://help.ubuntu.com/community/Ba...ide_the_chroot
 
1 members found this post helpful.
Old 02-11-2020, 03:56 AM   #3
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Original Poster
Rep: Reputation: Disabled
I don't want to use debootstrap. I was hoping that i can run firefox from chroot just by copying the necessary files, but i guess it's not possible.
 
Old 02-11-2020, 04:51 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
I think it makes it easier and you can always delete what you don't need.

You don't have a path environment, you need to copy the /etc/resolv.conf file, you need to mount the virtual filesystem to manage running processes etc.

It's been awhile since I've played with it...
 
Old 02-11-2020, 08:28 AM   #5
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Original Poster
Rep: Reputation: Disabled
I tried to use debootstrap. I created folder in my home directory - debian1, and downloaded debian buster. Then i run 'sudo chroot debian1' and installed firefox with 'apt install firefox-esr'. Then in the chroot i run 'export DISPLAY=:0.0' and on my system i run 'xhost +'. Then i tried to start firefox with this command 'firefox-esr -DISPLAY=:0.0', but i get the same error: 'Couldn't find the application directory.'
 
Old 02-11-2020, 09:52 AM   #6
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,599

Rep: Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546
Quote:
Originally Posted by peter7089 View Post
i get the same error: 'Couldn't find the application directory.'
I don't know anything about chrooting, but that error message appears to be a Firefox one - looks like two applicable instances of that error in the Firefox source (at least in that unofficial Github copy of the source).

If you feel like figuring out Mozilla's C++ then you could workout out exactly why the error is occurring, but it's clear they're both concerning argv[0] - i.e. the command being run - so I would first confirm with "which firefox-esr" what it is you're calling.

Also, I don't know the relevance, but it seems odd that /usr/bin/firefox-esr points to /usr/lib/firefox-esr/firefox-esr whilst /usr/bin/firefox doesn't.

Do you get same or different error messages when executing /usr/lib/firefox-esr/firefox-esr directly, or with /usr/bin/firefox instead?

Maybe test with passing -help or -version options to see if they result in different errors which narrow down what the cause is.

 
Old 02-11-2020, 10:20 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
I also used debootstrap to create a buster chroot environment.

On one of the howto pages once you installed firefox you need to exit and then run the xhost command. I also installed schroot which lets an unprivileged user run chroot. I had to export LC_ALL=C before chrooting but firefox still fails with an exception handler and have not figured that one out yet.


While not chroot firejail might be an alternative and it creates a sandbox environment for an application.
 
Old 02-11-2020, 11:28 AM   #8
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by boughtonp View Post

Do you get same or different error messages when executing /usr/lib/firefox-esr/firefox-esr directly, or with /usr/bin/firefox instead?

Maybe test with passing -help or -version options to see if they result in different errors which narrow down what the cause is.

I tried to run /usr/lib/firefox-esr/firefox-esr directly, but get the same error. Also, tried to use firefox options, but again, the same error.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] in chroot compiled programs do not work in chroot graphit Linux From Scratch 2 04-11-2010 03:04 AM
chroot to run hd-installed distro's programs from chroot in live distro? silencestone Linux - Software 0 10-12-2007 06:29 AM
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
mount command not working in chroot. and now chroot not working mohit.jain Linux From Scratch 5 07-14-2006 03:57 AM
to chroot or not to chroot complus Linux - Security 4 02-29-2004 04:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration