Results 1 to 5 of 5

Thread: chroot permissions issue

  1. #1
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,289
    Blog Entries
    2

    Default chroot permissions issue

    Trying to create an "alien" (non-openSUSE) chroot file system on an openSUSE 12.3.

    Although have not had any problems creating a variety of openSUSE chroots on this system, I am unable to create one running another distro, an example follows. Although the example invokes systemd-nspawn, the same permissions error displays when I use traditional chroot after doing /proc and /sys bind mounts

    Code:
    # systemd-nspawn -D /home/chroot/Fedora18/                           
    Spawning namespace container on /home/chroot/Fedora18 (console is /dev/pts/3).        
    execv() failed: Permission denied                                                                     
    Container failed with error code 1.
    Thinking the problem might be permissions of the files in the chroot, for testing purposes only I set all the permissions to "everyone can do everything"
    Code:
    chmod 7777 /home/chroot/Fedora18
    But, I'm still SOL, still returning the same permissions problem.

    The Fedora FS was created by
    1. Install Fedora 18 minimal install into a KVM Guest VM.
    2. Shut down the Guest VM
    3. Mount the Guest diskfile
    4. Copy the directories <except> for /proc and /sys to the target directory
    5. After experiencing initial problems, I then applied the 7777 permissions I described above to no effect.

    Internet Searches have turned up nothing useful to my eye, only references to setting BASH permissions but wouldn't those have been addressed by my opening up permissions in the chroot to Everyone can do Everything?

    Hoping someone has a suggestion,
    TIA,
    TSU

  2. #2
    Join Date
    Sep 2012
    Posts
    5,138

    Default Re: chroot permissions issue

    Works here.
    Code:
    bor@opensuse:~/src/systemd/src> sudo systemd-nspawn -D /tmp/x
    Spawning namespace container on /tmp/x (console is /dev/pts/5).
    /etc/localtime is not a symlink, not updating container timezone.
    [root@x ~]# cat /etc/fedora-release 
    Fedora release 18 (Spherical Cow)
    [root@x ~]# exit
    logout
    bor@opensuse:~/src/systemd/src> df -h /tmp/x
    Файловая система           Размер Использовано  Дост Использовано% Cмонтировано в
    /dev/mapper/fedora_10-root   3,0G         648M  2,3G           23% /tmp/x

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,289
    Blog Entries
    2

    Default Re: chroot permissions issue

    Quote Originally Posted by arvidjaar View Post
    Works here.
    Code:
    bor@opensuse:~/src/systemd/src> sudo systemd-nspawn -D /tmp/x
    Spawning namespace container on /tmp/x (console is /dev/pts/5).
    /etc/localtime is not a symlink, not updating container timezone.
    [root@x ~]# cat /etc/fedora-release 
    Fedora release 18 (Spherical Cow)
    [root@x ~]# exit
    logout
    bor@opensuse:~/src/systemd/src> df -h /tmp/x
    Файловая система           Размер Использовано  Дост Использовано% Cмонтировано в
    /dev/mapper/fedora_10-root   3,0G         648M  2,3G           23% /tmp/x
    I'm fairly certain my problem is how the alien filesystem is being created since I'm seeing the same problem both using systemd-nspawn and chroot.

    Am wondering how/where you dowloaded or created your Fedora filesystem?
    Am currently looking at febootstrap and various yum recipes, plus having another look at debootstrap.

    Thx,
    TSU

  4. #4
    Join Date
    Sep 2012
    Posts
    5,138

    Default Re: chroot permissions issue

    Quote Originally Posted by tsu2 View Post
    Am wondering how/where you dowloaded or created your Fedora filesystem?
    Installed in KVM and loop-mounted.

  5. #5
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,289
    Blog Entries
    2

    Default Re: chroot permissions issue

    Quote Originally Posted by arvidjaar View Post
    Installed in KVM and loop-mounted.
    Thx,
    Yeah, unfortunately involving KVM likely "fixes" problems that would ordinarily appear.

    In any case,
    Although I'm still investigating how/why my attempts to create a bootstrap filessystem manually (it appears I have much to learn at this point),

    I've found a working solution.
    Re-reading my notes, I re-visited the pre-made filesystems available at OpenVZ
    Download/template/precreated - OpenVZ Linux Containers Wiki

    Although OpenVZ is similar to LXC and not exactly chroot, you can use those file systems in a chroot with some modification.

    Thx,
    TSU

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •