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

    How to Get LXD Running on Ubuntu Touch (Focal & Noble)

    Scheduled Pinned Locked Moved General
    6 Posts 3 Posters 1.4k Views 1 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.
    • arubislanderA Offline
      arubislander
      last edited by arubislander

      How to Get LXD Running on Ubuntu Touch (Focal & Noble)

      Here's a rough walkthrough on getting LXD running on UT based on my experience.

      If you're on Ubuntu Touch Focal, you’ll need to enable snap support first. Install Snapz0r from the Open Store, run it and initialize snap support. If you're on Noble you can skip this step, since snap support is already enabled.

      Next, install LXD. I used version 5.21 specifically, because newer versions gave me trouble on the JingPad. You can install it like this:

      $ sudo snap install lxd --channel=5.21/stable
      

      Once LXD is installed, initialize it with:

      $ sudo lxd init
      

      Accept all the defaults except for the storage backend. When prompted, choose dir instead of zfs, which tends to be problematic in this environment.

      After that, you need to adjust the default profile to allow nested containers and privileged access:

      $ sudo lxc profile set default security.nesting true
      $ sudo lxc profile set default security.privileged true
      

      Now you can launch your first container. For example, to create one based on Ubuntu Noble:

      $ sudo lxc launch ubuntu:noble noble-1
      

      Wait for the container to boot. You can check its status with:

      $ sudo lxc list
      

      Once it's up, you can enter the container with:

      $ sudo lxc exec noble-1 -- bash
      

      At this point, you should be inside a fully functional Ubuntu container running on Ubuntu Touch.

      EDIT (24-09-2025) : It has come to my attention that, while this procedure should work for most devices, the resulting containers may not have functioning internet access. At the time of writing I tried this on my Pixel 3a and my Jingpad, and with both this worked well. However on a OnePlus Nord N10, a FairPhone 4 and 5, this resulted in containers that did not have internet access. Even pinging to 8.8.8.8 resulted in a permission denied error. So ymmv.

      πŸ‡¦πŸ‡Ό πŸ‡³πŸ‡± πŸ‡ΊπŸ‡Έ πŸ‡ͺπŸ‡Έ
      Happily running Ubuntu Touch
      JingPad (24.04-1.x daily)
      OnePlus Nord N10 5G (24.04-2.x daily)
      PinePhone OG (20.04)
      Meizu Pro 5 (16.04 DEV)

      fredldotmeF 1 Reply Last reply Reply Quote 3
      • H Offline
        harrisonpatm
        last edited by

        Unfortunately, didn't work for me. Snapz0r ran and rebooted the device, but afterwords snap still wasn't enabled. Mounting root to rw and attempting to install snapd via apt also didn't work, I'm assuming because of dependency issues and/or not enough space on the small root partition. Thanks though.

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

          @harrisonpatm said in How to Get LXD Running on Ubuntu Touch (Focal & Noble):

          Unfortunately, didn't work for me. Snapz0r ran and rebooted the device, but afterwords snap still wasn't enabled.

          This is on your Pixel 3a XL? And you are running an unmodified Focal (i.e. no additional packages installed via apt on the rootfs)?

          πŸ‡¦πŸ‡Ό πŸ‡³πŸ‡± πŸ‡ΊπŸ‡Έ πŸ‡ͺπŸ‡Έ
          Happily running Ubuntu Touch
          JingPad (24.04-1.x daily)
          OnePlus Nord N10 5G (24.04-2.x daily)
          PinePhone OG (20.04)
          Meizu Pro 5 (16.04 DEV)

          H 1 Reply Last reply Reply Quote 0
          • H Offline
            harrisonpatm @arubislander
            last edited by

            @arubislander Nope, I have added a few apt packages already. And honestly I'm probably about to reinstall from scratch, so I'm sure I'll give this another try.

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

              @harrisonpatm Please do! And let us know how you get on.

              πŸ‡¦πŸ‡Ό πŸ‡³πŸ‡± πŸ‡ΊπŸ‡Έ πŸ‡ͺπŸ‡Έ
              Happily running Ubuntu Touch
              JingPad (24.04-1.x daily)
              OnePlus Nord N10 5G (24.04-2.x daily)
              PinePhone OG (20.04)
              Meizu Pro 5 (16.04 DEV)

              1 Reply Last reply Reply Quote 0
              • fredldotmeF Offline
                fredldotme @arubislander
                last edited by fredldotme

                @arubislander Regarding containers not having access to the internet: It might be the device is using "Paranoid Android Networking" in the kernel, stemming from Android, which limits use of sockets to a special group ID.

                To device maintainers wanting to support LXD, you will want to check whether CONFIG_ANDROID_PARANOID_NETWORK is in your kernel tree (simply grep recursively for it) and if so, set CONFIG_ANDROID_PARANOID_NETWORK=n in your defconfig. I've since fixed this on the FP4 and verified working networking on the FP5.

                For a list of my contributions to Ubuntu Touch visit: https://fredl.me

                If you have enjoyed my work on Ubuntu Touch over the years, please donate to my causes:

                • PayPal: https://paypal.me/beidl
                • Liberapay: https://liberapay.com/fredldotme
                1 Reply Last reply Reply Quote 3

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better πŸ’—

                Register Login
                • First post
                  Last post