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

    Howto : chroot debian with X support instead libertine ubuntu

    Scheduled Pinned Locked Moved Support
    howtochrootlibertine alter
    30 Posts 10 Posters 5.3k Views 4 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.
      • B Offline
        Bouleetbil
        last edited by Bouleetbil

        Hello, howto debian chroot

        • Create chroot
        mkdir -p /home/phablet/Documents/debian
        sudo debootstrap \
        --include=btop,chromium,firefox-esr,maliit-inputcontext-gtk2,maliit-inputcontext-gtk3 \
        --arch arm64 \
        bookworm \
        /home/phablet/Documents/debian \
        http://deb.debian.org/debian
        

        chroot created into /home/phablet/Documents/debian

        • Create user phabet
        sudo chroot /home/phablet/Documents/debian
        useradd -m phablet --uid 32011
        
        • Configure chroot for dbus, wayland, sound ... for user phablet
          Added to /home/phablet/.bashrc into chroot
        export XDG_RUNTIME_DIR=/run/user/32011
        export WAYLAND_DISPLAY=wayland-0
        export DISPLAY=:0
        export XSOCKET=/tmp/.X11-unix/X0
        export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/32011/bus
        export USER=phablet
        #keyboard
        export QT_IM_MODULE=Maliit
        export GTK_IM_MODULE=Maliit
        
        • Start chroot as phablet user
        MCHRDIR=/home/phablet/Documents/debian
        
        cp /etc/hosts ${MCHRDIR}/etc/hosts
        cp /etc/resolv.conf ${MCHRDIR}/etc/resolv.conf
        
        mount -o bind /dev ${MCHRDIR}/dev
        mount --bind /dev/pts ${MCHRDIR}/dev/pts
        mount --bind /proc  ${MCHRDIR}/proc
        mount --bind /tmp  ${MCHRDIR}/tmp
        mount --bind /sys  ${MCHRDIR}/sys
        mount --bind /run  ${MCHRDIR}/run
        
        #dbus
        mount -o bind /var/run/dbus/ ${MCHRDIR}/var/run/dbus
        
        #shm (chromium)
        mount --bind /dev/shm/ ${MCHRDIR}/dev/shm
        
        #wayland
        mkdir -p ${MCHRDIR}/run/user/32011
        mount --bind /run/user/32011 ${MCHRDIR}/run/user/32011
        
        chroot --userspec=phablet:phablet ${MCHRDIR} \
                /usr/bin/env -i \
                HOME=/home/phablet/ \
                TERM="$TERM" \
                PS1='(lfs chroot) \u:\w\$ ' \
                PATH=/usr/bin:/usr/sbin \
                /bin/bash --login
        
        sleep 5
        umount ${MCHRDIR}/dev/shm
        umount ${MCHRDIR}/var/run/dbus/
        umount ${MCHRDIR}/run/user/32011
        
        umount ${MCHRDIR}/run
        umount ${MCHRDIR}/sys
        umount ${MCHRDIR}/proc
        umount ${MCHRDIR}/dev/pts
        umount ${MCHRDIR}/dev
        umount ${MCHRDIR}/tmp
        

        I've tested chromium firefox all seems works here on my pixel3a focal RC

        photo1698138985.jpeg

        TIP

        • You can change PS1 in your chroot ~/.bashrc for identify quickly if you are into the chroot :
        PS1='chroot \u@\h:\w\$ '
        

        After login in your chroot

        chroot phablet@ubuntu-phablet:/home/phablet$
        
        • Change DPI
          cat ~/Documents/debian/home/phablet/.Xdefaults
        xterm*faceName: DejaVu Sans Mono
        xterm*faceSize: 10
        Xft.dpi:200
        

        You can adapt Xft.dpi with your display

        • VNC xfce4 works
          Capture d’écran du 2023-10-24 22-46-10.png

        I can use my pixel3a with lomiri as mobile, And for a little desktop VNC if I don't have my dongle. I love this device 😄

        Pixel 3a ubports focal RC version daily use with pinetime
        PinePhonePro Mobian / ubports Focal
        Redmi 9S focal devel version

        J K 2 Replies Last reply Reply Quote 7
        • arubislanderA arubislander marked this topic as a regular topic on
        • J Offline
          jarop @Bouleetbil
          last edited by

          @Bouleetbil Hi, do you see it behave better than libertine?

          B 1 Reply Last reply Reply Quote 0
          • B Offline
            Bouleetbil @jarop
            last edited by Bouleetbil

            @jarop
            Hi,
            For me yes, but it's not really user friendly

            • I can login as root or regular user.
              libertine can not : https://forums.ubports.com/topic/8797/libertine-focal-don-t-find-group-id?_=1698153549115

            • I can add new repo
              https://gitlab.com/ubports/development/core/libertine/-/issues/124

            • I can add additional bind-mounts
              https://gitlab.com/ubports/development/core/libertine/-/issues/120

            • I can choose the GNU/Linux distribution as postmarket

            But you should start the applications in command line, the desktop files are not into the lomiri launcher.

            For chroot should more user friendly :
            Create a systemd service user for mount all necessary on startup
            Create a launcher or adapt lomiri-app-launch for start the application in this chroot
            Added .desktop from chroot to lomiri launcher

            Pixel 3a ubports focal RC version daily use with pinetime
            PinePhonePro Mobian / ubports Focal
            Redmi 9S focal devel version

            C 1 Reply Last reply Reply Quote 1
            • K Offline
              kugiigi @Bouleetbil
              last edited by

              @Bouleetbil Nice! 😄 I didn't use chroot but instead installed directly in the root long time ago and I used to use xfce4 via x-forwarding on my work laptop and UT development 😁

              In case you're insterested, I think Junest is a similar solution and some people has made it work on UT.

              B 1 Reply Last reply Reply Quote 0
              • R Offline
                Rinkeby
                last edited by Rinkeby

                Hey, this look great for later!

                So if I get this right, you can install .deb as a ordinary system? Blender, whatsapp client, available browsers?

                And is there an app like Alacarte so you can create shortcuts with commands? So instead of using command line, you have an icon for that command? Often use that in normal linux.

                Best regards.

                1 Reply Last reply Reply Quote 0
                • B Offline
                  Bouleetbil @kugiigi
                  last edited by

                  @kugiigi
                  hello I will check that.

                  @Rinkeby
                  hello, yes I can install .deb.
                  I will create a git repo with my ubports scripts when I will have some times. For show the .desktop in lormiri I will probably add a script for scan all .desktop in this chroot and export it into ~/.local/share/applications/

                  Pixel 3a ubports focal RC version daily use with pinetime
                  PinePhonePro Mobian / ubports Focal
                  Redmi 9S focal devel version

                  1 Reply Last reply Reply Quote 1
                  • M Offline
                    moodroid
                    last edited by

                    Hi @Bouleetbil - thanks for this. I'm also using a Pixel 3a (Focal) and thought I'd give this a try, but it doesn't seem to be working for me.

                    After entering the first block of code (Create chroot), it was busy doing stuff for about 10 mins, but then eventually failed with:

                    W: Failure while configuring base packages.  This will be re-attempted up to five times.
                    W: See /home/phablet/Documents/debian/debootstrap/debootstrap.log for details (possibly the package dconf-service is at fault)
                    

                    Looking thorugh the log file I just see lots of dependency errors, e.g.

                    dpkg: error processing package firefox-esr (--configure):
                     dependency problems - leaving unconfigured
                    Errors were encountered while processing:
                     dconf-service
                     dconf-gsettings-backend:arm64
                     libgtk-3-common
                     libgtk-3-0:arm64
                     chromium
                     maliit-inputcontext-gtk3
                     firefox-esr
                    

                    Any ideas?

                    Thanks,

                    B 1 Reply Last reply Reply Quote 0
                    • B Offline
                      Bouleetbil @moodroid
                      last edited by

                      @moodroid
                      hello try to create chroot wirhout package and install packages manualy with apt

                      mkdir -p /home/phablet/Documents/debian
                      sudo debootstrap \
                      --arch arm64 \
                      bookworm \
                      /home/phablet/Documents/debian \
                      http://deb.debian.org/debian
                      

                      Pixel 3a ubports focal RC version daily use with pinetime
                      PinePhonePro Mobian / ubports Focal
                      Redmi 9S focal devel version

                      R 1 Reply Last reply Reply Quote 0
                      • R Offline
                        Rinkeby @Bouleetbil
                        last edited by

                        @Bouleetbil

                        Hi,

                        So I tried this, But

                        sleep 5
                        umount ${MCHRDIR}/dev/shm
                        umount ${MCHRDIR}/var/run/dbus/
                        umount ${MCHRDIR}/run/user/32011

                        umount ${MCHRDIR}/run
                        umount ${MCHRDIR}/sys
                        umount ${MCHRDIR}/proc
                        umount ${MCHRDIR}/dev/pts
                        umount ${MCHRDIR}/dev
                        umount ${MCHRDIR}/tmp

                        part seems problematic as I have to be a superuser. And I dont know thte command how to start anything from terminal.

                        Any ideas?

                        B 1 Reply Last reply Reply Quote 0
                        • B Offline
                          Bouleetbil @Rinkeby
                          last edited by

                          @Rinkeby
                          Hi, I've created a repo gitlab for install chroot debian
                          https://gitlab.com/bouleetbil/ubports-scripts#installation

                          it provided a systemd service for mount debian chroot https://gitlab.com/bouleetbil/ubports-scripts/-/blob/main/.config/systemd/user/debian-mount.service?ref_type=heads

                          After you can create some alias

                          #debian chroot
                          alias debian='/home/phablet/bin/debian-chroot.sh /bin/bash --login'
                          alias firefox='/home/phablet/bin/debian-chroot.sh firefox'
                          
                          

                          Pixel 3a ubports focal RC version daily use with pinetime
                          PinePhonePro Mobian / ubports Focal
                          Redmi 9S focal devel version

                          R 1 Reply Last reply Reply Quote 0
                          • R Offline
                            Rinkeby @Bouleetbil
                            last edited by

                            @Bouleetbil

                            Thats amazing of you. I hope this get adopted. I will lean in to it a bit later.

                            So, two more happy question, I see wayland in your code, does this make interface smoother? At the moment i run Firefox through libertine, some add-ons and its actually better than click apps, including smoothness. However, it can be a touch better like in waydroid, running wayland.

                            question nr two: Have you tried something more exotic, like Brave or Libre office?

                            B 1 Reply Last reply Reply Quote 0
                            • B Offline
                              Bouleetbil @Rinkeby
                              last edited by Bouleetbil

                              @Rinkeby
                              I've tested xfce4, vnc, libreoffice, ssh that works
                              I've some issues with the virtual keyboard and chromium
                              For firefox with firefox-esr-mobile-config it's not bad but the keyboard hide the search bar.

                              I use this chroot with a physical keyboard and a wireless display as a little computer.

                              BTW I've added my script for enable wake up on tap on startup https://gitlab.com/bouleetbil/ubports-scripts#enable-wake-up-on-tap-on-startup

                              Pixel 3a ubports focal RC version daily use with pinetime
                              PinePhonePro Mobian / ubports Focal
                              Redmi 9S focal devel version

                              R 1 Reply Last reply Reply Quote 0
                              • R Offline
                                Rinkeby @Bouleetbil
                                last edited by

                                @Bouleetbil

                                amazing!

                                But sorry, I have another question (Keeps the thread on top tough) and that is that I see libertine now in your script. will it messup my already existing libertine setup. because I got firefox up and nice with ad ons. and will it be a conflict?

                                best regards.

                                B 1 Reply Last reply Reply Quote 0
                                • B Offline
                                  Bouleetbil @Rinkeby
                                  last edited by

                                  @Rinkeby
                                  Hello, no problem, you will have any conflict. It's just the official chroot for ubports.
                                  I use it for test libertine.

                                  Pixel 3a ubports focal RC version daily use with pinetime
                                  PinePhonePro Mobian / ubports Focal
                                  Redmi 9S focal devel version

                                  R 1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    moodroid
                                    last edited by

                                    Thanks @Bouleetbil
                                    I did try the new command to create the chroot, and it worked fine. But I was still struggling with some of the later steps.
                                    Hopefully this will make it simpler - looking forward to trying it out…

                                    1 Reply Last reply Reply Quote 0
                                    • R Offline
                                      Rinkeby @Bouleetbil
                                      last edited by

                                      @Bouleetbil

                                      Hey, I cant get it to work. Only get "can not connect to bus.

                                      here is a dump

                                      ce7f3cdc-d37b-4d75-bb3e-0139e7eecaf5-image.png

                                      B 1 Reply Last reply Reply Quote 0
                                      • B Offline
                                        Bouleetbil @Rinkeby
                                        last edited by

                                        @Rinkeby hello don't lanch install.sh with root. The scripts use sudo

                                        Pixel 3a ubports focal RC version daily use with pinetime
                                        PinePhonePro Mobian / ubports Focal
                                        Redmi 9S focal devel version

                                        R 1 Reply Last reply Reply Quote 0
                                        • R Offline
                                          Rinkeby @Bouleetbil
                                          last edited by

                                          @Bouleetbil

                                          welp. regardless, nothing works. You done great work. But, Im just lost and it doesnt work here and there.

                                          take your time to see and test if you can make a manual or a full install script. It all got a bit fragmented perhaps?

                                          R 1 Reply Last reply Reply Quote 0
                                          • M Offline
                                            moodroid
                                            last edited by

                                            Hi @Bouleetbil - I've just tried, and got this:

                                            phablet@ubuntu-phablet:~/ubports-scripts$ ./install.sh
                                            cp: cannot create regular file '/home/phablet/.config/systemd/user/debian-mount.service': No such file or directory
                                            Failed to enable unit: Unit file debian-mount.service does not exist.
                                            

                                            Any ideas?

                                            Thanks

                                            B 1 Reply Last reply Reply Quote 0
                                            • R Offline
                                              Rinkeby @Rinkeby
                                              last edited by

                                              @Rinkeby

                                              Came out harsh for some reason. But what I meant was, that I really hope to see something that works. Because I long for it!

                                              1 Reply Last reply Reply Quote 1
                                              • First post
                                                Last post