MATLAB uses the MAC address as "host ID" :(
Today it finally got around to fixing an extremly annoing behaviour of MATLAB on a recent installation of Arch Linux:When trying to start MATLAB offline (without the Laptop connected to any network), i suddenly got:
License checkout failed.
License Manager Error -9
The hostid of your computer ("XXXXXXXXXXXX XXXXXXXXXXXX") does not match the hostid of the license
file (XXXXXXXXXXX).
To run MATLAB on this computer, you must run the Activation client to reactivate your license.
Troubleshoot this issue by visiting:
http://www.mathworks.com/support/lme/R2016b/9
Diagnostic Information:
Feature: MATLAB
License path: /path/license_XXXXXXX_R2016b.lic:/path/Matlab/R2016b/licenses/
license.dat:/path/licenses
Licensing error: -9,57.
This problem arises because of the License Host ID, which MATLAB uses to bind a licence to a certain PC. It (obviously) incorporates the MAC addresses of all network adapters in the system, expecting them to be a constant (not a reasonable assumption anymore, see here) in the system.
Soo, as explained in the article linked above, the kernel, systemd and gnomes NetworkManager lately all started to randomize the MAC address of the WLAN-Adapters during scans in order to make it harder to track a Laptops location because of MAC addresses send during the scans for nearby networks (which is a good thing).
This has to be disabled to allow MATLAB starting when offline. How?
1) systemd-network.d
You have to tell systemd to use a MACAddressPolicy for all devices which keeps the hardware MAC address at all times (see here for reference), which is called "persistent".To do that, create a file /etc/system.d/network/99-default.link, containing:
[Link]
NamePolicy=kernel database onboard slot path
MACAddressPolicy=persistent
which sets the aforementioned Mac Address Policy.
2) NetworkManager
When also using NetworkManager, then the "MAC Address Randomization during Network Scan"-feature has to be disabled, which can be achived by adding
[device]
wifi.scan-rand-mac-address=no
to /etc/NetworkManager/NetworkManager.conf.
This makes it possible to start MATLAB when not connected to any network again