Proxmox pct connetion


wanted to build a connection plugin similar to lxc. It should directly connect into the container on a proxmox host that is not reachable via ssh.

This is my code so far (NOT finished):

But I hit some road bumps and I’m not sure if what I want to archive is possible.

What I wanted:

Call a playbook from my Laptop execute it on the proxmox host inside the container using pct exec.

What I got:

My code is trying to run on my Laptop and fails because it can’t find pct.

I read that we can only use one connection per host, so is what I wanted to archive impossible? Or must I warp the ptc connection inside a ssh tunnel?

So something like:

remote_cmd = [
    self.get_option("executable"), "-c", cmd])

ssh = paramiko.SSHClient()
ssh.connect(hostname=host, username=user, pkey=k)
ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command(' '.join(remote_cmd))

I figured it out, it works:

1 Like