VIRTLIX
🔐 Account & Security
Two-Factor Authentication
Docs / Troubleshooting & FAQ / Can't SSH Into a New LXC Container

Can't SSH Into a New LXC Container

Two separate things account for nearly every case of a freshly-created LXC container being unreachable over SSH:

1. The container's network isn't actually up. Some container templates (notably AlmaLinux's) ship a full NetworkManager that can start a few seconds into boot and reassert control of the interface, undoing the static IP/route Virtlix already configured. This is handled automatically on current versions, but if you're seeing a container with an assigned IP that doesn't respond to ping at all, check from the host itself:

lxc-attach -P /path/to/lxc-containers -n <container-name> -- ip a show eth0

If the interface shows state DOWN with no LOWER_UP, that's this issue - update to the latest Virtlix version, or manually run ip link set eth0 up from inside the container's network namespace to confirm that's really the cause.

2. SSH isn't installed yet, or is misconfigured. Official minimal container images (Ubuntu, Rocky Linux, CentOS Stream) don't ship openssh-server at all - Virtlix installs and configures it automatically as part of first-boot setup, but this depends on the container having working network/DNS at that exact moment. If it's still missing, attach to the container directly and check:

lxc-attach -P /path/to/lxc-containers -n <container-name> -- systemctl status sshd

If the service doesn't exist, network/DNS likely wasn't ready during first boot - install it manually (dnf install openssh-server or apt-get install openssh-server depending on the distro) and ensure PermitRootLogin yes and PasswordAuthentication yes are set in /etc/ssh/sshd_config (most images ship these disabled by default), then systemctl enable --now sshd.