Not totally sure if this is the right place but here goes.
I understand that you are able to use X11 to ssh to GUI’s and view them, without the server having a full on GUI system running/installed like gnome or something.
My end goal is to be able to “broadcast” my coding sessions online, so people can view them online.
Right now I have set it up so that a restricted tmux session will basically always be mirroring my own personal tmux coding session window. So if you ssh onto the server on a restricted account, you can hop onto the restricted session and follow my coding.
However, I want to be able to let people watch this from their browser. I suspect that the best way is to have some terminal emulator on x11 running on my server attached to the tmux session..and then somehow have the browser view that terminal emulator?
I’m not really too familiar with this domain, so does anyone know if this is possible? Or is there a better approach I should be taking?
Note that I code entirely on a remote headless server that I ssh onto.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
It really depends on what exactly you want to end up with.
If you want multiple people connecting to your computer watching what you are doing, then exporting the X session through VNC should do it. You can either run a separate “headless” server (rendering into RAM frame buffer instead of a graphical card memory) or even export your current session with x11vnc. For x11vnc (which you may of course do even with the headless server), the -viewonly option is your friend, since you don’t want others to be able to interfere with whatever you do there. There seem to be solutions for connectiong to VNC server from a web browser, for example noVNC or realvnc
To broadcast the video (and optionally audio), so that it can be viewed without any “special” software or played back later, you can use for example ffmpeg which is able to grab X11 data (search for x11grab in docs) and turn it into a video. Of course you can add an audio stream of you commenting it. You can then stream the output and depending on the format and codecs it might be possible to watch it in a browser directly. However, unless you are in academia (or making this as a private, non-commercial activity), you are likely to be legally unable to use some codecs because of their patent encumberedness.
Method 2
Xpra has an html5 client which works really great, even though it is in an early development phase. I do personally use it as an X11 forwarding replacement, as it spawns an X11 session and only displays single applications, just as you’ve described. It has a ‘shadow’ option as well that allows to connect to an existing session as well.
Method 3
I haven’t done any screencasting so far, but for your case I see two possibilities:
Video-based live screencasting
This actually uses video streams. The advantage is that you could show your whole X session, using multiple programs, also graphical ones and that it is possible to include audio on the same channel, like comments on what you are just coding. On the downside if all you want is showing a terminal session, video codecs might not ideal concerning both bandwith requirements and image quality.
- Something along that line is included in BigBlueButton. It features a lot more and might be an overkill for your use case but as an learning environment it is certainly worth a look. To see what it does checkout the demos. For a quick start using it there is the BigBlueButtonVM.
- Otherwise there seems to be a way to make ffmpeg do that (see
Real time screencast to HTML5 <video> … and Live screencasting using ffmpeg). - As you mentioned streaming services: With WebcamStudio you can share your desktop and mix in other video sources for services grabbing a webcam via flash etc.
Web terminal emulators
This could work pretty similar to your current setup. Basic idea is to have something like xterm in a browser. In this category I found several solutions, most notably:
- GateOne features an ssh client that you could probably use with your current setup.
- shellinabox is bound to specific programs on the server. Instead of a shell that could be your “tmux player”
Method 4
I think I would be tempted to look into the pair programming offerings/methods to see what might suit your needs here. I know you could use X11vnc, as others have mentioned. It works reasonably well, not sure how well it would scale of you’re intending to have 2 or more people watch your session.
Floobits
There is this service, Floobits. Looks free to at least start, don’t know the particulars.
excerpt
We currently support Sublime Text, Vim, and Emacs. We also have a browser-based editor.
As we’ve built these plugins, we’ve learned that real-time collaboration requires more than sharing code. We wanted to share shells, so we built Flootty. We wanted to ship changes to a test server as we typed, so we built a headless diff-shipper. We wanted to voice chat and screen-share, so we added Google+ Hangouts to our web-based editor.
Sign up and try us out for free.
Google Hangouts
I’d probably go this route. You can create a Google Hangout and then be the driver of the session while others “watch”. Should scale very nicely and has solved most of the technical hurdles for you in terms of getting through peoples’ firewalls, sharing tools, and in providing an overall good experience.
I think the only downside is that others would need to have Google+ accounts. But that should be a deal breaker.
Other options?
Lastly I’d go through this StackOverflow Q&A titled: http://www.google.com/+/learnmore/hangouts/. Though this question was closed as off-topic as is often the case, there are a lot of good leads to methods to solving your particular problem’s needs by combing through these types of questions and evaluating the various technologies.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0