How to compile and install Openmediavault(OMV)
- 2019-10-05
Openmediavault, known as OMV, could be the best choice among different open-source NAS solutions. Based on the great flexibility of Debian, together with its low consumption, OMV can work well on different hardware environments. Even my obsolete Intel Celeron D can still run well.
Even though OMV is easy to use, it lacks documents, as the development team are all recommending to use their ready-to-use images, which is not so friendly with senior users. What’s more, guides to compile from scratch is just an empty paper, and you must guess what to do by yourself!
After falling into plenty of traps, I won’t allow such an empty paper to hurt any beginners! So here comes my guide.
Preparations
- System: Debian 10 Buster, basic edition without any desktop environments
- Architecture: OMV’s official-recommended ‘AMD64, ARM, ARM64, and i386
- Develop team doesn’t release i386 ISO images. But we can still install it on Debian x86 machines.
- Free disk space: At least 2GB (because of a large amount of dependencies)
- Memory: At least 512MB. I recommend you to use more than 1GB of memory.
Inform:
For easier usage, all those commands above will be run under user
root
.
- If you run Debian locally: use either
sudo -i
orsudo su
to switch to root.- If you login with SSH, you can directly login with user
root
.You can fetch a Debian base image form HUST’s mirror, my university: http://mirrors.hust.edu.cn/debian-cd/current/
The Essence of OMV
OMV itself, is a large web server application based on Nginx, PHP, Python and more, which is similar to The Baota Platform. No binary and source code is included in OMV. Instead, every available code is written in interpreting language PHP, and this makes OMV born with cross-platform. On theory, once target architecture supports Debian, Dpkg, and OMV’s dependencies, you can run OMV on any possible architectures.
OMV is based on Debian. When you successfully compile OMV, you will get a cross-platform, noarch Deb package. The compilation won’t invoke compilers to generate dedicated binary files. So you can install OMV on every Debian instance.
Note: Debian-family systems using Dpkg can install, on theory. For example, Ubuntu. But it’s untested.
Clone Source Code
Download
OMV team deploys their code on GitHub. We clone it into directory omv
.
1 |
|
Enter source directory
OMV’s core source code is under subdirectory deb
:
1 |
|
Compilation
The compilation of OMV is a land of traps. It lacks documents. And the more terrible trap is that OMV’s Makefiled doesn’t follow common routines. Once you don’t read carefully, you won’t be able to find out the real build target. Thanksfully, you can easily build it.
Install build tools
1 |
|
Start compilation
1 |
|
After compilation, it will generate several Deb packages under omv/dev
, just like:
1 |
|
Trap: About the default build target
OMV’s default build target, aka. run make
without arguments, is NOT compiling Deb packages. Instead, it just simply cleans subdirectories! Be careful, ‘cause I don’t wanna Tukkomi any more ε=(´ο`*)))…
Install OMV
Add OMV official repository
Few dependencies of OMV is not available in Debian’s official repository. So OMV repository is required.
Firstly, append this code to the end of /etc/apt/sources.list
:
1 |
|
Secondly, install OMV repo keyring:
1 |
|
Then, update repositories:
1 |
|
Install basic dependencies
1 |
|
Here will be depedency errors. Continue with:
1 |
|
Then rerun the apt install
commands above so that it can continue properly.
Install OMV main package
To install OMV with convenience, OMV developers bundled every installtion process into a meta-package, so that you won’t need to install plenty of packages.
You can install either the official edition or our compiled version.
Install the official edition
You can directly install OMV via official repo:
1 |
|
Your screen will be filled with logs. Just wait in patience until it succeeds. Bear in mind that once an error occurs, you won’t be able to use OMV!
Install our own version
1 |
|
Fill the trap: Solve Unit file is masked
On some machines like VPS, you may encounter the error Unit file is masked
when installing OMV manually. It’s critical, often interrupts installtion.
1 |
|
Actually, once you know how systemd
manages services, you will know that the so-called mask
is a state, means that a service is getting “blocked”. So solution could be extremely easy: once you find a service masked, simply run the following commands to unmask, then reinstall until it can continue properly:
1 |
|
Launch OMV
Run the following command to launch OMV. Actually, newer versions of OMV had been configured into auto-start system services.
1 |
|
Type host’s IP address to open OMV’s login page. Default admin account is:
Field | Value |
---|---|
Default username | admin |
Default password | openmediavault |
Add OMVExtras Plugin Repository
OMVExtras is a plugin repository provided by OMV official. I recommend you to add it so that you can make use of more powerful plugins.
The developer has a one-key installtion method:
1 |
|
Once you cannot fetch the script, save the following shell code as install.sh
, chmod 755
, and run:
1 |
|
After installtion, refresh your browser, then you’ll see a new OMV-Extras
entry on the side panel.