12

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.

4 Answers 4

6

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.

3
  • 1
    Yes, VLC readonly is the way to go.
    – David
    Commented Dec 8, 2013 at 23:21
  • If I do vnc, would I need to somehow find a way to embed vnc in a web browser? the ffmpeg idea actually sounds like a good one because i can set it to stream to any of those streaming video broadcasting sites, right?
    – Justin L.
    Commented Dec 9, 2013 at 8:12
  • @JustinL. see updated answer for vnc through browser.
    – peterph
    Commented Dec 9, 2013 at 21:24
4

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.

1
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.

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"
2
  • Wow I did not realize that shellinabox could bind to specific programs. I'll check that out.
    – Justin L.
    Commented Dec 9, 2013 at 10:30
  • I'm going to end up running with the shellinabox solution, I'm just going to accept the other answer because it was a slightly more direct answer to the actual problem I was asking about :) I hope you understand.
    – Justin L.
    Commented Dec 13, 2013 at 1:44
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .