• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Cannot get root shell in new Libertine container

Scheduled Pinned Locked Moved Libertine
6 Posts 5 Posters 1.0k Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      nom
      last edited by 28 Dec 2023, 20:41

      Using Pixel 3a, Release candidate channel, Settings.Updates says Ubuntu touch Version 9.

      Just made a Libertine container through Settings.Libertine, default name, no password. Installed Libertine Tweak Tool, and used that to turn on Libertine Shell. The container ID when done is focal as shown by Settings.Libertine.

      Went into terminal, and typed the command lish focal which gave me a prompt as follows.

      (focal)I have no name!@ubuntu-phablet:~$
      

      So I exited and typed the command to get a root shell in the container lirsh focal which behaved exactly as lish focal and did not give me a root shell.

      • How can I get a root shell?
      • How do I fix the no username problem?

      Thank you for considering my difficulties.

      A 1 Reply Last reply 29 Dec 2023, 14:56 Reply Quote 0
      • A Offline
        arubislander @nom
        last edited by 29 Dec 2023, 14:56

        @nom said in Cannot get root shell in new Libertine container:

        How can I get a root shell?

        Try the info in this post for getting a (fake)root shell

        ๐Ÿ‡ฆ๐Ÿ‡ผ ๐Ÿ‡ณ๐Ÿ‡ฑ ๐Ÿ‡บ๐Ÿ‡ธ ๐Ÿ‡ช๐Ÿ‡ธ
        Happily running Ubuntu Touch
        Google Pixel 3a (20.04 DEV)
        JingPad (24.04 preview)
        Meizu Pro 5 (16.04 DEV)

        N 1 Reply Last reply 30 Dec 2023, 02:56 Reply Quote 1
        • N Offline
          nom @arubislander
          last edited by 30 Dec 2023, 02:56

          @arubislander , I found that using fakeroot as in the post you linked does not give a working root shell, e.g. apt install nano fails.

          Here's something that did apparently work. Below "........." is an error message config.py:91 WARNING _get_maliit_address_from_dbus(): org.freedesktop.DBus.Error.Noreply: Did not receive a reply. [...]

          phablet@ubuntu-phablet:~$ sudo -E bash
          root@ubuntu-phablet:~# lish focal
          ..........
          (focal)root@ubuntu-phablet:~# 
          

          Using this apt install nano worked, as did apt remove nano.

          Using this su phablet indicates the user named phablet does not exist in the container. So I will attempt to add it with uid 32011 as associated with the missing name in the post you linked.

          C 1 Reply Last reply 30 Dec 2023, 09:23 Reply Quote 0
          • C Offline
            chris @nom
            last edited by chris 30 Dec 2023, 09:23

            @nom
            strange, on xperia x (focal) stable (OTA-3) it worked for me with a new focal container:
            (I used the name focal2 because I have a focal container already)

            phablet@xperia:~$ libertine-container-manager create -i focal2 -t chroot
            ...
            phablet@xperia:~$ libertine-container-manager exec -i focal2 -c "/bin/bash"
            groups: cannot find name for group ID 32011
            I have no name!@xperia:~$ fakeroot
            groups: cannot find name for group ID 32011
            root@xperia:~# apt install nano
            ... (installs without error)
            

            as mentioned in the post the missing id problem is solved by adding extrausers to the first 4 lines of /etc/nsswitch.conf within the container

            passwd:         files systemd extrausers
            group:          files systemd extrausers
            shadow:         files extrausers
            gshadow:        files extrausers
            

            it could be that this only works for libertine containers of type chroot. I've updated the command above accordingly.

            G 1 Reply Last reply 16 Feb 2024, 19:53 Reply Quote 0
            • G Offline
              Georg @chris
              last edited by Georg 16 Feb 2024, 19:53

              @chris Sorry for the stupid question, but I need help. How do I edit the /etc/nsswitch.conf file?

              I use the fakeroot command, then:
              nano /etc/nsswitch.conf
              The editor says "file unwritable".
              What am I doing wrong?

              And second question I can't find how I can type ยซctrl+oยป on my phone keyboard ?

              F 1 Reply Last reply 23 Feb 2024, 17:04 Reply Quote 0
              • F Offline
                fionnlagh @Georg
                last edited by 23 Feb 2024, 17:04

                @Georg I had similar problems with Libertine.
                Instead of editing the file from "within" the chroot, i just edited it from outside (as the user "phablet"):
                nano /home/phablet/.cache/libertine-container/focal/rootfs/etc/nsswitch.conf

                also I highly recommend using the ADB Shell or SSH ๐Ÿ™‚

                1 Reply Last reply Reply Quote 0
                • W wynn1212 referenced this topic on 30 Mar 2024, 21:38
                • First post
                  Last post