Skip to content

Ways to share screens in Qube OS

eaon edited this page Aug 29, 2022 · 7 revisions

This is not an exhaustive list!

Overview

  • HDMI capture devices (e.g. MiraBox HS321, or HS3217) act like a secondary display.
  • They can be used to make the content of screens available to an AppVM, or a different computer (e.g. by mirroring a primary display).
  • On Linux, mpv can be used as lightweight way to share a fullscreen in a simple Google Meet, Zoom meeting etc.
  • OBS Studio allows to edit output of the MiraBox and make it available as a virtual camera.
  • OBS Studio also allows to combine multiple inputs if you want to. (e.g. to show your screen and your webcam)
  • Most videoconferencing apps can use that virtual camera as if it was your usual webcam.

Note that when using two computers, the MiraBox can be connected to any platform that runs OBS Studio, it doesn't need to be an AppVM on Qubes OS or even a Linux distrbution!

Caveats

  • The video quality will depend in part on how much resources you can allocate to the machine that runs OBS Studio (be it an AppVM in Qubes OS, or any other machine).
  • The video quality will also depend on the videoconferencing app: e.g. Google Meet optimizes for showing people's faces clearly, and trades off on the quality of the parts of the image that don't change much to save bandwidth. I what you want to share is mostly text, that might not be ideal.
  • OBS Studio installation is simpler on Debian than it is on Fedora.
  • The virtual camera feature became available on v26, which is available on Debian 11 and higher.

mpv How to

  1. Install mpv in the template that you use Google Meet/Zoom etc from (or: non-Qubes machine)
  2. Connect your HDMI capture device USB, make it available to the AppVM.
  3. Connect an HDMI cable from your laptop to the input of the capture device.
  4. Run mpv av://v4l2:/dev/video[INSERT NUMBER OF VIDEO CAPTURE DEVICE] --profile=low-latency --demuxer-lavf-o=video_size=1920x1080,input_format=mjpeg
  5. Share the mpv application window in Gmeet/Zoom (in Gmeet, make sure the send-resolution is set to 720p in settings)
  6. You can use your regular webcam normally if you want that sort of human connection

OBS How to

  1. Install OBS Studio v26 or higher. ([Official docs][obs-install]) Qubes OS:
    1. Clone the debian-11 template. (e.g. qvm-clone debian-11 debian-11-screenshare)
    2. Install OBS Studio in your new template. (e.g. sudo apt install obs-studio v4l2loopback-dkms)
    3. Install the videoconferencing app you want to use in that template. (e.g. sudo apt install chromium for Google Meet, which does not work in debian-11's Firefox ESR)
    4. Create an AppVM from that template.
  2. Connect your HDMI capture device USB, make it available to the AppVM.
  3. Connect an HDMI cable from your laptop to the input of the capture device.
  4. Run OBS Studio. (e.g. from the menus, or run obs in the AppVM)
  5. Configure a source and a scene in OBS Studio. ([details][configure-obs-studio])
  6. Start the virtual camera in OBS Studio.
  7. Start your videoconferencing app in the AppVM.
  8. Select the OBS Studio virtual camera as your camera.

Configure OBS Studio

OBS Studio allows you to share a scene. A scene is the canvas on which you display the output of one or more sources. Examples of sources are: your HDMI capture device, your webcam, your microphone...

You can, but don't have to share the entirety of each source in a given scene. A typical scene for pair programming, for example, could display the bottom part of the output of a HDMI capture device (excluding the top task bar), an overlay a scaled-down version of the output of your webcam in the top-right corner of the scene. Scaling, cropping and positioning are managed by OBS Studio, for each source in a given scene.

When you enable the virtual camera, the content of your scene is output.

External references

I've only skimmed through these, but they may be of interest:

But I just want to pair

If you're only interested in sharing a single window from Qubes, such as for the SecureDrop Client, then you don't need to use OBS Studio. Just make sure to run the videochat software (e.g. Google Meet, Jitsi Meet) in the same AppVM as the Client is running in—then you'll be able to share a window.