unifios-utilities icon indicating copy to clipboard operation
unifios-utilities copied to clipboard

UniFi OS - Dream Machines 2.x

Open StiviiK opened this issue 3 years ago • 153 comments

Ubiquiti recently annouced in the latest update notes for the UniFi OS - Dream Machines, they will migrate to 2.x soon. https://community.ui.com/releases/UniFi-OS-Dream-Machines-1-12-30/a4f85653-7bc6-461a-8715-94298cb69164

If I am not mistaken, that means they will align the firmware with the firmware of the UDM SE. Do you know what are the effects of that and how the work of this awesome project will be affected? I am only aware that this will drop Podman?

StiviiK avatar Sep 22 '22 14:09 StiviiK

I've been wondering the same thing.

SamErde avatar Sep 22 '22 15:09 SamErde

So this means a couple things I believe. You will have to install podman via our udm-se builds probably. Beyond that the baseOS will have systemd now and if I remember correctly they let you customize. I think it will get rid of the need for the deb install and we will just have to update all instructions here to take 2.0 into account.

boostchicken avatar Nov 16 '22 09:11 boostchicken

That's good to hear, I've been holding off upgrading because quite used to using Pihole :)

Slychocobo avatar Nov 16 '22 18:11 Slychocobo

Curious if anyone had success with recent versions and installing podman from udm-se? My UDM is stuck on 1.11.4 (with podman 1.x) because of trauma from updating firmwares in the past

dvcrn avatar Nov 17 '22 00:11 dvcrn

Version 2.4 is now live for UDM (base, pro): https://community.ui.com/releases/UniFi-OS-Dream-Machines-2-4-23/aebbba64-9e7e-4151-bcca-34ed08761f08 Thanks a lot for your work so far! I am badly wanting to get DNS-Requests redirected :)

user45876 avatar Dec 15 '22 13:12 user45876

Has anyone performed the migration to 2.4.23?

Did any data related to on_boot remain on disk?

Does the migration nuke everything?

I'm hesitant to upgrade this early as I do need my DNS redirect and cloudflared services to remain running.

OfficialHoSay avatar Dec 15 '22 16:12 OfficialHoSay

All erased on my UDMB, no data folder in mnt

aniolpages avatar Dec 15 '22 16:12 aniolpages

Has anyone performed the migration to 2.4.23?

Did any data related to on_boot remain on disk?

Does the migration nuke everything?

I'm hesitant to upgrade this early as I do need my DNS redirect and cloudflared services to remain running.

For me it got rid of the on_boot.d folder and any podman containers I had it also completely got rid of podman. It leaves Unifi OS related configs such as network but anything custom is gone.

360sym avatar Dec 15 '22 16:12 360sym

Yes, everything was purged from this partition

mabunixda avatar Dec 15 '22 18:12 mabunixda

root@udmp:/persistent# dpkg -i udm-boot_1.0.5_all.deb 
Selecting previously unselected package udm-boot.
(Reading database ... 50954 files and directories currently installed.)
Preparing to unpack udm-boot_1.0.5_all.deb ...
/var/lib/dpkg/tmp.ci/preinst: 19: /var/lib/dpkg/tmp.ci/preinst: /sbin/ssh-proxy: not found
dpkg: error processing archive udm-boot_1.0.5_all.deb (--install):
 subprocess new pre-installation script returned error exit status 127
/var/lib/dpkg/tmp.ci/postrm: 24: /var/lib/dpkg/tmp.ci/postrm: /sbin/ssh-proxy: not found

Well the current installation does not run, cleaning it with

root@udmp:~# dpkg --purge --force-all udm-boot

But with this update tools like ansible are working fine now

mabunixda avatar Dec 15 '22 18:12 mabunixda

All erased on my UDMB, no data folder in mnt

  • For me, /mnt/data/ is missing, but /mnt/.rwfs/data exists. However, it looks like it's been cleared out.
  • unifi-os shell results in -bash: unifi-os: command not found
  • The install script fails with Missing dependencie(s): `podman`

Not sure why /mnt/data is missing—the overlayfs is mounted

overlayfs-root on / type overlay (rw,noatime,nodiratime,lowerdir=/mnt/.rofs,upperdir=/mnt/.rwfs/data,workdir=/mnt/.rwfs/.workdir)

Edit: derp, it's mounted at /data, I guess that's the new location in 2.x.

How are people installing podman?

Edit 2: Got it working. I downloaded the install script, and modified the case "$(udm_model)" statement to run the udr|udmse case for udm:

From b368017f4f3e83161549e36c93ada2dede7d6ffc Mon Sep 17 00:00:00 2001
From: Bennett Perkins <[email protected]>
Date: Fri, 16 Dec 2022 07:49:03 +0800
Subject: [PATCH] got remote_install.sh working on UDM 2.4.23

---
 on-boot-script/remote_install.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/on-boot-script/remote_install.sh b/on-boot-script/remote_install.sh
index 62de92c..87ce59e 100755
--- a/on-boot-script/remote_install.sh
+++ b/on-boot-script/remote_install.sh
@@ -160,7 +160,7 @@ depends_on curl
 ON_BOOT_D_PATH="$DATA_DIR/on_boot.d"
 
 case "$(udm_model)" in
-  udm|udmpro)
+  udmpro)
     echo "UDM/Pro detected, installing on-boot script..."
     depends_on podman
 
@@ -172,7 +172,7 @@ case "$(udm_model)" in
 
     echo "UDM Boot Script installed"
     ;;
-  udr|udmse)
+  udr|udmse|udm)
     echo "UDR/UDMSE detected, installing on-boot script..."
     depends_on systemctl
 
-- 
2.37.1 (Apple Git-137.1)

bennettp123 avatar Dec 15 '22 23:12 bennettp123

You will have to install podman via our udm-se builds probably.

In README.md All artifacts can be found on IPFS https://unifi.boostchicken.io/

Extract the zip to the root of your device! Look at the assets on the Podman workflow.

timrettop avatar Dec 15 '22 23:12 timrettop

Using @bennetp123's advice, I was also able to install after updating my UDM base using the modified remote_install.sh I tested the https://github.com/fire1ce/UDM-Persistent-SSH-Keys script and made two modifications to 99-ssh-keys.sh to use the /data path and to test for the existence of and make the /root/.ssh folder if necessary.

After that I'm able to ssh in with my key after reboot!

timrettop avatar Dec 16 '22 01:12 timrettop

In README.md All artifacts can be found on IPFS https://unifi.boostchicken.io/ Extract the zip to the root of your device! Look at the assets on the Podman workflow.

can someone confirm this working on UDM? Last upgrade I had to leave podman at 1.0 since the updated variants didn't work for me. Do those SE builds work on normal UDM as well?

Also how is the unifi-shell now executed? Previously that was a podman container, but that is no longer the case I presume?

dvcrn avatar Dec 16 '22 02:12 dvcrn

This worked for me but my testing is limited. If you're willing to test it, you can use this:

curl -fsL "https://raw.githubusercontent.com/jinkang23/unifios-utilities/main/on-boot-script/remote_install.sh" | /bin/sh

I just submitted PR to add this change: https://github.com/unifi-utilities/unifios-utilities/pull/451

jinkang23 avatar Dec 16 '22 06:12 jinkang23

Thanks, @jinkang23 , I tested it and it seems to be working. One question: The CNI Bridge is not needed if I only want to execute a startup script. Is it needed anyway, as there are no more containers on UDM FW2.x onwards?

user45876 avatar Dec 16 '22 07:12 user45876

In README.md All artifacts can be found on IPFS https://unifi.boostchicken.io/ Extract the zip to the root of your device! Look at the assets on the Podman workflow.

can someone confirm this working on UDM? Last upgrade I had to leave podman at 1.0 since the updated variants didn't work for me. Do those SE builds work on normal UDM as well?

I can confirm it's working, at least enough to get podman run --rm -it busybox working (edit: I got pihole up and running too, so I'd say it's thoroughly working)—though I needed to create some missing files manually, as outlined in #384:

  • /etc/containers/registries.conf
  • /etc/containers/policy.json
  • /etc/containers/storage.json

I used udmpro-podman-install.zip from https://unifi.boostchicken.io/ —not sure if that's the right version, or if there is even a difference between them (udmse-podman-install.zip seems to work fine too, though I didn't try to run any containers).

Also how is the unifi-shell now executed? Previously that was a podman container, but that is no longer the case I presume?

No idea—podman ps can't see it so I guess it doesn't exist 🙃

bennettp123 avatar Dec 16 '22 11:12 bennettp123

Thanks, @jinkang23 , I tested it and it seems to be working. One question: The CNI Bridge is not needed if I only want to execute a startup script. Is it needed anyway, as there are no more containers on UDM FW2.x onwards?

Yea, I'm not sure about that. I figured it was there because you can still technically install podman. I suppose you could remove them afterwards if you don't plan on using it.

jinkang23 avatar Dec 16 '22 15:12 jinkang23

I would suppose so as well. I just deleted the install (05...) and startup (06...) script and be fine with it. I can also confirm that it is working well and also surviving reboots.

Thanks again for your efforts, very much appreciated, happy camper here :)

user45876 avatar Dec 16 '22 19:12 user45876

Thanks for the comments all! I know what my evening project will be, fingers crossed it goes equally smooth. I only have 2 podman containers to migrate but let's see...

Did upgrading the firmware wipe everything that was previously persisted in /mnt/data or did data files stay / got migrated to /data?

dvcrn avatar Dec 17 '22 01:12 dvcrn

Did upgrading the firmware wipe everything that was previously persisted in /mnt/data or did data files stay / got migrated to /data?

The migration will delete all data.

jfroy avatar Dec 17 '22 02:12 jfroy

For anyone looking to install Podman I put together a build here. It's distributed through a Debian package so easy to install and remove (setup could done easily as an on_boot script). It uses current versions of Podman and its dependencies. So far working well for me on my UDMP on 2.4 and I plan to maintain this going forward.

Heavily inspired by the work done in this repo and the comments here about getting podman running. Wanted to share as it seemed it might save some people headache getting it working.

zlangbert avatar Dec 19 '22 06:12 zlangbert

Does the configuration of Podman also get lost?

As in, if I install podman again after the update, will all my previously running containers be running in the state they were before the update? Or do I have to re-create / restore everything by hand?

georgeboot avatar Dec 19 '22 14:12 georgeboot

Does the configuration of Podman also get lost?

As in, if I install podman again after the update, will all my previously running containers be running in the state they were before the update? Or do I have to re-create / restore everything by hand?

The migration will delete all data.

gatesry avatar Dec 19 '22 14:12 gatesry

For anyone looking to install Podman I put together a build here. It's distributed through a Debian package so easy to install and remove (setup could done easily as an on_boot script). It uses current versions of Podman and its dependencies. So far working well for me on my UDMP on 2.4 and I plan to maintain this going forward.

Heavily inspired by the work done in this repo and the comments here about getting podman running. Wanted to share as it seemed it might save some people headache getting it working.

Thank you so much! My UDM-PRO auto-updated over night to the 2.4 Firmware and everything was gone. With your Podman build I managed to bring back up my multicast-relay on my UDM-PRO.

henessy31 avatar Dec 20 '22 09:12 henessy31

Looks like they pulled the 2.x upgrade for UDM again. Anyone happen to have the firmware upgrade downloaded?

dvcrn avatar Dec 23 '22 09:12 dvcrn

@dvcrn It's in early access: https://community.ui.com/releases/UniFi-OS-Dream-Machines-2-4-23

tscheckenbach avatar Dec 23 '22 11:12 tscheckenbach

@tscheckenbach I'm enrolled in EA, but that link you sent is 404ing for me

Glenn posted a week ago that they pulled the 2.x firmware: https://community.ui.com/releases/UniFi-OS-Dream-Machines-2-4-23/aebbba64-9e7e-4151-bcca-34ed08761f08#comment/5cc499c9-0744-4cc2-a448-d9f2ac8c98dd

dvcrn avatar Dec 23 '22 11:12 dvcrn

curl -fsL "https://raw.githubusercontent.com/jinkang23/unifios-utilities/main/on-boot-script/remote_install.sh" |

This worked for me, thanks.

pshirshov avatar Dec 28 '22 19:12 pshirshov

Why are you using a special podman package to install podman? On my udm se podman is available via apt:

podman/stable 3.0.1+dfsg1-3+deb11u1 arm64

Can't i just install podman via apt?

foxcris avatar Dec 29 '22 08:12 foxcris