accetto / ubuntu-vnc-xfce-g3

Headless Ubuntu/Xfce containers with VNC/noVNC (G3v6).
MIT License
214 stars 62 forks source link

arm64 build #8

Closed rsheng118 closed 3 years ago

rsheng118 commented 3 years ago

could you please create a arm64 build? would love to run this on my raspbery pi 4. right now i'm getting this error ubuntu-xface | standard_init_linux.go:211: exec user process caused "exec format error"

also, it would be awesome to have SSL with novnc even just self signed certs.

accetto commented 3 years ago

Hello,

ad raspbery ) I could try, however, I do not not have a Raspberry, so I could not test it? Is Raspbery powerfull enough to run Ubuntu 20.04 with Xfce4 desktop?

ad SSL ) SSL is already on my list, but I'm not sure when I come to it. I have to check how much work it would require. Is it a show stopper for you?

Regards accetto

rsheng118 commented 3 years ago

raspberry pi 4 has Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz it should be fast enough for desktop environment, also Ubuntu is officially supporting raspberry pi 4 now so i don't think it should be a problem.

as for SSL, it really is a nice to have. i'm planning to use pi as a jump box to remote into my home network, and having a desktop environment for some tasks is very handy. having http over the web is just not safe any more now days. ha-proxy or ngnix bundled in should work nicely.

really love what you are doing here and much appreciated for the work.

accetto commented 3 years ago

Thank you for the nice words. I'll check if I can do something (relatively) quickly. Would be Raspberry Pi 4 with 4GB RAM enough for that or would be 8GB RAM required?

rsheng118 commented 3 years ago

i don't quite understand the question. i have a raspberry pi 4GB version. i would like something that not use a lot of memory if possible.

accetto commented 3 years ago

I was just thinking about buying one for testing, maybe. :) However, I would not have time to learn it any soon, so I'll probably ask you for testing. Would it be OK?

rsheng118 commented 3 years ago

yes, glad to help if time permits.

accetto commented 3 years ago

Hello @rsheng118,

I've evaluated it last weekend and unfortunately I have no good news. It seems like it would not make much sense to try it in this project. It looks like it would require compiling a lot of stuff from the source code and the chances to get a working system are really questionable.

For example, on Docker Hub I was not able to build a single ARM image based on debian or ubuntu, even if I've tried it with the most simple hello-there application.

The images based on alpine have been built just fine, but it doesn't help. I was also able to build a debian-based image locally on a Windows machine, but it's not enough either.

You can go to the GitHub repository accetto/hello-there, if you want to check what I've tried. The result images are on Docker Hub in the repository accetto/hello-there.

I'm very sorry, but I'm afraid that even if I would got it somehow working, that it would not be a good container at all. I think that the better approach is using the Ubuntu for Raspberry Pi directly from the origin.

Regards, accetto

Absolucy commented 2 years ago

Hi, I was trying to run this on an Oracle VPS (which are completely free for 4 cores and 24GB RAM, but they're ARM64) and I came across this issue.

Ubuntu's repos seem to have arm64 debs of TigerVNC, so I don't think you'd need to build that from source.

imneme commented 2 years ago

I got it running on arm64 (for my Mac). It wasn't too hard. I used an arm64 deb of TigerVNC.

I just changed the line to:

RUN apt-get update
RUN apt --fix-broken install -y
RUN apt-get install x11-utils libfontenc1 libgl1-mesa-dri libxfont-dev libxtst6 libglu1-mesa -y
RUN wget -nd -P /var/cache/apt https://www.cs.hmc.edu/~oneill/tigervnc/tigervncserver_1.11.80_arm64.deb && dpkg -i /var/cache/apt/tigervncserver_1.11.80_arm64.deb && sed -i 's/exec(@cmd);/print "@cmd";\nexec(@cmd);/g' /usr/lib/aarch64-linux-gnu/tigervncserver && ln -s /usr/lib/aarch64-linux-gnu/tigervncserver /usr/bin/vncserver

(I actually built the deb myself and and downloaded it off my own webserver—probably there would be a better place. I probably wouldn't need the previous lines if I did it tar-file style.)

JZL commented 1 month ago

Thanks for this great repo.

I can echo that I got arm64 working (on a little cloud VPS) with the only trouble being TigerVNC. Sadly you can't just change TIGERVNC_DISTRO because their sourceforge offers other files for arm64 but not the tar.gz which this usually uses. But here's the diff, I similarly installed from the arm64 deb + dpkg install + apt install -f. The sed worked the same with the new path.

I also use the -firefox build which worked great. Possibly chrome needs a few flags set.

     --mount=type=cache,from=stage_cache,sharing=locked,source=/tmp/g3-cache/,target=/tmp/g3-cache/ \
     TIGERVNC_VERSION="${ARG_TIGERVNC_VERSION}" \
     TIGERVNC_DISTRO="${ARG_TIGERVNC_DISTRO}" \
-    &&  if [ ! -s /tmp/g3-cache/tigervnc/tigervnc-"${TIGERVNC_VERSION}"."${TIGERVNC_DISTRO}".tar.gz ] ; then  \
-            wget --show-progress --progress=bar:force:noscroll \
-                -q https://sourceforge.net/projects/tigervnc/files/stable/"${TIGERVNC_VERSION}"/tigervnc-"${TIGERVNC_VERSION}"."${TIGERVNC_DISTRO}".tar.gz \
-                -P /tmp/g3-cache/tigervnc ; \
-        fi \
-    &&  tar xzf /tmp/g3-cache/tigervnc/tigervnc-"${TIGERVNC_VERSION}"."${TIGERVNC_DISTRO}".tar.gz --strip 1 -C / \
-    &&  ln -s /usr/libexec/vncserver /usr/bin/vncserver \
-    &&  sed -i 's/exec(@cmd);/print "@cmd";\nexec(@cmd);/g' /usr/libexec/vncserver
+    wget -L 'https://sourceforge.net/projects/tigervnc/files/stable/1.13.1/ubuntu-22.04LTS/arm64/tigervncserver_1.13.1-1ubuntu1_arm64.deb' \
+    && dpkg -i tigervncserver_1.13.1-1ubuntu1_arm64.deb ; apt install -yf \
+    &&  ln -s /usr/lib/aarch64-linux-gnu/vncserver /usr/bin/vncserver \
+    &&  sed -i 's/exec(@cmd);/print "@cmd";\nexec(@cmd);/g' /usr/lib/aarch64-linux-gnu/vncserver