fcwu / docker-ubuntu-vnc-desktop

A Docker image to provide web VNC interface to access Ubuntu LXDE/LxQT desktop environment.
Apache License 2.0
3.91k stars 1.42k forks source link

Does not run on Mac with ARM64 architecture #285

Closed AugustoCiuffoletti closed 1 year ago

AugustoCiuffoletti commented 2 years ago

The problem The image built on an ARM64 machine does not run on the same machine, which is a new Mac with an ARM64 processor.

Long description: I would like to build a two-dockers system for teaching networking protocols. One of them has to run Wireshark for packet capture and analysis. Some students have amd64, others have arm64. A docker-based lab is a solution, which is going to replace the previous VirtualBox-based one. Note that the image built for an amd64 runs on an arm64 architecture, but packet capture does not work :-/

To Reproduce

  1. git clone https://github.com/fcwu/docker-ubuntu-vnc-desktop.git
  2. cd docker-ubuntu-vnc-desktop
  3. git submodule init; git submodule update
  4. make extra-clean
  5. ARCH=arm64 make build
  6. make run

Expected behavior At this point, the docker should become accessible using localhost:6080. Instead, the image does not boot, and this is the log:

% make run             
docker run --privileged --rm \
-p 6080:80 -p 6081:443 \
-v /Users/lucapagnesi/Documents/docker/docker-ubuntu-vnc-desktop:/src:ro \
-e USER=doro -e PASSWORD=mypassword \
-e ALSADEV=hw:2,0 \
-e SSL_PORT=443 \
-e RELATIVE_URL_ROOT=approot \
-e OPENBOX_ARGS="--startup /usr/bin/galculator" \
-v /Users/lucapagnesi/Documents/docker/docker-ubuntu-vnc-desktop/ssl:/etc/nginx/ssl \
--device /dev/snd \
--name ubuntu-desktop-lxde-test \
dorowu/ubuntu-desktop-lxde-vnc:latest
* enable custom user: doro
cp: cannot stat '/root/.config': No such file or directory
* enable RELATIVE_URL_ROOT: approot
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
make: *** [run] Error 255

The same occurs if at step 5 we use simply "make build". The operating system on the host machine is MacOS Monterey 12.4.

Tiryoh commented 2 years ago

I guess amd64 version tini has installed on your arm64 docker image. reference: https://github.com/Tiryoh/docker-ubuntu-vnc-desktop/pull/1/commits/9b1b5c55c9baadd26d66d89b8abcf99c5ed12c28

You can try building Dockerfile.arm64 manually, not from make command. Also my fork version is available too.

AugustoCiuffoletti commented 2 years ago

Thank you Tiryoh. I'll check that and possibly report

AugustoCiuffoletti commented 2 years ago

Hi Tiryoh

Thank you again for your precious help.

I visited your forked repo and I found new commits after the 9b1b5c. So I am trying to use them. Is it still necessary to buld manually the Dockerfile.arm64, or the current Makefile takes care of Jinja2 templates? I have to give instructions to my tester (I do not have a Mac) and I prefer to be as simple as possible.

Here is the script I am going to provide to my tester:

#!/bin/bash
NAME=prova-vnc-desktop
git clone https://github.com/Tiryoh/docker-ubuntu-vnc-desktop
cd docker_ubuntu_vnc_desktop_tiryoh
git submodule init; git submodule update
# docker rmi prova-vnc-desktop

ARCH=arm64 make Dockerfile
docker build -f Dockerfile -t $NAME .

docker run --privileged --rm -p 6080:80 -p 6081:443 -v ${PWD}:/src:ro -e USER=user -e PASSWORD=user -e ALSADEV=hw:2,0 -e SSL_PORT=443 -e RELATIVE_URL_ROOT=approot -e OPENBOX_ARGS="--startup /usr/bin/galculator" -v ${PWD}/ssl:/etc/nginx/ssl --device /dev/snd --name ubuntu-desktop-lxde-test $NAME

I also found an ARM64 image on Dockerhub. Is it ready to use?

Thank you for your attention

Augusto

AugustoCiuffoletti commented 1 year ago

Hi Tiryoh, I found an interesting thread in your project here

https://github.com/Tiryoh/docker-ubuntu-vnc-desktop/pull/1

that I report for those that have interest in that. From that document I concluded that the last commit in the repo (512df7c) was updated to solve my problem.

From that point I proceeded building the image using the provided Makefile (no need to do anything "manually"). You just need to remove the Dockerfile link, and overall the Makefile might be improved, but it is fully adequate for the purpose. Also the "run" Makefile target works fine.

At that point I produced a multiarchitecture image (amd64 + arm64) adapted for my purpose: you find it on dockerhub as mastrogeppetto/nglab-desktop:latest.

I plan to fork from you project and complete the Makefile with the multiarch part, which is straightforward but may save some time in the future.

Thank you again for your work,

Augusto

Tiryoh commented 1 year ago

Hi @AugustoCiuffoletti,

Sorry, I've missed the notification. As you concluded, I guess my fork (https://github.com/Tiryoh/docker-ubuntu-vnc-desktop/commit/512df7c2128e619292bc705203b11ef3b899d1db) version is ready both amd64 and arm64 with Dockerfile jinja template. The current repo builds multi-architecture images with the docker buildx command. Please refer to the GitHub Actions settings. https://github.com/Tiryoh/docker-ubuntu-vnc-desktop/blob/512df7c2128e619292bc705203b11ef3b899d1db/.github/workflows/deploy.yaml