Welcome to Headwind MDM Q&A, where you can ask questions and receive answers from other members of the community.

Please do not post bug reports, missing feature requests, or demo inquiries. If you have such an inquiry, submit a contact form.

+1 vote
I installed Headwind MDM, everything is fine but when I am clicking "QR code" icon in the "Configurations" section, it is not working (showing a standard image placeholder or just a white space)
by (230 points)
edited by

2 Answers

+1 vote
 
Best answer
To generate a QR code, Headwind MDM web panel should download the launcher APK to calculate its checksum.

Probable reason: The launcher APK URL is not accessible from the local machine.

Solution:
Make the launcher APK URL accessible from the local machine.
If you're using iptables to redirect port 80 to 8080, redirect also for loopback interface:

# iptables -t nat -A OUTPUT -o lo -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
by (33.5k points)
edited by
I am having the same Problem, but unfortunately this doesn't fix it for me. Are there any other reasons that could be responsible for that error?
Another reasons of QR code failure may be absence of aapt utility, lack of required Java libraries, etc. Please look into the Tomcat log /var/lib/tomcat8/logs/catalina.out for details.
+1 vote

Here is how to diagnose whether the Headwind MDM launcher APK URL is accessible from the local machine.

1. Sign in to the web panel, and open the Applications tab

2. Find com.hmdm.launcher and copy its URL

3. Login to the server by SSH

4. Run the command

# wget http://your.host.com/path/to/launcher.apk

(paste the launcher URL after wget command)

5. On success, you get the message that the file is successfully downloaded. 

If you see any error (for example, Connection timed out), your network setup may be wrong.

Possible solution if you're behind the NAT

To check if you're behind the NAT, perform the following diagnostics:

1. Ping the server domain name or IP address from outside your LAN; you'll (hopefully) see the external IP address of your server

2. Run the command

# ip address

and check if you see here your external IP address.

If you don't see your external IP address but see something like 192.168.2.130, you're behind the NAT.

The server usually has two IP addresses. One of them is localhost and has 127.0.0.1 IP address. You need to get another one.

Note: this solution will only work if you're using the domain name for your MDM server (a strongly recommended option!).

Edit the file /etc/hosts (as root):

# sudo nano /etc/hosts

Add the following line to this file:

your.ip.address   mdm.host.name

Example:

192.168.2.130  mdm.my-company.com

Then retry the wget command - it should succeed.

If Headwind MDM is behind a reverse proxy

If Headwind MDM is behind a reverse proxy, use the same trick with /etc/hosts/, but point the Headwind MDM domain to the reverse proxy IP address instead of a local IP address.

by (33.5k points)
edited by
I do this but wget in my case only work with --no-check-certificate
This means your certificate doesn't match your domain name. Note that you shouldn't use localhost in a wget command, you should use your domain name.
We have a star certificate *.domain and web run fine, only QR are broken.
In hosts put only name or name and domain?
aapt version (1:8.1.0+r23-3build2).
tomcat 9
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
In hosts, you need to put the full host name in the same way when you enter the URL in the browser.
...