When I retired my 2008 macbook a couple of years ago I put it in a corner to use as a server. I started running Airvision 2 to host my Aircam security camera. I ran the software on an Ubuntu guest in a Parallels VM. Version 3 of airvision (since renamed Unifi Video ) has been out for quite some time and I decided to try to upgrade for several reasons. I discovered a docker container for unifi-video and since I’ve been hearing about docker for quite a while, and thinking docker would probably be less resource intensive than parallels, I decided to try to install it. It took more research than I expected but the results are satisfying. Here’s how to do it.
Installing Docker
It’s quite easy with Docker Toolbox. The DMG package includes VirtualBox and a VM management tool called
docker machine as well as, of course, docker and a few other goodies. Follow the instructions to run the quick-start terminal at the end of the installation and you’ll have a VM called default ready and running. It’s a good idea to run through the Docker User Guide at this point and run a couple of example containers.
Installing the Unifi video container
Download UniFi Network for PC - free download UniFi Network for PC/Mac/Windows 7,8,10, Nokia, Blackberry, Xiaomi, Huawei, Oppo - free download UniFi Network Android app, install Android apk app for PC, download free android apk files at choilieng.com. Search & Install any app on Mac. Skip to content. June 23, 2017 Amber. App name: Unifi Controller; App description: unifi-controller (App: Unifi.pkg). The UniFi Controller allows the administrator to instantly provision thousands of UniFi APs, map out networks, quickly manage system traffic, and further provision individual UniFi AP devices. The UniFi NVR (network video recorder) is the central hub of the UniFi Video system, and it comes pre-installed with UniFi’s video software to deploy and manage your cameras. Additionally, the UniFi NVR has a 2 TB hard drive that can store up to 700 hours of video at 1080p, and more if you use a lower resolution. All Windows Mac iOS Android. The Unifi app works with your in-home Unifi system to let you monitor and control your electricity while youre on the move.See the energy you.
Look at the README at Rednut’s github site and follow the instructions to clone the repository. (The instructions suggest you could alternatively use
docker pull but that didn’t work for me and anyway we need to alter the Dockerfile slightly before building.)
Data Shares
This is where the first complication pops up. The
docker run command Rednut includes in his README has options of the form -v HOSTDIR:/usr/lib/unifi-video . This maps a directory in the container to a shared directory in the host. This is a very useful feature. It allows us to access the important state of the app — the data and logs — without mucking around in the container’s filesystem, and allows us to conveniently back up that state with Time Machine or whatever, without the need to back up the VM or container at all (it can easily be reinstalled if necessary.) However this feature does not work so well on the mac — we’ll need to do a hack.
But for now, let’s just run the thing and see if we can get something working. Go ahead and run
docker build -t=rednut/unifi-video . (this will take some time) and then the docker run command without the two -v options. This should fire up a working unifi-video controller that you can access in your browser using the IP returned by docker-machine ip default as https://default-ip:7443 . But don’t get excited and start setting it up yet. We’ve got a long way to go.
The shared directory thing doesn’t work on the mac because of the way the intermediate virtualbox VM implements sharing. Yes, by default, /Users is shared, but it can only be written by a process in the container running as
root or docker . So we have to make the unifi-video user masquerade as the docker user. Add the following lines to Dockerfile near the end just before the WORKDIR and CMD commands:
Now run
docker build -t=rednut/unifi-video . again. (This time it will build very fast because previous layers have been cached.) And then decide where you want to keep your data and logs. I put them in a docker directory in my home directory. Now start up the container like this. (Oh, yes. First, please stop and remove the previous invocation with docker rm -v unifi-video .)
Now you should see a bunch of logs in
~/docker/unifi-video/logs . In particular you’ll notice that error.log and mongod.log indicate there’s a serious problem. mongo won’t start because it runs as its own user and can’t write to the shared data directory. Oh, dear. We can’t use the usermod hack to map two different users to the same user. And just changing the mongod user to be in group staff doesn’t help either.
One promising approach I tried that didn’t work was to tell VirtualBox to mount the shared directory using NFS. It is detailed in boot2docker issue 160.
This works well enough to allow all users to write through, but the problem is, mongo doesn’t work with NFS!
So what we’ll have to do is run mongo natively on the Mac and let unifi-video container connect to it with a socket.
Installing mongodb
It’s pretty easy to get mongo going with homebrew. Detailed steps are here. But before starting the mongo daemon we need to make a couple of changes to the configuration file at
/usr/local/etc/mongod.conf . First of all, delete the following lines:
This will allow mongo to listen to all network interfaces on the mac, especially the interface with the VirtualBox VM. (Or you can specify this interface explicitly if you want to be more rigorous.)
Then, if you’d like mongo to store its files in the same area as the unifi-video files, change the log and storage options:
Start mongo with
launchctl load .
Now stop the unifi-video container again. Connect to mongodb by editing the file
/Users/me/docker/unifi-video/data/system.properties so it looks like this:
Now run
docker restart unifi-video .The log files should indicate a connection with mongo and you should be able to see the app in your browser again. But we’ve still got a few more details to address. Accessing the app from other hosts
Right now you can access the app at
https://docker-default-ip:7443 . But you need to be able to see it from other hosts on the LAN and, by port forwarding from the LAN router, the outside internet. You can see some of my struggles in getting this going by reading my StackOverflow question. But you don’t need to. The answer is quite simple, and here it is.
Use NAT port forwarding on the VM. You can either use the VirtualBox GUI to set up the ports you’re forwarding in the NAT network adaptor (Adaptor 1), or use the following commands:
Now stop and remove your unifi-video container and run it again without the
-p options but with the —net=host option like this:
Now you should be able to see the app at
localhost:7443 on your mac and at YOUR_MAC_IP:7443 from other machines on the LAN. Yea!
I guess you could go ahead now and create an admin account and login and start playing with your video controller. But there’s still a couple of more details to consider.
Make sure everything runs automatically at reboot.
This page has pretty straightforward instructions on how to set up launchd to run the VM at login (you either need to have your mac set up to automatically log you in at reboot or install it as a system launchagent). Stop and remove the unifi-video container again and execute the
docker run command again adding the option --restart=always .
And if you haven’t done so already, follow the instructions on the mongo installation page to set up launchd. Almost done.
Time machine
Still working on this one. I think all you have to do is find the the virtual box VM file and exclude it in Time Machine options.
Setting up Unifi Video
I’ll let you follow the Ubiquiti docs on this. On thing that is missing in Unifi Video compared to my old Airvision 2 setup is push notifications. I had to do a fair amount of hacking to get that one to work. I use the Prowl app on the mac to receive push notifications. You can activate prowl by sending an email to a special address. Before, I could open the notification in prowl and click on the URL and view the recording in Safari. Now that doesn’t seem to work, you have to use the UniFi Video app. Although the app is nice, it doesn’t launch automatically. I don’t know if Ubiquiti is working on a push notification feature for the app, but a drop-dead simple workaround would be if they simply added a
URL Scheme to the app. Then you could set up Prowl to automatically redirect and open the app when notified.
Issues
At the moment I’m having the following issues:
1. NTP — the VirtualBox VM is not keeping time well, as a result the timestamp on the camera image and recordings is off. The time gets set correctly when the VM is restarted but it rapidly gets behind. It’s lost 10 minutes in a few hours. 2. I am getting flooded with emails saying that Aircam has lost connection — one a minute. And it clearly has not lost connection as I’m sitting here watching the live view and getting prowl notifications of motion recordings. Update.
It is clear that issue #2 is caused by issue #1. The camera has its time syncronized from the NVR. The camera clock runs at normal speed, but every minute or two it gets a message from the NVR telling it to set its clock back by 10 or 20 seconds or more. The camera gets confused and drops off line for a few seconds.
I have worked around this by downgrading Virtualbox from 5.0.4 to 4.3.30. Screenshot mac app annotate. See the discussion on Docker Toolbox Issue 193. Everything is working great now.
Ubiquiti Network Management System
Making day-to-day jobs of your ISP business simpler.
Centralized configuration, backups and firmware upgrades
Performance charts with real-time graphs
Integrated Customer Management, Support & Billing (CRM)
New UNMS Cloud option – hosted by us for free
UNMS Mobile
UNMS Mobile is a convenient client application for installing airMAX devices.
Device discovery
Spotify download app. Antenna alignment
Configuration backup and sharing
Offline firmware upgrades
Link Simulator: Optimized for Performance
Use airLinkTM to calculate outdoor links using airFiber or airMAX devices.
Capacity and signal level calculations based on geographic coordinates
Line-of-sight and fresnel zones alongside elevation data, while also accounting for the earth’s curvature
No need for client-side plug-ins – an intuitive and quick interface features a responsive design for mobile use
WiFiman App
WiFiman is ideal for analyzing nearby Wi-Fi networks and Bluetooth LE devices, device discovery, and network speed tests.
Channel Location
WiFiman helps you locate a less crowded channel for your Wi-Fi Access Point https://oqsoclv.weebly.com/folder-color-app-mac.html.
Device Analyzer
WiFiman scans the whole network subnet and shows you all of the available devices
Network Speed Test
You can test the speed of your internet connection Unifi App Download
Network Management Controller
The UniFi® Software-Defined Networking (SDN) platform is an end-to-end system of network devices across different locations — all controlled from a single interface.
Intuitive and robust configuration
Control and monitoring
Local and cloud access
Mobile App for Easy Configuration
Unifi Video App Mac Os
Use the UniFi® app to monitor and manage your UniFi networks and devices.
Seamlessly adopt UniFi devices on offsite controllers
Provision a stand-alone UniFi AP without a UniFi Controller
Easily access local and cloud controllers
Make quick configuration adjustments
Simply Scalable Video Security
Unifi Windows App
Scalable, plug-and-play network camera system. View your live video and recordings anywhere with free cloud access and mobile applications.
Unifi Video App Mac Pro
Highly Scalable
Add 20 cameras to your system to cover every angle
Performance
Powerful optics, high power night vision, and sharp, full HD video streaming
No Monthly Fees
Free cloud access for streaming and viewing your recordings
Control your data
Your video is stored on your own secure hardware, not a cloud server
WiFiman App
WiFiman is ideal for analyzing nearby Wi-Fi networks and Bluetooth LE devices, device discovery, and network speed tests.
Channel Location
WiFiman helps you locate a less crowded channel for your Wi-Fi Access Point
Device Analyzer
WiFiman scans the whole network subnet and shows you all of the available devices
Network Speed Test
You can test the speed of your internet connection Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |