So, I attempted to use the apt-get binaries to install gns3-server on Ubuntu 18.04 LTS (Bionic Beaver). The issue I ran into is that the package is linked to a specific version of python3. The installation was linked to the python3 version 3.5 libraries as evidenced by the output:
cp: cannot stat '/usr/bin/python3.5': No such file or directory
My install of Ubuntu 18.04 came with python3 version 3.6.5. I really didn’t feel like mucking about trying to rebuild the virtualenv of the package to point to the proper python3 libraries, so instead, I just installed gns3-server from scratch. I took this opportunity to write down the procedure to help others, but really, I documented this so that I can repeat the process myself.
I started with a fresh install of Ubuntu 18.04 LTS (Bionic Beaver), however this same process should work on subsequent versions of ubuntu as well. Note that I took care of some of the housekeeping, like setting the static IP address and hostname of the linux box before starting this procedure.
Step 1: Update your distro and install needed packages
sudo apt-get update sudo apt upgrade sudo apt-get install build-essential git libpthread-stubs0-dev libpcap-dev qemu-kvm libvirt-bin virtinst bridge-utils cpu-checker cmake install libelf-dev sudo apt-get install python3-setuptools python3-aiohttp python3-psutil python3-jsonschema
Step 2: Install ubridge, dynamips, docker, and gns3 from source
Install ubridge
cd ~ git clone https://github.com/GNS3/ubridge.git cd ubridge make sudo make install
Install dynamips
cd ~ git clone git://github.com/GNS3/dynamips.git cd dynamips mkdir build cd build cmake .. -DDYNAMIPS_CODE=stable sudo make install
Install gns3-server
cd ~ git clone https://github.com/GNS3/gns3-server.git cd gns3-server/ sudo python3 setup.py install
Install Docker
cd ~ sudo apt install docker.io sudo systemctl enable docker
Step 3: Create user, group membership, & startup script
Create the gns3 user and add it to the needed groups
sudo adduser gns3 sudo adduser gns3 kvm sudo adduser gns3 docker
Copy the gns3 startup template from the source tree to the init directory
sudo cp ~/gns3-server/init/gns3.service.systemd /lib/systemd/system/gns3.service
I usually reboot here, just to be sure I have the correct permissions and everything is ready to go.
Step 3.5: (Optional) Install a few useful Docker containers
sudo docker pull gns3/kalilinux sudo docker pull gns3/endhost
Step 4: Startup and enable the gns3 server
Enable the gns3 service by default
sudo systemctl enable gns3
Manually start the gns3 service
sudo systemctl restart gns3
You can verify the server started or troubleshoot any issues by looking the journal logs.
sudo journalctl -xe Jun 19 20:31:34 delores systemd[1]: Starting GNS3 server... -- Subject: Unit gns3.service has begun start-up -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- Unit gns3.service has begun starting up. Jun 19 20:31:34 delores systemd[1]: gns3.service: Can't open PID file /var/run/gns3/gns3.pid (yet?) after start: No such file or directory Jun 19 20:31:36 delores gns3server[8140]: No configuration file could be found or read Jun 19 20:31:36 delores systemd[1]: Started GNS3 server. -- Subject: Unit gns3.service has finished start-up -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- Unit gns3.service has finished starting up. -- -- The start-up result is RESULT.
And by looking for the running binary.
ps -ef | grep gns3 gns3 8150 1 3 20:31 ? 00:00:01 /usr/bin/python3 /usr/local/bin/gns3server --log /var/log/gns3/gns3.log --pid /var/run/gns3/gns3.pid --daemon
Step 5: Connect with the gns3 gui client
Then, from my mac, I load up the gns3 client and configure the “Remote main server” field to point to my Ubuntu gns-server installation.
You should now be in business and ready to run gns3 and build your virtual environments!
Follow up: If you find that speeds from your virtual hosts to the physical network are slooooowwwww, check out my blog entry on solving this.
I wonder if this would work on U18.04 server 64 bit?
Any one tried it yet?
I tried it and it worked like a charm. I would like to know how to upgrade it from 2.1.4 to 2.1.16 the latest.
Hey Ed,
Great stuff. Please edit your first step and add dependency for ubridge:
`sudo apt-get install build-essential git libpthread-stubs0-dev libpcap-dev qemu-kvm libvirt-bin virtinst bridge-utils cpu-checker cmake install libelf-dev
sudo apt-get install python3-setuptools python3-aiohttp python3-psutil python3-jsonschema libpcap-dev`
Otherwise, it’s great!
Hello, thanks for the feedback.
I wrote this article some time ago, so there may have been some changes in the dependencies.
Which dependency for ubridge is missing? I noticed in your comment you included libpcap-dev in the second line, but it’s already present in the first line.
Thanks!
-A
Great document !
I have successfully set up the GNS3 step by step by using this instruction. I had problem to using GNS3 OVA file to install on one of my hosts, and to work around. I have used yours to do it step by step.
2 things regarding this doc:
a)
“sudo apt-get install build-essential git libpthread-stubs0-dev libpcap-dev qemu-kvm libvirt-bin virtinst bridge-utils cpu-checker cmake ==> install libelf-dev”
I think this “install” is included by accident.
b)
If someone already have a GNS3 client installed somewhere, and just want to make one more GNS3 environment as my case, beware that your client version vs the gns-server you are building from “https://github.com/GNS3/gns3-server.git”. They need to of the same version.
Regards.
Jack
Thx, I’ve followed these instruction and have a GNS3 server running on Ubuntu 18.04.2 LTS – a VM on Goggle Cloud Services. However when I use my GNS3 client (on my Win10 laptop) it rejects the connection saying that the versions do not match. WIn10 Client is 2.1.21 (the latest), GNS server is 2.2.0dev15
Where can I get the 2.1.21 server version – if it exists?
Any advise would be helpful.