# Pausing VMs kills recording

**URL:** <https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002>\
**Category:** Help\
**Created:** [June 8, 2025, 1:09pm UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002 "2025-06-08T13:09:22Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cyb3rC3lt](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Cyb3rC3lt](https://discourse.asciinema.org/u/Cyb3rC3lt)\
**Post date:** [June 8, 2025, 1:09pm UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/1 "2025-06-08T13:09:22Z")

</div>

Hi there,

Just wondering is there any workaround for when I pause my VM for the day and when I reopen it the following day all my recordings are dead. I tried pausing the recording and unpausing the recording after the VM restarted but that also didn’t restart.

Any tips?

Thanks  
David

---

<div class="post-metadata">

**Author:** ![ku1ik](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.asciinema.org/ku1ik/32/171_2.png) [@ku1ik](https://discourse.asciinema.org/u/ku1ik)\
**Post date:** [June 9, 2025, 9:19am UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/2 "2025-06-09T09:19:22Z")

</div>

What guest OS does the VM run?

What do you mean by “dead”?

Any output in the shell which started `asciinema rec`? Or you’re recording headless, using e.g. systemd service unit?

---

<div class="post-metadata">

**Author:** ![Cyb3rC3lt](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Cyb3rC3lt](https://discourse.asciinema.org/u/Cyb3rC3lt)\
**Post date:** [June 9, 2025, 9:49am UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/3 "2025-06-09T09:49:58Z")

</div>

So the guest VM is Kali and when I mean dead I mean I go to the terminal where asciinema was previously recording and type in further commands and it is no longer recording (unknown to me) following the VM pause.

Can see in the image below I pause at the red line after the first date command and after coming back and issue the second date command the playback in the next screenshot doesn’t register the 2nd date command so the recording has in fact stopped.

The recording is started automatically via zshrc with asciinema rec -i 0.001 /logs/datetime.cast

Hope that helps

 ![1000022887](https://canada1.discourse-cdn.com/flex027/uploads/asciinema/original/1X/dfd62acba72093ca4cad02b32de0e2c771aa346d.png)

---

<div class="post-metadata">

**Author:** ![Cyb3rC3lt](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Cyb3rC3lt](https://discourse.asciinema.org/u/Cyb3rC3lt)\
**Post date:** [June 9, 2025, 9:50am UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/4 "2025-06-09T09:50:28Z")

</div>

Playback not showing 2nd date command:

 ![1000022888](https://canada1.discourse-cdn.com/flex027/uploads/asciinema/original/1X/951e9964798119587e8bd21bef5dd4f7b83a00ea.png)

---

<div class="post-metadata">

**Author:** ![moritzdietz](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.asciinema.org/moritzdietz/32/504_2.png) [@moritzdietz](https://discourse.asciinema.org/u/moritzdietz)\
**Post date:** [June 19, 2025, 12:00pm UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/5 "2025-06-19T12:00:12Z")

</div>

Out of curiosity: How does something like

```auto
tail -f /var/log/messages

```

Does this resume putting out new lines after you un-pause the VM?

---

<div class="post-metadata">

**Author:** ![ku1ik](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.asciinema.org/ku1ik/32/171_2.png) [@ku1ik](https://discourse.asciinema.org/u/ku1ik)\
**Post date:** [June 26, 2025, 11:19am UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/6 "2025-06-26T11:19:02Z")

</div>

@Cyb3rC3lt if you can use the latest CLI version ([Release v3.0.0-rc.5 · asciinema/asciinema · GitHub](https://github.com/asciinema/asciinema/releases/tag/v3.0.0-rc.5)) then add `--log-file /path/to/asciinema.log` option to the `rec` command. If the issues is related to file writing (I/O) then error message should show up in the log file.

---

<div class="post-metadata">

**Author:** ![Cyb3rC3lt](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Cyb3rC3lt](https://discourse.asciinema.org/u/Cyb3rC3lt)\
**Post date:** [June 26, 2025, 11:30am UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/7 "2025-06-26T11:30:20Z")

</div>

Thanks guys, I will try this and get back to you

---

<div class="post-metadata">

**Author:** ![Cyb3rC3lt](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Cyb3rC3lt](https://discourse.asciinema.org/u/Cyb3rC3lt)\
**Post date:** [June 27, 2025, 8:19am UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/8 "2025-06-27T08:19:44Z")

</div>

Hi guys, here is a screenshot of me carrying out a few commands, then pausing it then replaying the session. I normally want to replay all my sessions as quickly as possible hence the -i 0.0000001.

Here is what appeared in the logs after unpausing:

`2025-06-27T08:10:55.862182Z ERROR asciinema::session: output event handler failed: Os { code: 5, kind: Uncategorized, message: "Input/output error" }`

Just so you know my use case. As a Pentester I may just pause my VM every night for weeks to keep onto the console data of the client to take as screenshots near the end of the project. I would be using asciinema as a backup in case Kali crashed or something hence my logs are stored on a share with Windows called ‘Console Logs’.

I start it like this via zshrc which was courtesy of GPT - Auto-start asciinema recording and save to /mnt/hgfs/ConsoleLogs if not already started in this shell. Thanks

if [[-z “$ASCIINEMA\_RECORDING\_STARTED” && -t 1]]; then  
export ASCIINEMA\_RECORDING\_STARTED=1  
asciinema rec -i 0.001 --log-file ~/asciinema.log /mnt/hgfs/ConsoleLogs/$(date +%H-%M-%S\_“%d-%m-%Y”).cast  
exit  
fi

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/asciinema/original/1X/b61061a88149117b22ef077b4092b517ad591c8a.png)

---

<div class="post-metadata">

**Author:** ![moritzdietz](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.asciinema.org/moritzdietz/32/504_2.png) [@moritzdietz](https://discourse.asciinema.org/u/moritzdietz)\
**Post date:** [July 11, 2025, 4:19pm UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/9 "2025-07-11T16:19:56Z")

</div>

I bet it’s because the remote share you are trying to write to has not been mounted yet when the process tries to resume and then it exits.

Please try to record to the local disk and see if the issue is still there.

---

<div class="post-metadata">

**Author:** ![Cyb3rC3lt](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Cyb3rC3lt](https://discourse.asciinema.org/u/Cyb3rC3lt)\
**Post date:** [July 11, 2025, 4:48pm UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/10 "2025-07-11T16:48:00Z")

</div>

Great catch you are right!! After unpausing and continuing on it now caught my ‘ls’ command after unpausing and played it correctly ilustrating it continued to record. This is great.

So I guess I have two options, don’t save to mounted or somehow start the process again after mounting has occurred.

I guess saving to mounted was being paranoid in case Linux completely broke so maybe locally isnt the worst solution or maybe I save it locally and have the logs uploaded to cloud every so often to be backed up.

Thanks very much for sticking with this issue, really appreciated.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/asciinema/original/1X/176c5c5c4c21646ae8a2474f2b803866a5773da9.png)

---

<div class="post-metadata">

**Author:** ![ku1ik](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.asciinema.org/ku1ik/32/171_2.png) [@ku1ik](https://discourse.asciinema.org/u/ku1ik)\
**Post date:** [August 27, 2025, 3:31pm UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/11 "2025-08-27T15:31:19Z")

</div>

I’m glad you solved it.

Btw, about your usage of `ASCIINEMA_RECORDING_STARTED` env var: `asciinema rec` sets `ASCIINEMA_REC=1` env var automatically so it’s enough to check for its presence, no need to set your own var.

---

<div class="post-metadata">

**Author:** ![Cyb3rC3lt](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@Cyb3rC3lt](https://discourse.asciinema.org/u/Cyb3rC3lt)\
**Post date:** [August 28, 2025, 7:08am UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/12 "2025-08-28T07:08:27Z")

</div>

Thanks that’s really good to know

---

<div class="post-metadata">

**Author:** ![ku1ik](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.asciinema.org/ku1ik/32/171_2.png) [@ku1ik](https://discourse.asciinema.org/u/ku1ik)\
**Post date:** [November 7, 2025, 10:16am UTC](https://discourse.asciinema.org/t/pausing-vms-kills-recording/1002/13 "2025-11-07T10:16:49Z")

</div>


