ssh access is available early in VM lifecycle, causing confusing phenomena like missing /tmp files

GitHub issue #147 Feature Proposed josharianvia github Feb 5, 2026 View original

In order to make it possible to ssh into our VMs as quickly as possible, we start it up early.

However, this means that it is possible to create a VM and then get into it before it is all set up.

This can cause pretty unexpected results. Here's one I just hit internally:

  • create new VM
  • scp file to /tmp
  • mv /tmp/foo $HOME

The mv failed because between scp and mv, the systemd-tmpfiles-setup.service (create volatile files and directories) ran and blew away /tmp.

My workaround in this case was not to use /tmp. Another workaround would be to run systemctl start systemd-tmpfiles-setup.service which should block until it is completed.

I don't know what we should do here in the general case, but I'm filing this bug so at least if anyone else hits this race condition they have this issue to refer to.

0 Comments

No comments yet.