Reply
Highlighted
New Member
Posts: 33
Registered: ‎04-05-2018
Kudos: 11

How to install mFi in Ubuntu (and run it on Hyper-V)

[ Edited ]

Hyper-V deployment of Ubuntu-based (V16) Ubiquiti mFi Server

You can also perform a regular Ubuntu install using these instructions, simply skip steps 1-4.

 

  1. Download Ubuntu from a reputable source, 64 bit edition. Place the .iso file where it will be accessible to your Hyper-V server (in this case, we have a folder designated for install files right on the server for speed and ease of use).
  2. Create a new virtual machine with ~25+ Gb of storage, 2+ processors, and at least 4Gb of memory, and at least one virtual ethernet port. Give it a useful name, and attach it to your network via your virtual (external) switch;  You may decide to use internal switching for test purposes before you expose the system to your network, i.e. change from an internal switch to an external switch later on when you’re ready to go live.  I recommend using a Generation 1 setup unless you’re intimately familiar with the intricacies of UEFI boot and how it interacts with non-windows installations.
    A note on hard drive selection:  In professional environments, it is now trivial to select “slow” and “fast” types of storage (spinning vs. SSD vs. Ramdisks) on Hyper-V servers for Virtual Machines.  This will be a high-latency, low bandwidth application, so I recommend using slow, cheap disks for the installation since faster drives will not yield better results (nearly invisible improvement).  If this is a home/hobby installation, please disregard this note.
  3. During the setup, point the boot device to the Ubuntu .ISO file under “installation options”. This way, upon first boot the Hyper-V will “spin up” the Ubuntu image you downloaded and begin installing it. 
  4. Start the VM and connect to it. You should see the UBUNTU installation screen after a few seconds, depending on the speed of your system.
  5. Begin installing Ubuntu as you normally would. In most cases that will involve using default values, but your mileage may vary.
  6. Make sure you pick a username and password that you will remember. Once you set up something like an mFi server, you will RARELY access it directly;  It is important to have a good, working password policy in place or some kind of secure repository for long term maintenance.  If you’re a home/hobby installer:  You know the deal; If you forget the password, you’re on your own.  This is Linux so … your options will be severely limited if you don’t know the password (read:  You can't get past step 9 below).
  7. Once installation finishes, don’t forget to “eject” the .iso file from the virtual CDROM.
  8. You may need to restart the VM.
  9. After the restart, log in with your password from step 6.
  10. Start a terminal session.
  11. We need to install Java 7. Not Java 8 or above, but Java 7.  The problem is that the built-in repositories don’t support Java 7 anymore, i.e. officially Ubuntu 16 does not support Java 7.  In addition, Solaris no longer supports Java 7 either, and has reportedly put Java 7 behind some kind of pay wall.  I found a work-around here:
    https://askubuntu.com/questions/761127/how-do-i-install-openjdk-7-on-ubuntu-16-04-or-higher
    Enter the following commands in sequence:
    sudo add-apt-repository ppa: openjdk-r/ppa       [no space between : and o, the forum engine turns it into Man Surprised]
    sudo apt-get update  
    sudo apt-get install openjdk-7-jdk
    You will need to enter your password once, and also respond with “[ENTER] to continue” and “y/n” prompts.  The final command will take a few minutes to complete, depending on your internet connection
  1. Install mFi using the directions found at:
    https://help.ubnt.com/hc/en-us/articles/211656797-mFi-How-To-Install-the-mFi-Controller-in-Ubuntu-or...
    The instructions there are rather wishy-washy, so let me break this into the following pieces:
    edit the “sources.list” by adding a line
         sudo gedit /etc/apt/sources.list
         then scroll to the bottom of the file and add the line:
         deb http://dl.ubnt.com/mfi/distros/deb/ubuntu ubuntu ubiquiti

     save the file and close it.  Enter the following lines in the terminal:
     sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50
     sudo apt-get update
     sudo apt-get install mfi

  1. Install Flash by opening firefox. Ignore the initial nag screens and do a search for “install flash”.
    As of this writing, the link is https://get.adobe.com/flashplayer.  (steps 14-18).
  2. Select: APT for Debian, Ubuntu and click “Open Link”
  3. Click yes on the “Enable additional software channel” popup.
  4. Enter your password from step 6 and click on “Authenticate”.
  5. Click “Install” on “Install additional software?”
  6. Enter your password from step 6 and click on “Authenticate”, again.
  7. Find your IP address by opening a terminal prompt and then entering ifconfig.
  8. In this example case, my IP address is 10.1.0.66. Go to your browser (FireFox) and http to that IP address.  You should be able to test the presence of your mFi server now.  For me, I used:  https://10.1.0.66:6443 in the address bar (obviously use your IP), and then Advanced, and then click on “Add Exception” and “Confirm exception”.
    Immediately following this, you should see the mFi welcoming screen, confirming that the mFi service is up and running.
  9. Lastly, you should set up a static IP address for your mFi instance. Click on the network connection icon near the top right of the screen, then “Edit Connections”.  You know the rest.
New Member
Posts: 9
Registered: ‎09-13-2015

Re: How to install mFi in Ubuntu (and run it on Hyper-V)

[ Edited ]

@HGPenk

 

Thank you very much for this tutorial.

Could you confirm if this is still working?

 

I followed your guide using Ubuntu 18.04 bionic beaver and couldn't install the jdk.

Installing mfi wasn't possible either, because the key is invalid.


 

As your post is just 2 weeks old I hope I did something wrong here.

Could Bionic Beaver be the problem?

Should I use an older version of ubuntu?

 

*Edit: [Solved] It was possible to install the JDK under Ubuntu 16.04. 

** On Ubuntu 17.xx and 18.04 I had no success.

*Edit2: [Solved] Installing MFi was possible, too and everything is working now!

 

Tahnk you so much

New Member
Posts: 9
Registered: ‎09-13-2015

Re: How to install mFi in Ubuntu (and run it on Hyper-V)

Well... Happy too soon... 

There seems to be a problem with my MongoDB version.

The automatically installed version seems to be too recent and because of that the MFi MPower device is stucked at "adopting"...

 

Hope I can fix this somehow...

New Member
Posts: 33
Registered: ‎04-05-2018
Kudos: 11

Re: How to install mFi in Ubuntu (and run it on Hyper-V)

Sorry I just saw your posts.  Unfortunately I'm not a Linux expert - I basically followed the info from various separate websites, many of which weren't even about anything to do with UniFi.

If your unit is stuck "adopting", I recommend checking the firewall settings, especially if your implementation is inter-site as ours are.  You may need to port forward.  Also, make sure your mFi is upgraded to the latest version, i.e. not the mFi server, the mFi device.

I was so happy after a couple of weeks of on-off again trying to get this to work and I managed to not only get it to work ONCE, but TWICE, i.e. the 2nd time I wrote down the procedure.  Unfortunately this blog stripped out the screenshots, so let me include a link here which I hope you can access.  My server is still running today, but honestly my expectation was to keep it "frozen" at the current level and not update it.  I'm not too worried about security issues - it's behind some enterprise level firewalls a couple of layers deep.

Click here for Instructions

 

 

New Member
Posts: 9
Registered: ‎09-13-2015

Re: How to install mFi in Ubuntu (and run it on Hyper-V)

@HGPenk

Thank you very much for your reply and for providing the pictures.

I wasn`t able to make it work, becaue I am a complete Linux noob.

Firewall was not a problem.

The problem was the MongoDB Version (there are several hints not to use 2.6 or later, because of the problem that mfi devices can get stuck during the adoption).

 

I ended up installing Lubuntu, Docker, Portainer (GUI for Docker) and fflo/mfi-controller

It ist working out of the box and I am happy now

 

 

 

New Member
Posts: 33
Registered: ‎04-05-2018
Kudos: 11

Re: How to install mFi in Ubuntu (and run it on Hyper-V)

[ Edited ]

@Hiromatsu

 

Very nice.  If you are able, try to document how you got this to work.  Maybe, over time, if enough people spend just a couple of hours documenting their steps we can make it easier for whoever follows.  It was a real struggle for me, mostly because I'm not a Linux user and because of the whole Java issue (Java 7 is unsupported by Sun and Linux at the same time!?!) throwing a huge curve ball into this issue.  I literally spent a few weeks on this, on and off, as time allowed between other work.  I must have visited about 100 different websites before I finally managed to get one solution to work - I then tried to replicate my steps as best as possible and documented (mostly for myself because I suck at everything Linux, honestly) it.  Somewhere in there it dawned on me that others might find it useful, so I posted here.

Regular Member
Posts: 381
Registered: ‎07-23-2015
Kudos: 156
Solutions: 7

Re: How to install mFi in Ubuntu (and run it on Hyper-V)

[ Edited ]
  1. Install mFi using the directions found at:
    https://help.ubnt.com/hc/en-us/articles/211656797-mFi-How-To-Install-the-mFi-Controller-in-Ubuntu-or...
    The instructions there are rather wishy-washy, so let me break this into the following pieces:
    edit the “sources.list” by adding a line
         sudo gedit /etc/apt/sources.list 
    I would use nano here instead of gedit

         then scroll to the bottom of the file and add the line:
         deb http://dl.ubnt.com/mfi/distros/deb/ubuntu ubunt ubiquiti
    Small typo, should say ubuntu ubiquiti

@HGPenk

New Member
Posts: 2
Registered: ‎04-29-2015

Re: How to install mFi in Ubuntu (and run it on Hyper-V)

jack@WhiskerBiscuit ~/mFi $ sudo apt-get install mfi
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mfi

 

 

This is as far as I have gotten     What am i doing wrong at this point?

 

thanks

 

Regular Member
Posts: 381
Registered: ‎07-23-2015
Kudos: 156
Solutions: 7

Re: How to install mFi in Ubuntu (and run it on Hyper-V)

See my post above yours, there's a u missing from ubuntu

Add that in, then run update , then install
New Member
Posts: 33
Registered: ‎04-05-2018
Kudos: 11

Re: How to install mFi in Ubuntu (and run it on Hyper-V)

[ Edited ]

Thank you for the info...updated as per your suggestion.  Also fixed the command in my online document - had the same issue.  Great catch.

New Member
Posts: 32
Registered: ‎03-10-2014
Kudos: 8

Re: How to install mFi in Ubuntu (and run it on Hyper-V)

Thank you so much for the write up!

I followed all of the above steps and have mFi running in 16.04. but can't seem to get my devices to adopt, they are just stuck at adopting. I have manually updated one to the same firmware as the controller and there is no change.

 

Any ideas?

Reply