WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: ssh-rdp and Tiny Core: A (kinda jank) match made in Heaven  (Read 5408 times)

Offline Techo

  • Newbie
  • *
  • Posts: 3
ssh-rdp and Tiny Core: A (kinda jank) match made in Heaven
« on: November 05, 2022, 12:09:06 PM »
https://github.com/kokoko3k/ssh-rdp

tl;dr version: a very useful screen/audio/input sharing script with fairly minimal dependencies, but is somewhat jank due to needing group access for /dev/input, and I wouldn't mind any ideas on less janky solutions

Longer version: Over the past year or so, I've come to one very strong realization: I like messing around with stuff on my main machine, but I also hate messing around with bringing said stuff to other machines. As well, since I download most of the videos I watch, I also wasn't a fan of bringing files around from computer to computer, keeping track of what I had and hadn't watched between computers, so on and so forth. Plus, I wanted to play some games on my laptop while in bed, because there's nothing cozier. Eventually, I started trying some remote desktop programs. TeamViewer had way too much latency for me, as did NoMachine. UltraGrid was another recommendation I found, but I couldn't get the settings dialed in on that to my satisfaction (my pretty powerful definitely-not-netbook Dell Latitude 3390 was running like a furnace; God help any netbook that woulda tried that video feed). Eventually I tried Steam Link, and it worked really well, outside of a few blips here and there. However, after a few months of using that, I grew kinda restless. First, like all closed source software, I had no idea what it was actually doing under the hood, and for something pretty high security, that's very important. Second, on the client end, I had to install FlatPak, which took up a rather cumbersome amount of drive space. Third, I wasn't happy enough with the security measure of it being a four digit PIN that you type in at the beginning, and it just works from there a-la Bluetooth pairing, especially considering said software essentially gives an open avenue for control of the machine that could theoretically be Internet-facing (again, I have no idea).

Eventually I stumbled upon ssh-rdp which fixes basically all of those issues; it's a ~1,000 line Bash script that calls upon very standard requisites such as ffmpeg, mpv, and a few others. After some initial setup difficulty of understanding how it works, I've been very happily using it since, and it's been performing just as well as Steam Link, barring a known audio latency issue that I can just manually offset in mpv, so it's no concern. Then, I put two and two together, remembering this "meme" OS here, and got to setting up a portable remote desktop installation on an old 256MB USB drive, since the idea really amused me.

All the prereqs were in the repos, save for netevent, but after a really bizarre clang issue where ash reported that it couldn't find the executable I was directly trying to run (even though it could find it with tab completion), just compiling with g++ saved the day. However, as the post title says, there is some jank to it. Busybox's taskset doesn't work the same as util-linux's taskset (the -c flag doesn't seem to work at all in Busybox's version), but that doesn't seem to affect performance all that much, so I just took it out from the script. However, the main jank pertains to /dev/input. There doesn't seem to be an input group, as everything in /dev/input is owned by root:root. The highly questionable thing that I do to make it work is to chown -R tc:staff /dev/input. Thankfully, since it is such a minimal installation, I don't have to worry about any suspicious code doing suspicious things. However, I really would like to know if there's a more elegant solution. I can't just run the script as root, since it uses SSH, and I'm not about to stash this stuff in /root/. Simply chowning /dev/input to root:input makes no difference either, since it doesn't persist between reboots.

Fortunately, with this setup, it doesn't matter all that much that I have to do something which would normally be a horrible idea. Despite some jank, as far as functioning as a pseudo-terminal, it's been working excellently. I'm posting about this mainly to bring this excellent script to more peoples' attention, as well as ask if anyone had any more elegant solution to the issue of /dev/input's group. As mentioned, netevent isn't in the repos (I thought about submitting it, but given the jank of this setup, I haven't yet), but it's really easy to compile with g++, and doesn't have any other prereqs. If a better solution than what I've got right now is found, I'd gladly maintain the package, as well as maintaining a package for ssh-rdp. Otherwise, despite some jank, I'm very happy with the life that this bit of software and Tiny Core have breathed into a few old netbooks of mine.