ehedman / victron-venus-container

virtual venus for Rasperry Pi
1 stars 0 forks source link

Chroot not working according to readme file #1

Open Henschga opened 3 months ago

Henschga commented 3 months ago

I tried to run the docker pod with a full os but get the error that the file "venus-manager.sh" is not preset event the files is there an writeable.

root@raspibus:/usr/local/# docker run --rm -it --privileged --hostname=venus --net=host -v/opt/venus:/opt -v/run/udev/data:/opt/data/udev --platform linux/arm64/v8 arm64v8/debian sh -c 'chroot /opt /etc/init.d/venus-manager.sh boot'
chroot: failed to run command '/etc/init.d/venus-manager.sh': No such file or directory

Do you have a hint what I am doing wrong. The hardware is a raspi4 with os bookworm.

Flo

ehedman commented 3 months ago

Hi,

I am not sure in what state your installation is in. Perhaps my instructions is not clear enough. Anyway here is the step to bring this up: Create a Venus SDcard as you have it intended for a "standard" RPI Venusinstallation. Create a directory such as /op/venus on your bookworm host. Mount the SDcard (the partition holding the OS) to /opt/venus (later you can copy the content directly to /opt/venus to rid the extra SDcard) You should now se /opt/venus/etc/init.d Copy recurservly all the files from (git repo) victron-venus-container/files/opt/venus to /opt/venus Now you should see /opt/venus/etc/init.d/venus-manager.sh there. Then you need to copy the host tools from (git repo) victron-venus-container/[etc lib usr] to / on the bookworm. Perhaps with some care to check the contents there first. Before using the container (wich can hide some functional errors first) I suggest to try the chroot or systemd-nspawn first. Type /usr/local/bin/venus-boot.sh /opt/venus chroot rw eth0 (or end0 for standard bookworm) If you get it working you can switch to venus-boot.sh /opt/venus docker rw eth0. Please note that the docker container you download first is a generic debian docker and it has no Venus content. The docker only acts as a shield around what you now have in /opt/venus. If you get everything stable you can run the Venos OS in read-only mode: venus-boot.sh /opt/venus docker ro eth0. And also start it from boot with "systemctl enable venus-system" but first check the content in /etc/default/venus. Assuming that you don't have a bookworm http-server running on port 80, you should be able surf in to the remote console http://your-ip To start the QT-Gui type /usr/local/bin/venus-start-gui under the condition that nothing else is running on the screen such as a desktop or an X-server (this is an embedded solution)

Med vänlig hälsning/Kind regards Erland Hedman

Den 28 mars 2024 16:34:41 +01:00, skrev Henschga @.***>:

I tried to run the docker pod with a full os but get the error that the file "venus-manager.sh" is not preset event the files is there an writeable. @.***:/usr/local/# docker run --rm -it --privileged --hostname=venus --net=host -v/opt/venus:/opt -v/run/udev/data:/opt/data/udev --platform linux/arm64/v8 arm64v8/debian sh -c 'chroot /opt /etc/init.d/venus-manager.sh boot' chroot: failed to run command '/etc/init.d/venus-manager.sh': No such file or directory Do you have a hint what I am doing wrong. The hardware is a raspi4 with os bookworm. Flo

— Reply to this email directly, view it on GitHub https://github.com/ehedman/victron-venus-container/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6YKGSBLX5MD2BCLHTRQY3Y2QTADAVCNFSM6AAAAABFNAIOI6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTGNJTGE4TIMI. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Henschga commented 3 months ago

Hi Erland

Thanks for you help as this clarified a lot. I completely missed the "Venus SD card installation" part which I watched up now. I successfully mounted the prepared USB stick with Venus OS large and all the files are visible in /opt/venus. Also the copy process of the mentioned folders worked properly. The only problem that is still present is a permissions issue when I try to chroot files. Is as there another step that I am missing?

root@raspibus:/opt/venus/etc/init.d# /usr/local/bin/venus-boot.sh /opt/venus chroot rw eth0
chroot: failed to run command ‘/etc/init.d/venus-manager.sh’: Permission denied

thanks for your help so far Flo

ehedman commented 3 months ago

Try: chmod 755 /opt/venus/venus-manager.sh from bookworm. Anyway I have put a complete OS-image on my public ftp server. It is directly from RPI 4 bookworm. You can use it as a reference starting image. Try: wget http://hedmanshome.se/venus.gz List content: gzip -d venus.gz -c|cpio -it Extract content: gzip -d venus.gz -c|cpio -imVd Also check the READE.md again about 32/64 bit systems. The image is for aarch64 kernel type (32-bit user space) . Check with uname -m on bookworm.

Use the script /usr/local/bin/venus-boot.sh to start the system. Example: "/usr/local/bin/venus-boot.sh /opt/venus docker rw end0" (if your preffered netif is end0)

Henschga commented 3 months ago

Hi

I was trying to get it working and it looks very promising in the meantime. The first thing I did was using a fresh raspberry pi os image with the files and instructions you provided. Now I have the service running and can navigate through the local UI after the GUI service was started manually. The thing that is not working is the remote console. I can see the a remote console appearing but I get the error that it can not connect to the device. This tells me that the web server is running (and also the Venue service) but they are not able to talk to each other. Is there a chance that this is caused by the hardcoding of the dbus to: /home/erland/src/dbus-i2c/service/xxx?

pi@raspibus:~ $ systemctl status venus-system.service
* venus-system.service - Victron venus application
     Loaded: loaded (/etc/systemd/system/venus-system.service; enabled; preset: enabled)
     Active: active (running) since Mon 2024-04-01 16:47:35 CEST; 1min 13s ago
   Main PID: 535 (docker)
      Tasks: 9 (limit: 8732)
        CPU: 373ms
     CGroup: /system.slice/venus-system.service
             `-535 docker run --rm --privileged --hostname=venus --net=host -e VRM_IFACE=eth0 -v/opt/venus:/opt -v/opt/venus/../venus-data:/opt/data -v/run/udev/data:/opt/udev --platform>

Apr 01 16:48:35 raspibus venus-boot.sh[535]: Checking available software versions...
Apr 01 16:48:37 raspibus venus-boot.sh[535]: Active rootfs: 1
Apr 01 16:48:37 raspibus venus-boot.sh[535]: Active version: 20240205221147 v3.30~2
Apr 01 16:48:39 raspibus venus-boot.sh[535]: Filesystem errors detected on backup rootfs
Apr 01 16:48:41 raspibus venus-boot.sh[535]: Starting customized services:
Apr 01 16:48:41 raspibus venus-boot.sh[535]: /etc/init.d/custom.d/S01cputemp.sh start
Apr 01 16:48:41 raspibus venus-boot.sh[535]: cp: can't stat '/home/erland/src/dbus-i2c/service/*': No such file or directory
Apr 01 16:48:41 raspibus venus-boot.sh[535]: svc: warning: unable to control /service/dbus-i2c/: file does not exist
Apr 01 16:48:41 raspibus venus-boot.sh[535]: Setting up watches.
Apr 01 16:48:41 raspibus venus-boot.sh[535]: Watches established.

Do you have one more hint? Flo

ehedman commented 3 months ago

First of all don't bother about the i2c comments in the log. It is remainings of stuff that has to do with having RPI CPU temp in the guis that I failed to remove in the image. That stuff comes from https://github.com/LHardwick-git/Victron-Service/tree/main. If you can't connect to the web-gui then the vnc-service is not running for some reasons. See the code in /etc/init.d/start-gui.sh. You could try to start it from the inside of the container. Provided that you dont have a ssh service running (port 22) on the bookworm side you can login with ssh to the venus system. Then you can try to do a manual start of the VNC service. Before you can use ssh to the container, read this section of how to set up a root password for Venus: https://www.victronenergy.com/live/ccgx:root_access Also beware that there might be some functional changes that effect this behaviour if you downloaded a recent beta-release. This stuff is made for v3.30-2. If you are stuck I recommend to get the reference release image as stated in the README to start with and then go from there.