BCVK-EPHEMERAL-SSH(8)

πŸ“¦
version 0.21.0 Β· 3 versions
, in fedora 43, fedora 44

πŸ’– bcvk-ephemeral-ssh(8) πŸ’–

okay bestie, welcome to bcvk-ephemeral-ssh β€” the section 8 manual page that teaches you how to slide into a running VM's DMs via SSH ✨


✨ NAME ✨

bcvk-ephemeral-ssh β€” Connect to running VMs via SSH πŸ¦‹


🌸 SYNOPSIS 🌸

bcvk ephemeral ssh CONTAINER_NAME [SSH_ARGS]

πŸ’… DESCRIPTION πŸ’…

So basically, this command connects you to a running ephemeral VM via SSH. It's giving ✨main character energy✨ because it does all the annoying detective work for you: it goes and finds the VM's SSH port, and then it connects using the SSH key that was injected when the VM got started with -K or --ssh-keygen. No cap.

πŸŽ€ Prerequisites πŸŽ€

The target VM has to have been started with SSH key injection, fr fr:

bcvk ephemeral run -d --rm -K --name myvm image

Without -K, the VM will not have SSH keys configured and this command will fail to authenticate. It's giving locked out of your own house 😭 no key, no entry.

πŸ”₯ How It Works πŸ”₯

  1. Queries the podman container to find the VM's SSH port
  2. Retrieves the SSH private key from the container
  3. Connects using the dynamically assigned port and key
  4. Passes any additional arguments to the ssh client

like… it's literally just doing the four steps you would have done manually, but cute and automatic πŸ’…

πŸ¦‹ VM Lifecycle πŸ¦‹

SSH connections do not affect the VM lifecycle for background VMs, okay? Important:

  • Background VMs (started with -d) β€” Continue running after SSH disconnect. You can reconnect as many times as needed. Obsessed with the loyalty πŸ’–
  • Auto-cleanup VMs (started with --rm) β€” Container is removed when the VM stops, but SSH disconnect alone does not stop the VM.

To stop a background VM, use podman stop.

For automatic cleanup on SSH exit, use bcvk-ephemeral-run-ssh(8) instead.


⭐ OPTIONS ⭐

  • CONTAINER_NAME β€” Name or ID of the container running the target VM. This argument is required. (Yes bestie, you have to tell it which VM. It can't read your mind, sadly πŸ™ˆ)
  • ARGS β€” SSH arguments like -v, -L, -o

🌈 EXAMPLES 🌈

πŸ“ Basic Connection

Connect to a running VM:

bcvk ephemeral ssh myvm

🧚 Running Remote Commands

Execute a command directly:

bcvk ephemeral ssh myvm 'systemctl status'

Check disk usage:

bcvk ephemeral ssh myvm 'df -h'

View journal logs:

bcvk ephemeral ssh myvm 'journalctl -f'

πŸ’œ SSH Options

Enable verbose output for debugging connection issues:

bcvk ephemeral ssh myvm -v

Forward a local port to the VM:

bcvk ephemeral ssh myvm -L 8080:localhost:80
# Access VM's port 80 at localhost:8080

Reverse port forwarding (expose host port to VM):

bcvk ephemeral ssh myvm -R 3000:localhost:3000

πŸ‘‘ Typical Workflow

# Start a VM in the background
bcvk ephemeral run -d --rm -K --name testvm quay.io/fedora/fedora-bootc:42

# Connect and do some work
bcvk ephemeral ssh testvm
# ... interactive session ...
# exit

# Reconnect later
bcvk ephemeral ssh testvm

# Run a quick command without interactive session
bcvk ephemeral ssh testvm 'cat /etc/os-release'

# Stop the VM when done
podman stop testvm

🫢 File Transfer

Use scp-style operations by getting the SSH details:

# For now, use podman exec for file transfer
podman cp localfile testvm:/path/in/container

# Or mount a shared directory when starting the VM
bcvk ephemeral run -d --rm -K --bind /host/path:shared --name vm image

😭 TROUBLESHOOTING 😭

  • Connection refused β€” The VM may still be booting. Wait a few seconds and retry. She's just not ready yet, give her a minute 🫢
  • Permission denied β€” Ensure the VM was started with -K for SSH key injection. No -K, no key, no vibe check passing.
  • Host key verification failed β€” Each VM gets a unique host key. Use -o StrictHostKeyChecking=no if needed. (Yes it's a little unhinged, that's the point.)

🌟 SEE ALSO 🌟

bcvk(8), bcvk-ephemeral(8), bcvk-ephemeral-run(8), bcvk-ephemeral-run-ssh(8), ssh(1)


πŸŽ€ VERSION πŸŽ€

v0.21.0


okay that's the whole page bestie, go forth and SSH into your little ephemeral VM, you absolute icon πŸ’…βœ¨ periodt. this was bcvk-ephemeral-ssh(8), version v0.21.0 β€” ily, bye πŸ¦‹πŸ’–

πŸ“¦ where this page comes from