MATLAB doesn't work on Linux network namespace

4 views (last 30 days)
Dear all,
I'm experiencing a license error when I run MATLAB in a network namespace of Linux. My OS is Ubuntu 18.04. My network environment configuration is:
#!/bin/bash
# create network namespaces
sudo ip netns add host0
# create TAP interfaces
sudo ip netns exec host0 ip tuntap add mode tap dev tap0
# bring up TAP interfaces
sudo ip netns exec host0 ip link set dev tap0 up
# bring up loopback interface in the namespace
# this is useful if you want to run ping in the namespace
sudo ip netns exec host0 ifconfig lo up
# assign IP addresses to interface
sudo ip netns exec host0 ip addr add 10.0.0.1/32 dev tap0
# add routing table
#sudo ip netns exec host0 route add default gw 10.0.0.1 dev tap0
# create virtual ethernet interface on physical host
sudo ip link add veth1 type veth peer name veth11
# associate virtual ethernet in the physical host to another virtual ethernet in the namespace
sudo ip link set veth11 netns host0
# now configure addresses in the virtual ethernet link
sudo ifconfig veth1 172.20.0.1/24 up
sudo ip netns exec host0 ifconfig veth11 172.20.0.2/24 up
# tell namespace to send all outgoing traffic to the physical host through the virtual ethernet link
sudo ip netns exec host0 route add default gw 172.20.0.1 veth11
# configure physical host to masquerade outgoing traffic generated by others
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# enable routing in the physical host
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
Then when I run matlab through namespace:
sudo ip netns exec host0 matlab
I experience this error:
License checkout failed.
License Manager Error -9
This error may occur when:
-The hostid of this computer does not match the hostid in the license file.
-A Designated Computer installation is in use by another user.
If no other user is currently running MATLAB, you may need to activate.
Troubleshoot this issue by visiting:
https://www.mathworks.com/support/lme/R2018a/9
Diagnostic Information:
Feature: MATLAB
License path: /home/luca/.matlab/R2018a_licenses:/usr/local/MATLAB/R2018a/licenses/license.dat:/usr/local/MATLAB/R
2018a/licenses/license.lic:/usr/local/MATLAB/R2018a/licenses/license_ECLab-Luca_960541_R2018a.lic
Licensing error: -9,57.
I also tried to run the activate_matlab.sh through:
sudo ip netns exec host0 ./activate_matlab.sh
but this is the error:
unnamed.png
I sincerely don't know how to solve the problem.
Somebody could help me?
Kind regards,
Luca

Answers (0)

Categories

Find more on Install Products in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!