6 Hostname and Hostid

The hostname and hostid are the two basic computer identifiers used in some of MOSEK license files.

  • hostname is just the standard host name of the machine.

  • hostid is, in most cases, the MAC address of a network card, or of one of the network cards. It is a sequence of 12 hexadecimal digits. There is no need for the card to have an active connection.

Both identifiers can be obtained in various ways, either with MOSEK or standard tools available in the operating system. We outline these below.

Important

A modern machine will often have many network interfaces, some physical (hardware network devices) and possibly also some virtual. The licensing software will detect all of them and present them as a list in no particular order, but we only need ONE of these MAC addreses as a hostid the license will be bound to.

In such cases please indicate which of the list of MAC addresses is the preferred choice for hostid. It is recommended to choose one that corresponds to one of permanent physical network cards. That assures the interface will not easily disappear, which would render the license file invalid. You can explore the network devices in your system settings or use the tools described in Sec. 6.3 (Using the OS tools) to match MACs to actual interfaces.

6.1 Using MOSEK

6.1.1 Command line

In the directory with MOSEK binaries (<MSKHOME>/mosek/10.1/tools/platform/<PLATFORM>/bin/) run the command

mosek -f

It will produce output similar to

MOSEK Version 10.0.34 (Build date: 2023-1-6 13:40:00)
Copyright (c) MOSEK ApS, Denmark WWW: mosek.com
Platform: Linux/64-X86

FlexLM
 Version                  : 11.18
 Hostname                 : hulk
 Host ID                  : "f4ed3061a731 00aa720b7fa"
 License path             : /home/username/mosek/mosek.lic

Operating system variables
 LD_LIBRARY_PATH          :

*** No input file specfied. No optimization is performed.

Return code - 0  [MSK_RES_OK]

Both hostname and a list of possible hostid are present in the output.

6.1.2 From an API

If you only installed MOSEK as a client package (for example via pip, Anaconda or NuGet) and do not have the full distribution then you can get the same output by calling the echointro method of the Optimizer API environment object Env. Note, however, that for floating licenses you will still have to download the full MOSEK distribution package to obtain the license server binaries.

Here is an example of this in Python:

import mosek, sys

env = mosek.Env()
env.set_Stream(mosek.streamtype.log, sys.stdout.write)
env.echointro(1)

6.2 Using FLEXlm

6.2.1 FLEXlm command line

In the directory with MOSEK binaries (<MSKHOME>/mosek/10.1/tools/platform/<PLATFORM>/bin/) run the command

./lmutil lmhostid                  (Linux/OSX)
lmutil lmhostid                    (Windows)

This will give you the list of possible hostid similar to:

lmutil - Copyright (c) 1989-2021 Flexera. All Rights Reserved.
The FlexNet host ID of this machine is ""f4ed3061a731 00aa720b7fa""
Only use ONE from the list of hostids.

The hostname is obtained simply by running

hostname

Linux: To use the floating license server or run lmutil the Linux standard base 3.0 must be installed. This package is called lsb-base or lsb in most Linux distributions. Without it you can expect an error similar to:

./lmutil: No such file or directory

6.2.2 LMTOOLS graphical utility (Windows)

Start the LMTOOLS graphical utility, either from the MOSEK Start menu or from <MSKHOME>/mosek/10.1/tools/platform/<PLATFORM>/bin/.

_images/flexlm-menu.png

Navigate to the tab System settings. The hostname and list of hostid are shown in the Hostid Settings panel under, respectively, Computer/Hostname and Ethernet. You can also choose to save all information to a file with the button in the bottom-right corner.

_images/generate_hostid_lmtools.png

6.3 Using the OS tools

6.3.1 Command line

Start the terminal or command prompt. On all platforms the hostname can be obtained by running the command

hostname

To obtain the hostid generate a list of network interfaces by running one of the following commands. Some administrator permissions may be required.

ifconfig                                                      (Linux/OSX)
ip addr                                                       (Linux)
netstat -i                                                    (Linux/OSX)
wmic nic get AdapterType, Name, Installed, MACAddress         (Windows)
ipconfig /all                                                 (Windows)
getmac /v                                                     (Windows)

In each case you will obtain a list of network interfaces with more or less detailed descriptions. Identify one corresponding to the device you want to bind to and use its MAC address as hostid (it will usually be displayed in the format 01:23:45:67:90:ab or similar and referred to as MAC, ether, Ethernet or similar). If in doubt save the output of the command to a file and send us the file.

Important

Linux: DO NOT use the command line tool hostid. It generates a different identifier with 8 hexadecimal digits which we cannot use.

6.3.2 System settings

In the system settings find the section with network devices, find a network card and browse through its details to find the MAC address. We omit the details as they vary between operating systems.