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

+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
Probable reason: The project URL is not accessible from the local machine.

Make the project 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 (14.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.
0 votes

Here is how to diagnose whether the project 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, you're behind the NAT.

The server usually has two IP addresses. One of them is localhost and has 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:  mdm.my-company.com

Then retry the wget command - it should succeed.

by (14.5k points)
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.