nix-on-droid
nix-on-droid copied to clipboard
Is there a chance to get nixpkgs GNU screen version to work ?
When starting via screen -S phone
I am getting
Setuid/gid: Function not implemented [screen is terminating]
EDIT: To motivate my question further I find that tmux on the other end works but at least the current version misses the possibility to scroll up the scrollback buffer outside what is visible in the pane while a selection is active. Consequence of the latter you may copy and paste only the amount of lines visible when starting the selection.
(Related: #81)
@573 There is no error in my side. As nix-shell -p screen, then run screen -S phone. switch back by running screen -d. No sure what you mentioned after that error in the above. The selection in my version of nix-on-droid, there is "super copy or something" in the popping up list as you select the text in the screen. that might help us a little bit. we are in tmux as we are taking about running nix-on-droid on the Android.
nix run nixpkgs.screen -c screen -S phone
same two error messages posted above are printed screen terminates and I am back on my regular shell prompt.
@573 The nix-on-droid in my Android phone is from F-Droid, and its version is 0.66_v0.2.4_nix. As running the command you posted in the above, there is no error in my side. And also install the version 0.96 of Termux, in that version Termux, run pkg install screen .Then it can be run commands of screen (screen -S phone) in Termux without any issue until now. Because the nix-on-droid we have is forked from Termux. Make sure it work on Termux firstly, referencing what the owner said in the file readme.md of his repo @t184256,
@APIPLM thank you very much, your suggestion is a really good workaround for when nix-installed screen doesn't work for any reason.
I would love to see screen coming from nixpkgs working though and due to that would rather leave that ticket still open.
I'll change title accordingly.
If I should rather post to nixpkgs directly give me a note pls, maybe it's their issue.
Make sure it work on Termux firstly, referencing what the owner said in the file readme.md of his repo
I can't find this in Readme, also why should that be something a nix(-on-droid) user had to do ?
Because the nix-on-droid we have is forked from Termux. Make sure it work on Termux firstly, referencing what the owner said in the file readme.md of his repo @t184256,
Sorry, what?
Nix-on-Droid uses a fork of Termux-the-terminal-emulator, the thing that displays the console, switches between them etc. What happens inside those consoles isn't related to Termux-the-distro.
If you think I can make this any more clear, please suggest how I should rephrase it, and I will.
@t184256 you are right. the above error sound like something inside Termux. There is nothing for you to rephrase out from my side now. What I mean that ask @573 to have a new environment Termux to test, and see if there is the same error. Because Nix-on-Droid uses a fork of Termux-the-terminal-emulator, so I would call ,kind of Termux is an original environment to test for the tool screen.
Seem like there is kind of similar error in my side not for tool screen, but for the tool sshd of openssh package. After nix-shell -p openssh, create file sshd_config file in /etc/ssh/ ( also ssh-genkey for field HostKey /etc/ssh/ssh_host_rsa_key in file sshd_config). when I run "sshd -p 8022 -d", there is error message "setgroups() failed : Operation not permitted" , the sshd service still running As I come to nixos system to try to manually install openssh, I mean by the same way in the above on the phone, nix-shell -p openssh , But one thing that it should be done by sudo command to ssh-genkey to key in the folder /etc/ssh/. The error information sound like related to permission they set in the nixOS environment. They did not think about we will run those in the Android system. @zimbatm
Of course it isn't configured out of the box to run in such a twisted unprivileged environment and nobody has considered it along the way. This is something that should be adapted and accounted for here, in Nix-on-Droid.
Meanwhile, we have a wiki page detailing the current workarounds required to run sshd under Nix-on-Droid, have you tried these?
@t184256 I tried it. In the step 5 with -d for debug output, there is error message "setgroups() failed : Operation not permitted" the service still running.
And also the user is not nix-on-droid.The following is the line in the output of running ps -aux. The dropbear service is running on the phone. I can see the owner of sshd. u0_a201 18042 0.0 0.1 8948 4692 pts/28 S<+ 1970 0:00 sshd: /nix/store/n8xqyz932m028p3bgbwwinckqr00znyz-openssh-8.2p1/bin/sshd -p 8022 -d But I can see the user nix-on-droid in file passwd in the folder /etc/ as well
And also the user is not nix-on-droid.The following is the line in the output of running ps -aux.
You ran the ps -aux in termux, right? Because ps does not work inside Nix-on-Droid. The running user for sshd should be nix-on-droid, please compare the uid from id command in Nix-on-Droid. Termux does not know about the nix-on-droid user because these are using completely different environments.
I could not reproduce the setgroups() failed : Operation not permitted error, but as long as it works it's fine I guess. Nix-on-Droid has a very minimal user and group management, like we generate a passwd so that the most commands don't complain. But this discussion has already been started here (https://github.com/t184256/nix-on-droid/issues/70).
For the screen issue there might be a patch necessary. @573, maybe you have some ambitions to dive into screen's source code, unfortunately I don't have time for it right now.
I can confirm the bug, running:
nix run nixpkgs.screen -c screen -S phone
Also gives me the above error.