leobrigassi / time-capsule-proxy

Access Time Capsule share from Linux with kernel 5.15 and above
GNU General Public License v3.0
7 stars 0 forks source link

VM fails to run on x86 systems #1

Closed Snake221982 closed 2 months ago

Snake221982 commented 3 months ago

в момент настройки получаю tail: невозможно открыть './vm.log' для чтения: Нет такого файла или каталога tail: больше нет файлов

leobrigassi commented 3 months ago

в момент настройки получаю tail: невозможно открыть './vm.log' для чтения: Нет такого файла или каталога tail: больше нет файлов

what is your host system? do you have full permissions for the folder? user needs sudo privileges

share the progress stage of the script

Snake221982 commented 3 months ago

Linux Mint 21.3 system. Of course there are sudo privileges

leobrigassi commented 3 months ago

Share progress of script when error occurs

FaabsD commented 3 months ago

I've got the same issue after filling all prompts, see the progress below

[INPUT] Do you want to enable mount at startup? (y/N): y [OK] Stopping previously mounted VM... [OK] Waiting for VM to powerdown... qemu-system-aarch64: invalid accelerator kvm [OK] Waiting for VM to boot... tail: cannot open './vm.log' for reading: No such file or directory tail: no files remaining tail: cannot open './vm.log' for reading: No such file or directory tail: no files remaining tail: cannot open './vm.log' for reading: No such file or directory tail: no files remaining tail: cannot open './vm.log' for reading: No such file or directory tail: no files remaining tail: cannot open './vm.log' for reading: No such file or directory tail: no files remaining tail: cannot open './vm.log' for reading: No such file or directory tail: no files remaining tail: cannot open './vm.log' for reading: No such file or directory tail: no files remaining tail: cannot open './vm.log' for reading: No such file or directory tail: no files remaining tail: cannot open './vm.log' for reading: No such file or directory tail: no files remaining tail: cannot open './vm.log' for reading: No such file or directory tail: no files remaining tail: cannot open './vm.log' for reading: No such file or directory tail: no files remaining

trying to run this on Ubuntu 24.04 LTS 64-bit Kernel version 6.8.0-38-generic

leobrigassi commented 3 months ago

Thanks FaabsD. Can you confirm your system is running on an x86 architecture? You can run 'uname -m' to output your arch.

If so the script is now for arm and aarch64 that support KVM acceleration. This should be the reason why your VM is not loading up. There is a little bug in the current version that doesn't stop the script if x86 is detected.

I'm working on an x86 VM too and I should be releasing it soon. If you volunteer to test that would be great ;)

Snake221982 commented 3 months ago

Share progress of script when error occurs [OK] Waiting for VM to boot... tail: невозможно открыть './vm.log' для чтения: Нет такого файла или каталога tail: больше нет файлов tail: невозможно открыть './vm.log' для чтения: Нет такого файла или каталога tail: больше нет файлов tail: невозможно открыть './vm.log' для чтения: Нет такого файла или каталога tail: больше нет файлов tail: невозможно открыть './vm.log' для чтения: Нет такого файла или каталога tail: больше нет файлов tail: невозможно открыть './vm.log' для чтения: Нет такого файла или каталога tail: больше нет файлов

imac11-2:~$ uname -m x86_64

FaabsD commented 3 months ago

@leobrigassi

here is the output from uname:

uname -m x86_64

leobrigassi commented 3 months ago

Thank you. Script has been updated to v1.0.4 to handle x86 systems, currently unsupported (performance with arm VM not ideal). I'm going to be releasing soon an ad-hoc x86 VM so that it can run natively on those systems.

Snake221982 commented 3 months ago

Thank you. Script has been updated to v1.0.4 to handle x86 systems, currently unsupported (performance with arm VM not ideal). I'm going to be releasing soon an ad-hoc x86 VM so that it can run natively on those systems.

wget -O - https://github.com/leobrigassi/time_capsule_proxy/raw/main/install.sh 2>/dev/null | bash && cd time-capsule-proxy 2>/dev/null ; ./setup-time-capsule-proxy.sh Extracting in time-capsule-proxy directory. System currently not supported. Please run from arm/aarch64 systems.

leobrigassi commented 3 months ago

I've re-written most of the script for x86_64 and aarch64. This should cover the vast majority of users both on INTEL and ARM.

Also disk space requirements for VM has been reduced by more than 80% 😊

Let me know if this solves the issues you encountered with the previous version!

Snake221982 commented 3 months ago

I've re-written most of the script for x86_64 and aarch64. This should cover the vast majority of users both on INTEL and ARM.

Also disk space requirements for VM has been reduced by more than 80% 😊

Let me know if this solves the issues you encountered with the previous version!

[INPUT] Do you want to enable mount at startup? (y/N): y [ ] Deflating VM disk... [ ] VM detected. Sending poweroff command... Load key "./id_rsa_vm": Permission denied root@localhost: Permission denied (publickey,keyboard-interactive). [ERROR] VM did not power down after 60 seconds. Forcing termination... pkill: killing pid 2567 failed: Операция не позволена [ERROR] Failed to kill VM process. Installation stopped. qemu-system-x86_64: -netdev user,id=net0,hostfwd=tcp::50022-:22,hostfwd=tcp::50445-:445: Could not set up host forwarding rule 'tcp::50445-:445' [ ] Waiting for VM to boot... tail: невозможно открыть './vm.log' для чтения: Нет такого файла или каталога tail: больше нет файлов tail: невозможно открыть './vm.log' для чтения: Нет такого файла или каталога tail: больше нет файлов

leobrigassi commented 3 months ago

Hi Snake, try again. I think I found your issue.. let me know if your issue is resolved

Snake221982 commented 3 months ago

Hi Snake, try again. I think I found your issue.. let me know if your issue is resolved

Hi! Just great. Everything worked. Thank you very much.🫡🤝

leobrigassi commented 3 months ago

Hi cool. Looks like is a permission issue on your system or maybe ownership. Can you confirm the ownership of the files in the directory time-capsule-proxy?

Run this command from within the directory:

whoami && groups && ls -la

thanks and enjoy ;)

Snake221982 commented 3 months ago

whoami && groups && ls -la

ra-spain ra-spain adm cdrom floppy sudo audio dip video plugdev users netdev bluetooth lpadmin autologin scanner systemd-journal итого 16552 drwxrwxr-x 2 ra-spain root 0 ago 5 23:19 . drwxr-xr-x 3 root root 4096 ago 5 21:55 .. -rwxrwxr-x 1 ra-spain root 0 feb 3 2024 .com.apple.timemachine.supported -rwxrwxr-x 1 ra-spain root 14340 jul 27 10:25 .DS_Store -rwxrwxr-x 1 ra-spain root 16891904 abr 7 16:51 .ec60cd427cf13a411c662aaa9495788cc2eb9cdd.parts drwxrwxr-x 2 ra-spain root 0 jun 6 20:32 Fringe drwxrwxr-x 2 ra-spain root 0 jul 14 14:02 'MacBook Air — Ruslan 1.purgeable' drwxrwxr-x 2 ra-spain root 0 may 15 18:53 'MacBook Air — Ruslan.purgeable' drwxrwxr-x 2 ra-spain root 0 jul 27 19:37 'MacBook Air — Ruslan.sparsebundle' drwxrwxr-x 2 ra-spain root 0 mar 25 18:08 'Scooby Doo' drwxrwxr-x 2 ra-spain root 0 abr 7 20:12 Supernatural drwxrwxr-x 2 ra-spain root 0 ago 5 23:19 .Trash-1000 drwxrwxr-x 2 ra-spain root 0 feb 3 2024 Users drwxrwxr-x 2 ra-spain root 0 may 7 07:11 'Winclone BootCamp' drwxrwxr-x 2 ra-spain root 0 jul 5 14:58 Novies drwxrwxr-x 2 ra-spain root 0 abr 1 20:26 Cartoons drwxrwxr-x 2 ra-spain root 0 mar 23 15:20 'Ghostbusters' -rwxrwxr-x 1 ra-spain root 33273 mar 23 15:33 'Ghostbusters.m3u' drwxrwxr-x 2 ra-spain root 0 feb 29 22:19 'Trip' ra-spain@macbook-air:/srv/tc-proxy$

leobrigassi commented 3 months ago

That's not from inside the directory.

Browse inside the time-capsule-proxy directory /folder.

Then run the command.

Thanks

Snake221982 commented 3 months ago

That's not from inside the directory.

Browse inside the time-capsule-proxy directory /folder.

Then run the command.

Thanks

ra-spain@macbook-air:~/time-capsule-proxy$ whoami && groups && ls -la ra-spain ra-spain adm cdrom floppy sudo audio dip video plugdev users netdev bluetooth lpadmin autologin scanner systemd-journal итого 210700 drwxr-xr-x 2 ra-spain ra-spain 4096 ago 6 07:03 . drwxr-xr-x 32 ra-spain ra-spain 4096 ago 6 06:59 .. -rwxrwx--- 1 ra-spain ra-spain 924 ago 6 06:59 connection.log -rw-r--r-- 1 1001 1001 215613440 ago 5 15:02 data.img -rwxr-xr-x 1 ra-spain ra-spain 1135 ago 5 22:34 enable-service-at-startup.sh -rw-r--r-- 1 ra-spain ra-spain 475 ago 5 23:13 .env -rw------- 1 1001 ra-spain 3389 jun 6 23:02 id_rsa_vm -rw------- 1 ra-spain ra-spain 752 jun 6 23:05 id_rsa_vm.pub -rwxr-xr-x 1 ra-spain ra-spain 856 ago 5 22:34 install.sh -rw-r--r-- 1 ra-spain ra-spain 35149 ago 5 22:34 LICENSE -rwxr-xr-x 1 ra-spain ra-spain 4661 ago 5 22:34 mount-time-capsule-proxy.sh -rw-r--r-- 1 root root 18 ago 4 23:35 qemu.mac -rw-r--r-- 1 ra-spain ra-spain 5302 ago 5 22:34 README.md -rwxr-xr-x 1 ra-spain ra-spain 8737 ago 5 22:34 setup-time-capsule-proxy.sh -rw-r--r-- 1 ra-spain ra-spain 278 ago 5 23:13 time-capsule-proxy.service -rwxr-xr-x 1 ra-spain ra-spain 2824 ago 5 22:34 uninstall.sh -rwxr-xr-x 1 ra-spain ra-spain 490 ago 5 22:34 vm-down.sh -rw-r----- 1 root root 118 ago 6 06:59 vm.log -rwxr-xr-x 1 ra-spain ra-spain 2012 ago 5 22:34 vm-restart.sh -rwxr-xr-x 1 ra-spain ra-spain 199 ago 5 22:34 vm-ssh.sh -rw-r--r-- 1 root root 1524 ago 5 22:07 wget-log -rw-r--r-- 1 root root 1524 ago 5 22:08 wget-log.1 -rw-r--r-- 1 root root 1524 ago 6 07:02 wget-log.2

leobrigassi commented 3 months ago

Looks like you have some funky permission policy interfering with the script. I've updated the script again to account for your case where elevated privileges are required to access the VM. However I've updated the script so that other users that do not need it will still use normal privileges which is better.

Can you please provide some more info on the user (1001) that owns id_rsa_vm? run: getent passwd 1001

Also can you confirm the uid of ra-spain? run: id -u

Please test the updated installation script and verify it mounts correctly the time-capsule-proxy also after reboot? Thanks for your help debugging!

Snake221982 commented 3 months ago

Похоже, у вас какая-то странная политика разрешений, которая мешает работе скрипта. Я снова обновил скрипт, чтобы учесть ваш случай, когда для доступа к виртуальной машине требуются повышенные привилегии. Однако я обновил скрипт так, чтобы другие пользователи, которым это не нужно, по-прежнему использовали обычные привилегии, что лучше.

Можете ли вы предоставить больше информации о пользователе (1001), которому принадлежит id_rsa_vm? выполните: getent passwd 1001

Также можете ли вы подтвердить uid ra-spain? выполните: id -u

Пожалуйста, протестируйте обновленный скрипт установки и убедитесь, что он правильно монтирует time-capsule-proxy также после перезагрузки? Спасибо за помощь в отладке!

getent passwd 1001

ra-spain@macbook-air:~$ getent passwd 1001 ra-spain@macbook-air:~$

ra-spain@macbook-air:~$ id -u 1000 ra-spain@macbook-air:~$

ra-spain@macbook-air:~/time-capsule-proxy$ whoami && groups && ls -la ra-spain ra-spain adm cdrom floppy sudo audio dip video plugdev users netdev bluetooth lpadmin autologin scanner systemd-journal итого 211532 drwxr-xr-x 2 ra-spain ra-spain 4096 ago 6 15:02 . drwxr-xr-x 32 ra-spain ra-spain 4096 ago 6 15:00 .. -rwxrwx--- 1 ra-spain ra-spain 462 ago 6 15:02 connection.log -rw-r--r-- 1 1001 1001 216465408 ago 6 15:05 data.img -rwxr-xr-x 1 ra-spain ra-spain 1135 ago 6 11:58 enable-service-at-startup.sh -rw-r--r-- 1 ra-spain ra-spain 632 ago 6 15:02 .env -rw------- 1 1001 ra-spain 3389 jun 6 23:02 id_rsa_vm -rw------- 1 ra-spain ra-spain 752 jun 6 23:05 id_rsa_vm.pub -rwxr-xr-x 1 ra-spain ra-spain 856 ago 6 11:58 install.sh -rw-r--r-- 1 ra-spain ra-spain 35149 ago 6 11:58 LICENSE -rwxr-xr-x 1 ra-spain ra-spain 4687 ago 6 15:02 mount-time-capsule-proxy.sh -rw-r--r-- 1 root root 18 ago 4 23:35 qemu.mac -rw-r--r-- 1 ra-spain ra-spain 5302 ago 6 11:58 README.md -rwxr-xr-x 1 ra-spain ra-spain 9409 ago 6 11:58 setup-time-capsule-proxy.sh -rw-r--r-- 1 ra-spain ra-spain 278 ago 6 15:02 time-capsule-proxy.service -rwxr-xr-x 1 ra-spain ra-spain 2833 ago 6 11:58 uninstall.sh -rwxr-xr-x 1 ra-spain ra-spain 499 ago 6 11:58 vm-down.sh -rw-r----- 1 root root 118 ago 6 15:01 vm.log -rwxr-xr-x 1 ra-spain ra-spain 2021 ago 6 11:58 vm-restart.sh -rwxr-xr-x 1 ra-spain ra-spain 208 ago 6 11:58 vm-ssh.sh -rw-r--r-- 1 root root 1524 ago 5 22:07 wget-log -rw-r--r-- 1 root root 1524 ago 5 22:08 wget-log.1 -rw-r--r-- 1 root root 1524 ago 6 07:02 wget-log.2

leobrigassi commented 3 months ago

Thanks.

Install again to test the latest update works for you. If you can please check the mount is available after reboot (it takes a couple of minutes). cheers!

Snake221982 commented 3 months ago

Thanks.

Install again to test the latest update works for you. If you can please check the mount is available after reboot (it takes a couple of minutes).

cheers!

Updated, rebooted the MacBook. After rebooting, the script automatically launched and everything works fine. Once again, many thanks.🤝🤝🤝

leobrigassi commented 3 months ago

my pleasure.

By the way if you are using a MacBook it would explain the issues you encountered. Take note that it can mount the time capsule natively without using this trick.. ;)

open Finder go to Network (SHIFT + CMD + K) select your Time Capsule or AirPort Extreme and enter credentials

This script is more intended to be used with Linux machines with kernel 5.15 or above which no longer support the sec=ntlm mount flag and therefore have trouble mounting the share directly.

Anyway enjoy ;)

Snake221982 commented 3 months ago

my pleasure.

By the way if you are using a MacBook it would explain the issues you encountered. Take note that it can mount the time capsule natively without using this trick.. ;)

open Finder

go to Network (SHIFT + CMD + K)

select your Time Capsule or AirPort Extreme and enter credentials

This script is more intended to be used with Linux machines with kernel 5.15 or above which no longer support the sec=ntlm mount flag and therefore have trouble mounting the share directly.

Anyway enjoy ;)

The thing is that I have Linux installed on my MacBook, so I needed this script, since there were no other ways to connect to the capsule.

Snake221982 commented 3 months ago

In the network section, the Mac sees the capsule, but does not connect to it. And with the help of the script, all the problems were solved

leobrigassi commented 3 months ago

I see. Glad to be of help!