How to install Ubiquiti mFi and/or UniFi software in a FreeNAS jail

Status
Not open for further replies.

travanx

Explorer
Joined
Jul 1, 2014
Messages
62
Deleted jail, put 4.8.14 on like post #30. Works great. Next time before messing with the jail I need to remember to backup the controller settings.
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
I followed the OP instructions and have 4.8.15 running, or it seems. My AP is on order.

I also followed post 30, and got to the same place. I prefer the method in post 30 :)

Any thoughts on the easiest way to upgrade the version of this software once the jail is up and running?

Cheers,
 
Last edited:

MtK

Patron
Joined
Jun 22, 2013
Messages
471
I can confirm steps on post #30 work with latest UniFI, 4.8.15, without compiling snappy (steps 8+9).
 

wtfR6a

Explorer
Joined
Jan 9, 2016
Messages
88
did you manage to adopt new access points without updating the snappy? curious if they solved it in the root package
 

MtK

Patron
Joined
Jun 22, 2013
Messages
471
did you manage to adopt new access points without updating the snappy? curious if they solved it in the root package
Without 'make'-ing the snappy, yes.
 

Sabbath92

Cadet
Joined
Mar 1, 2016
Messages
6
UniFi v5.0.6 out today, is there a good way of upgrading? Or backup, delete jail, create new jail then restore the way to go?
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
I tried simply updating but it seemed to not work well (APs would not register to Unifi properly). So I made a new jail, installed 5.0.7 as per the instructions in step #30. Seemed to work swimmingly.

Cheers,
 

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
If anyone has figured a good way to update, let me know! I'm currently on 4.8.14.
 

George51

Contributor
Joined
Feb 4, 2014
Messages
126
If anyone has figured a good way to update, let me know! I'm currently on 4.8.14.
If you did it how I described in #30

Code:
#to update
#make a back up of the config
edit /etc/rc.local
"#" to the start line
#restart jail
rm -Rf UniFi
wget https://www.ubnt.com/downloads/unifi/5.0.6/UniFi.unix.zip
unzip UniFi.unix.zip
rm UniFi.unix.zip
rm /UniFi/bin/mongod
ln -s /usr/local/bin/mongod /UniFi/bin/mongod
cp /usr/local/share/java/classes/snappy-java.jar /UniFi/lib/snappy-java-1.0.5.jar
edit /etc/rc.local
remove "#" from the start line
#restart jail
#https://IP.address.of.jail:8443/ and restore from the back up


Sometimes the restoring of the backup will hang and not look like its worked - I left it a while then just restarted the jail again - it worked fine.
 

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
Thanks, George51. Your process went exactly as you described. As to the hang... it definitely looked like it was hung, but something was happening in the background. I think it updated my AP while the UI was down, as my wifi went down as well... then all of a sudden, after a minute or so, it was all back. The UI was good to go. My WiFi was back on. Thanks!
 

sharkytm

Cadet
Joined
Jan 22, 2016
Messages
2
Just confirming this works for 5.0.7, especially if you remember that its httpS in the address, not http... o_O

::Edit:: aaaannnddd, I'm stuck in the adopting loop, even after following post #30's directions, sans steps 8&9. Running those now to clean up snappy.

::Edit2:: and nope... no adoption love. Not sure why, but it won't adopt an AP, but the same controller version installed on my desktop adopts immediately. It's definitely something in the jail BSD setup. I may try going back down to 5.0.6, but I doubt that's the issue.
 
Last edited:

wtfR6a

Explorer
Joined
Jan 9, 2016
Messages
88
are you in the same LAN segment? Have you tried logging into the AP and forcing adoption?
They fixed the snappy-java issue a few versions back I recall 95%.
 

sharkytm

Cadet
Joined
Jan 22, 2016
Messages
2
are you in the same LAN segment? Have you tried logging into the AP and forcing adoption?
They fixed the snappy-java issue a few versions back I recall 95%.
Yes, I'm on the same LAN segment, and I tried forcing the adopt address. All I get is the Server Reject error.

I tried a new jail, and running the script here: https://github.com/gregf/unifi-freenas, and it worked perfectly. No clue what the key differences are (there are quite a few, including OpenJDK instead of Snappy), but can't argue with the results.
 

Borja Marcos

Contributor
Joined
Nov 24, 2014
Messages
125
I am not running them on jails, just plain FreeBSD systems, but I hope my experience can help.

The first time I installed them I used the available ports. However, the port maintainer doesn't track alpha or beta versions, just official ones. So I ended up doing everything by myself. Anyway the ports help to get dependencies right.

Some issues: mFi is not compatible with modern Mongodb versions. It requires a version of Mongodb in the 2.4 branch. I suffered serious problems with that when I migrated from Mac OS X to FreeBSD, as Mondogb had gone to 2.5 recently. The symptom was, it was unable to adopt devices.

Finally, someone in the Ubiquiti forums casually mentioned trouble with a mongodb version, and I obtained the port files for the latest 2.4. It did the trick, it's been working like a charm for a long time now.

I haven't seen any differences between running Java 7 or Java 8. I see that the mFi port has been discontinued, but you can find it going backwards in the FreeBSD version control.


The latest port for UniFi is for version 5.0.7, from June. My installation is working with mongodb 2.6.7.

For updates, I do the following: (I have a dataset for the UniFi installation, and a separate dataset for UniFi/data)

Code:
# service unifi stop

(wait for Unifi and mongodb to really stop)

zfs snapshot pool/unifi@whatevernameIchoose
zfs snapshot pool/unifi-data@whatevernameIchoose

cd /usr/local/share/java
unzip /tmp/UniFi.unix.zip      # The file I have downloaded from Unifi
# and now time to fix a couple of bits
cd /usr/local/share/java/UniFi/bin
rm mongod      #it will be a symbolic link to /usr/bin/mongod, which is so linux-like, hence wrong
ln -s /usr/local/bin/mongod mongod
cd ../lib
#
# the snappy library they ship includes binary support for Linux and maybe Solaris (I don't remember)
# but not FreeBSD. Just install archivers/snappy from the ports collection and make a symbolic link
#
rm snappy-java-1.0.5.jar           # the Snappy library they ship has system dependent code, replace it
ln -s /usr/local/share/java/classes/snappy-java.jar snappy-java-1.0.5.jar


After doing this I can start the service without problems.

# service unifi start

Been running like this for some time, and I even had to rollback once. Just a matter of stopping and rolling back snapshots.
 

travanx

Explorer
Joined
Jul 1, 2014
Messages
62
Post #49 worked for me on 5.0.7. After restoring from backup it got stuck but wifi could connect. Waited about 5 minutes and restarted the jail as I couldn't get into the unifi UI. As I got into the restored UI I saw both of my AP's upgrading and that took about 3-4 minutes to update both. Everything now works.
 

Borja Marcos

Contributor
Joined
Nov 24, 2014
Messages
125
No UniFi.unix.zip for 5.2.7, also looks like they removed it for all previous too. What now?
They stopped announcing them for a short interim. They just wanted to make it clear that "homebrew" installs on unsupported systems get no support. However, the files were available the same. Just edit the download URL changing the file name and there you are.

Try this URL:
UniFi.unix.zip

I am following their alpha and beta versions and so far they work. I hope they won't make some deeper change rendering it unusable. Anyway, the best thing we heretic daemonic users can do is to sign up to their forums and report when it works. Hopefully they will realize that being nice to us is not that hard!
 

Wirefree

Dabbler
Joined
Dec 16, 2014
Messages
12
I know the intent of this thread is to set up the Unifi controller in a native FreeBSD Jail, but as an alternative I have it working nicely in a Debian VM through a Virtualbox jail. It is perhaps counter intuitive to add another layer to accomplish the same goal (and certainly consumes more resource), but the tradeoff is that UBNT seems to support Linux better at this time. Its certainly a smoother (less steps) install using a .deb package.

For example, I wasn't successful getting the recent 5.2.7 running in my current jail but it did work in the Debian VM. Just a thought for anyone having difficulty with a traditional Jail.
 

XanALaOM00

Cadet
Joined
Nov 8, 2015
Messages
5
I am agreeing with Wirefree here, I have tried a number of different ways to get this to work in a jail and finding that the Virtualbox ubuntu/debian build is the easiest way to do this. If someone gets the newer versions like 5.2.9 installed and working in a jail please advise.

Thank you
 
Status
Not open for further replies.
Top