Running Autodesk License Server on AWS EC2 Instance - lclibardi/utils GitHub Wiki

Running Autodesk License Server on AWS EC2 Instance

1. Installing the License Server on AWS EC2

In this guide, we won't go into the process of creating an Elastic Compute instance on Amazon, that is documented in the EC2 Get Started page.

The license server is not computationally intensive, so when you create the EC2 instance, choose the t2.nano type, which is the smallest/cheapest instance, comes with 1 vCPU and 512MB RAM. Give your instance something like 5GB of storage. That should be enough to run the OS and the license software.

Autodesk only offers an RPM package as an installer, so make sure you choose RedHat Linux for the OS during the setup. Also, if you are located in California, make sure you choose the correct region, which would be us-west-1 (North California).

An important step is to download the *.pem file, which will be displayed right after you launch the instance. This key will allow you to manage the instance remotely. You can also add your public SSH key to the instance at that moment, which later allows you to access the system without having to type a password. It's essential that you setup at least one of those methods, otherwise you won't be able to remotely access the machine afterwards.

Once your instance is up and running, SSH into it, download the Autodesk FlexLM package and install it:

wget http://download.autodesk.com/us/support/files/autodesk_network_license/nlm11.14.1.3_ipv4_ipv6_linux64.tar.gz
tar xvf nlm11.14.1.3_ipv4_ipv6_linux64.tar.gz
sudo rpm -vhi nlm11.14.1.3_ipv4_ipv6_linux64.rpm

You will need to order a Network license in order to use this setup. At the time of writing this guide, Autodesk does not sell floating licenses directly from their website, neither by phone. You will need to contact an Autodesk Authorized reseller and purchase a Network license from them. Once that's done, download the license file from your Autodesk account and move it to where the FlexLM service expects it to be (see command below).

Important: rename your license file to match "license.dat":

sudo mkdir -p /usr/local/flexlm/licenses/
sudo mv ./Company_MAYA2018enlicense.lic /usr/local/flexlm/licenses/license.dat

We need to open the necessary network ports to communicate with the Autodesk FlexLM server:

sudo iptables -A INPUT -p tcp --dport 27000 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 2080 -j ACCEPT
sudo service iptables save
sudo service iptables restart

If that doesn't work, try installing Firewall-cmd and opening the ports. Here is how:

# Install
sudo yum install firewall-cmd
sudo systemctl enable firewalld
sudo systemctl start firewalld
sudo systemctl status firewalld

# Add Rules
sudo firewall-cmd --zone=public --add-port=27000/tcp --permanent
sudo firewall-cmd --zone=public --add-port=2080/tcp --permanent
sudo firewall-cmd --reload

You can verify that the ports are properly open with any of these 3 commands:

nc -vz localhost 27000

netstat -tulpn | grep 27000

sudo firewall-cmd --list-all | grep 27000

Start the license server on a detached process using </dev/null &>/dev/null & at the end:

/opt/flexnetserver/lmgrd -l /tmp/maya_debug.log </dev/null &>/dev/null &

Check if the license server is running:

/opt/flexnetserver/lmutil lmstat -a

2. Opening Ports on EC2 from AWS Dashboard:

The next step is to open the TCP ports 27000 and 2080 from the AWS Dashboard. You can achieve that by creating a security group or adding rules to an existing group. Make sure you set the Source address to the public IP from your company office:

Access the Elastic IP menu and create one, that way we will always have the same IP address for that EC2 instance

We need a subdomain to route traffic to our Amazon EC2 Instance. If you already have a company domain, follow these instructions. If you have a domain already registered with Amazon, just go into the Route 53 menu and create a Hosted Zone, as described in this page:

Assuming you have a subdomain with Amazon, click on the link for the zone companyname.com:

Then create a Record Set of type "A" with the desired domain name, such as licenses.company.com:

3. Installing Autodesk Maya 2018 on Ubuntu

Autodesk does not release Debian versions of Maya. In order to install it in Ubuntu, you will need to convert the RPM files into DEB.

First, log into your Autodesk account and download the latest version of Maya 2018 for Linux.

Create a install directory and untar the Maya package:

mkdir -p maya2018Install
mv ./Autodesk_Maya_2018_EN_Linux_64bit.tgz ./maya2018Install
cd maya2018Install
tar xvf Autodesk_Maya_2018_EN_Linux_64bit.tgz

There are several dependencies that need to be installed for Maya to work properly. Go ahead and install these:

sudo apt-get install -y \
	libssl1.0.0 \
	gcc \
	libssl-dev \
	libjpeg62 \
	alien \
	csh \
	tcsh \
	libaudiofile-dev \
	libglw1-mesa \
	libtiff5 \
	elfutils \
	libglw1-mesa-dev \
	mesa-utils \
	xfstt \
	ttf-liberation \
	xfonts-100dpi \
	xfonts-75dpi \
	ttf-mscorefonts-installer \
	libfam0 \
	libfam-dev \
	libgstreamer-plugins-base0.10-0

You will also need libxp and libpng:

sudo wget http://launchpadlibrarian.net/183708483/libxp6_1.0.2-2_amd64.deb
sudo wget https://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb

Use alien to convert the .rpm packages into .deb:

sudo alien --veryverbose -c *.rpm

ATTENTION: This will take a very long time to complete! Do not assume that the process is failing or stuck, just wait for it to complete:

Install the deb packages and run the setup script, which will bring up a dialog window with the installation steps:

sudo dpkg -i *.deb
echo "int main (void) {return 0;}" > mayainstall.c
sudo gcc mayainstall.c
sudo mv /usr/bin/rpm /usr/bin/rpm_backup
sudo ln -s /bin/true /usr/bin/rpm
sudo chmod +x ./setup
sudo ./setup
sudo rm /usr/bin/rpm
sudo mv /usr/bin/rpm_backup /usr/bin/rpm

During the installation, you will be asked for the Serial Number, Product Key and License Server Address. You can retrieve this information in your Autodesk product page. The license server address will be the one you setup in AWS EC2, as described in the steps above (licenses.company.com).

Maya is fully installed at this point. Before we launch it, we need to fix some startup errors, due to missing dependency references:

sudo ln -s /usr/lib/x86_64-linux-gnu/libtiff.so /usr/lib/libtiff.so.3
sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/autodesk/maya2018/lib/libssl.so.10
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so /usr/autodesk/maya2018/lib/libcrypto.so.10

Each user needs to have a maya directory under their home folder, make sure that exists for your user:

sudo mkdir -p ~/maya/2018/
sudo chmod 777 ~/maya/2018/

Upon launch, you might receive a "Segmentation Fault Error". To fix that, simply set:

sudo echo "MAYA_DISABLE_CIP=1" >> ~/maya/2018/Maya.env

You might also receive Color Management Errors. The solution is:

sudo echo "LC_ALL=C" >> ~/maya/2018/Maya.env
sudo echo "MAYA_CM_DISABLE_ERROR_POPUPS=1" >> ~/maya/2018/Maya.env
sudo echo "MAYA_COLOR_MGT_NO_LOGGING=1" >> ~/maya/2018/Maya.env

Open permissions on the Maya.env file:

sudo chmod 777 ~/maya/2018/Maya.env

If you get any ValueError regards a SHA512, do this:

sudo ln -s /usr/lib/nvidia-390/libGL.so /usr/autodesk/maya2018/lib/
sudo mv /usr/autodesk/maya2018/lib/python2.7/lib-dynload/_hashlib.so /usr/autodesk/maya2018/lib/python2.7/lib-dynload/rhel_hashlib.so
sudo ln -s /usr/lib/python2.7/lib-dynload/_hashlib.x86_64-linux-gnu.so /usr/autodesk/maya2018/lib/python2.7/lib-dynload/_hashlib.so

Maya assumes the Alt key is used for controlling the Viewport Camera, so make sure you set the correct modifier key, which is not set correctly by default in Ubuntu:

sudo gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier "<Super>"

Ensure that Fonts are Loaded

xset +fp /usr/share/fonts/X11/100dpi/
xset +fp /usr/share/fonts/X11/75dpi/
xset fp rehash

Finally, launch Maya!

sudo /usr/autodesk/maya2018/bin/maya

4. Point Maya to the License Server

If you did not use the instructions above or if you already had Maya installed in your computer, you might be presented with a window requesting license information upon launch. In order to point Maya to the license server, follow these steps:

In the license window, click on Use a Network License:

Type the server's ddns address licenses.company.com as you defined in the steps above:

If Maya can successfully reach the server and obtain a valid license, the software will open as expected. To check if you are using the Network license, click on Help > About Maya:

Then click on the button Product License Information, at the bottom:

And you'll be able to verify that the license server is indeed pointing to the correct address:

⚠️ **GitHub.com Fallback** ⚠️