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

        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.

        arubislanderA 1 Reply Last reply Reply Quote 0
        • arubislanderA Offline
          arubislander @nom
          last edited by

          @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 Reply Quote 1
          • N Offline
            nom @arubislander
            last edited by

            @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 Reply Quote 0
            • C Offline
              chris @nom
              last edited by chris

              @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 Reply Quote 0
              • G Offline
                Georg @chris
                last edited by Georg

                @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 Reply Quote 0
                • F Offline
                  fionnlagh @Georg
                  last edited by

                  @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
                  • First post
                    Last post