lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Missing system directories in chroot [Was: Creating a chroot f


From: Greg Chicares
Subject: Re: [lmi] Missing system directories in chroot [Was: Creating a chroot for cross-building lmi]
Date: Fri, 16 Sep 2016 00:41:47 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0

On 2016-09-15 17:36, Vadim Zeitlin wrote:
> On Thu, 15 Sep 2016 15:46:32 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> On 2016-09-08 22:06, Vadim Zeitlin wrote:
> ...
> GC> > 1. As I said before, I think you do need to mount /dev/pts because many
> GC> > programs risk to fail mysteriously if PTYs don't work. This can be done
> GC> > manually using "mount -o bind -t devpts /dev/pts devpts".
> 
>  Sorry, I exchanged the order of mount parameters here. The correct command
> is
> 
>       [chroot]# mount -t devpts devpts /dev/pts
> 
> from inside chroot or
> 
>       [main]# mount -o bind /dev/pts /full/path/to/chroot/dev/pts
> 
> from outside of it. You do need to be root in any case, of course.

Thanks, I did this (inside chroot, as root):
  mount -t devpts devpts /dev/pts
but I still have a couple of questions about it [as you'll see, I seem
to have figured out most of this, except for question (1)]:

(1) What does the second "devpts" mean?
  mount -t devpts devpts /dev/pts
           FIRST  SECOND
I understand that '-t devpts' specifies the mount type, and that here
"devpts" is a suboption of '-t', just as "ext4" is. I understand that
'/dev/pts' is the directory where this filesystem of type "devpts" is
mounted. But is the second "devpts" the name of an actual device? or
is it an arbitrary word, such as `man mount` says is used when 'proc'
is mounted?

(2) The mount appears to be persistent. I expected that running
  mount -t devpts devpts /dev/pts
within the chroot would have an effect only within that chroot session,
and that exiting the chroot would cause the mount to disappear. However,
when I exit the chroot and then enter it again as a normal user, the
mount is present:
  $schroot --chroot=chrome
  /home/greg[0]$mount
  /proc on /proc type proc (rw)
  devpts on /dev/pts type devpts (rw)
As expected, 'mount' didn't add it to 'fstab':
  /home/greg[0]$cat /etc/fstab
  # UNCONFIGURED FSTAB FOR BASE SYSTEM
Wait--aha--when I leave the chroot
  $exit
I see that it's mounted in the base OS:
  $mount |grep devpts
  devpts on /dev/pts type devpts 
(rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
  devpts on /srv/chroot/chrome/dev/pts type devpts 
(rw,relatime,mode=600,ptmxmode=000)
(which would disappear if I rebooted). I wasn't expecting a command
executed in the chroot to have any effect on the underlying OS's
mounts: I thought "what happens in a chroot, stays in the chroot",
kind of like the saying
  http://www.urbandictionary.com/define.php?term=what%20happens%20in%20vegas
But that's not actually true of Las Vegas either.

I suppose I should add "nosuid,noexec" to the chroot's /dev/pts mount,
so that it's no less restrictive than the underlying OS's mount.

Anyway...now I have /proc and /dev/pts mounted, but when I try running
chrome I get this:

$/usr/bin/google-chrome-stable
[9724:9741:0916/001015:ERROR:bus.cc(434)] Failed to connect to the bus: Failed 
to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[9724:9724:0916/001015:ERROR:shared_memory_posix.cc(290)] Creating shared 
memory in /dev/shm/.com.google.Chrome.vrvocU failed: Permission denied
[9724:9724:0916/001015:ERROR:shared_memory_posix.cc(293)] Unable to 
access(W_OK|X_OK) /dev/shm: Permission denied
[9724:9724:0916/001015:FATAL:shared_memory_posix.cc(295)] This is frequently 
caused by incorrect permissions on /dev/shm.  Try 'sudo chmod 1777 /dev/shm' to 
fix.
zsh: abort      /usr/bin/google-chrome-stable

...so I change permissions as suggested...

$sudo chmod 1777 /dev/shm

...and now chrome seems to work as it should--kind of like iceweasel,
but with popup ads. I still get error messages (below), but I think I
may be able to fix those myself (e.g., by adding myself to a 'video'
group--at least a web search gives me some ideas to explore).

$/usr/bin/google-chrome-stable
[11011:11029:0916/002915:ERROR:bus.cc(434)] Failed to connect to the bus: 
Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or 
directory

(google-chrome-stable:11011): GConf-WARNING **: Client failed to connect to the 
D-BUS daemon:
/usr/bin/dbus-launch terminated abnormally without any error message
libGL error: failed to open drm device: No such file or directory
libGL error: failed to load driver: r600
[11057:11057:0916/002916:ERROR:sandbox_linux.cc(343)] InitializeSandbox() 
called with multiple threads in process gpu-process.
[11011:11040:0916/002916:ERROR:browser_gpu_channel_host_factory.cc(131)] Failed 
to create channel.

(google-chrome-stable:11011): LIBDBUSMENU-GLIB-WARNING **: Unable to get 
session bus: Failed to execute child process "dbus-launch" (No such file or 
directory)
[11011:11607:0916/002928:ERROR:bus.cc(434)] Failed to connect to the bus: 
Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or 
directory




reply via email to

[Prev in Thread] Current Thread [Next in Thread]