Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNS3 on Ubuntu 2004 ARM64 + Docker #1991

Closed
torresweb opened this issue Oct 28, 2021 · 4 comments
Closed

GNS3 on Ubuntu 2004 ARM64 + Docker #1991

torresweb opened this issue Oct 28, 2021 · 4 comments
Milestone

Comments

@torresweb
Copy link

Hello,

That is my ubuntu:

Linux ub2004-arm 5.4.0-89-generic #100-Ubuntu SMP Fri Sep 24 14:29:20 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

I've installed GNS3 using pip3 and manually installed other deps such as ubridge:
$ gns3 --version
2.2.26
$ ubridge -v
ubridge version 0.9.19

Also, I follow the oficial guide to install docker-ce:
$ docker --version
Docker version 20.10.10, build b485636

I installed some containers using docker pull, alpine and arm64v8-ubuntu, for example (but the error also happen with ubuntu, ...)
Everything looks great but I cannot start the docker container. In GNS3 the error message is:

`
2021-10-26 20:29:35 ERROR docker_vm.py:480 Container arm64v8-ubuntu-1 failed to start
2021-10-26 20:29:35 INFO base_node.py:669 Stopping uBridge hypervisor localhost:46133
2021-10-26 20:29:35 INFO hypervisor.py:208 Stopping uBridge process PID=3305
2021-10-26 20:29:36 INFO docker_vm.py:533 Docker container 'arm64v8-ubuntu-1' fix ownership, state = exited
2021-10-26 20:29:36 ERROR route.py:242 Uncaught exception detected: <class 'KeyError'>
Traceback (most recent call last):
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/compute/base_node.py", line 631, in _ubridge_send
await self._ubridge_hypervisor.send(command)
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/utils/asyncio/init.py", line 163, in wrapper
return await f(oself, *args, **kwargs)
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/ubridge/ubridge_hypervisor.py", line 259, in send
raise UbridgeError(data[-1][4:])
gns3server.ubridge.ubridge_error.UbridgeError: could not complete netlink transaction

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/compute/docker/docker_vm.py", line 914, in _add_ubridge_connection
await self._ubridge_send('docker move_to_ns {ifc} {ns} eth{adapter}'.format(ifc=adapter.host_ifc,
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/compute/base_node.py", line 633, in _ubridge_send
raise UbridgeError("Error while sending command '{}': {}: {}".format(command, e, self._ubridge_hypervisor.read_stdout()))
gns3server.ubridge.ubridge_error.UbridgeError: Error while sending command 'docker move_to_ns tap-gns3-e0 0 eth0': could not complete netlink transaction: uBridge version 0.9.19 running with libpcap version 1.9.1 (with TPACKET_V3)
Hypervisor TCP control server started (IP localhost port 46133).

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/compute/docker/docker_vm.py", line 478, in start
await self._add_ubridge_connection(nio, adapter_number)
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/compute/docker/docker_vm.py", line 918, in _add_ubridge_connection
raise UbridgeNamespaceError(e)
gns3server.ubridge.ubridge_error.UbridgeNamespaceError: Error while sending command 'docker move_to_ns tap-gns3-e0 0 eth0': could not complete netlink transaction: uBridge version 0.9.19 running with libpcap version 1.9.1 (with TPACKET_V3)
Hypervisor TCP control server started (IP localhost port 46133).

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/web/route.py", line 198, in control_schema
await func(request, response)
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/handlers/api/compute/docker_handler.py", line 89, in start
await container.start()
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/compute/docker/docker_vm.py", line 484, in start
logdata = await self._get_log()
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/compute/docker/docker_vm.py", line 1141, in _get_log
result = await self.manager.query("GET", "containers/{}/logs".format(self._cid), params={"stderr": 1, "stdout": 1})
File "/home/myuser/.local/lib/python3.8/site-packages/gns3server/compute/docker/init.py", line 114, in query
if response.headers['CONTENT-TYPE'] == 'application/json':
KeyError: 'CONTENT-TYPE'
2021-10-26 20:29:36 INFO crash_report.py:166 Crash report sent with event ID: 46855e1151b04032b1e023926070079d
2021-10-26 20:29:36 INFO web_log.py:206 127.0.0.1 [26/Oct/2021:20:29:35 +0000] "POST /v2/compute/projects/597cfbcb-f471-4e61-b9ab-d0cede3b6c27/docker/nodes/612f1033-9f77-473f-b2ca-1653a47116ec/start HTTP/1.1" 500 3607 "-" "Python/3.8 aiohttp/3.7.4.post0"
2021-10-26 20:29:36 INFO web_log.py:206 127.0.0.1 [26/Oct/2021:20:29:35 +0000] "POST /v2/projects/597cfbcb-f471-4e61-b9ab-d0cede3b6c27/nodes/612f1033-9f77-473f-b2ca-1653a47116ec/start HTTP/1.1" 500 433 "-" "GNS3 QT Client v2.2.26"
`

I follow this test GNS3/ubridge#74 and everything works great:
$ telnet localhost 4242
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
bridge create test
100-bridge 'test' created
bridge add_nio_tap test tap4242
100-NIO TAP added to bridge 'test'
docker move_to_ns tap4242 3003 eth42
100-tap4242 moved to namespace 3003

In docker container log I found this:
{"log":"standard_init_linux.go:228: exec user process caused: exec format error\r\n","stream":"stdout","time":"2021-10-26T20:32:50.20548216Z"}

{"log":"standard_init_linux.go:228: exec user process caused: exec format error\r\n","stream":"stdout","time":"2021-10-26T20:32:51.011347766Z"}

But, starting the container in CLI works fine.
I appreciate any help,

@ghost
Copy link

ghost commented Oct 29, 2021

I don't have an ARM computer, but I have an idea what happend.

When using docker in GNS3 a busybox binary is injected into the container to do some GNS3 specific initialization. In GNS3 v2.x this busybox binary (https://github.com/GNS3/gns3-server/blob/master/gns3server/compute/docker/resources/bin/busybox) is build for intel compatible computers and will run only on this architecture. Therefore on your ARM computer you got an "exec format error" in the docker container log. With PR #1908 this will change in the upcoming version 3.0. Then the busybox binary from the OS will be used, this should work on all architectures.

I tried to verify this issue on my intel computer. I replaced the busybox binary, installed by pip3 install gns3-server into /usr/local/lib/python3.9/dist-packages/gns3server/compute/docker/resources/bin, by a busybox binary build for the ARM64 platform. Then I get exactly the same error messages you got.

@grossmj grossmj added this to the 2.2.27 milestone Oct 30, 2021
@grossmj
Copy link
Member

grossmj commented Nov 4, 2021

@b-ehlers is correct

Please install busybox-static for ARM64 and then copy the binary to the right location.

I think these commands should be enough:

sudo apt install busybox-static
cp /usr/bin/busybox /home/myuser/.local/lib/python3.8/site-packages/gns3server/compute/docker/resources/bin

You won't have to do this in the upcoming version 3.0 and we will also distribute packages build for ARM64 from our PPA.

@grossmj
Copy link
Member

grossmj commented Nov 20, 2021

@torresweb have you tried the command above? Thanks.

@torresweb
Copy link
Author

Sorry for the delay in replying. I only had access to my ARM again today. I tested it with the system busybox and it worked perfectly. Thank you all for your help and engagement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants