Ubuntu – How to record the screen (or screencast) in text mode

screencastvirtual-console

Basically I want to capture the process of installing a driver in Ubuntu so I can watch it later.

There are screen capture applications such as SimpleScreenRecorder, but they won't work in text mode because there is no display driver when I stop LightDM.

There is also fbcat which lets us take screenshots in textmode, but I wonder if there is something I can use to screencast when I switch to Ctrl+Alt+F2?

Best Answer

Asciinema

If you want to go youtube style, look at asciinema. You can install it using:

sudo apt install asciinema

To get a more recent version if you are not on 18.04 yet, you can either use this ppa:

sudo apt-add-repository ppa:zanchey/asciinema
sudo apt update
sudo apt install asciinema

or use the pip method:

sudo apt install python3-pip
pip3 install asciinema --user

(see also: How to install pip (python) to user without root access)

Now start a recording session using

asciinema rec output.cast

which will drop you in another shell. Recording will last until you exit this shell. You can play the result using:

asciinema play output.cast

Beware! If you start asciinema rec without providing an output file name, it will default to uploading the recorded session to asciinema.org and returning just a URL. You can cancel before, but it's easy to miss that point.