Proxmox with hassio qcow2 VM how to access ssh support

I started with Proxmox on an Intel NUC, and created a VM for Home Assistant with qcow2.

This is running very well. But i would like to access my HA VM via ssh, like i do with my RPi4 install.
So i tried to install SSH & Web Terminal in Supervisor Ad-on-Store. But this add-on is not available (perhaps for this config with Proxmox VE?)
So i tried to find an other solution eg on the Proxmox forum; Perhaps i could configure the VE to have ssh enabled.
But i could not find a way how to do this. Has anyone an idea hoe to implement ssh HA/Proxmox VE?
To be clear, I am able to access the Proxmox VE Server via ssh (putty) from an other laptop in my local network, but i am not able to access a VM running qcow2 on this server with ssh from this same laptop

Enable advanced mode in your profile to be able to install the ssh addon.

Or install the Community addons web terminal ssh addon.

@tom_l Thank you for your reaction.
Yes, how stupid if me, that i have to run into this…
Sorry for bothering everyone with my silly mistake. I should have checked that! But i installed already several ad-ons when i run into this.

Don’t feel bad. Many people have had this problem.

I have still issues with SSH to the VM of HA. The install of the addon went flawlessly. I configured the addon with a public key which i generated in Windows. Looking in the log of the addon it seems that this part is also OK.
But the log ends with an error message:

[09:59:39] WARNING: SSH port is disabled. Prevent start of SSH server.

This is the full log of Terminal & SSH.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] cli: applying... 
[fix-attrs.d] cli: exited 0.
[fix-attrs.d] profile: applying... 
[fix-attrs.d] profile: exited 0.
[fix-attrs.d] ssh: applying... 
[fix-attrs.d] ssh: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] keygen.sh: executing... 
[09:59:39] INFO: Restoring host keys...
[cont-init.d] keygen.sh: exited 0.
[cont-init.d] profile.sh: executing... 
[cont-init.d] profile.sh: exited 0.
[cont-init.d] ssh.sh: executing... 
[09:59:39] INFO: Setup authorized_keys
[cont-init.d] ssh.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[09:59:39] INFO: Starting Web Terminal...
[services.d] done.
[2021/02/01 09:59:39:4462] N: ttyd 1.6.0-c15cfb7 (libwebsockets 3.2.2)
[2021/02/01 09:59:39:4465] N: tty configuration:
[2021/02/01 09:59:39:4466] N:   start command: tmux -u new -A -s homeassistant bash -l
[2021/02/01 09:59:39:4468] N:   close signal: SIGHUP (1)
[2021/02/01 09:59:39:4469] N:   terminal type: xterm-256color
[2021/02/01 09:59:39:4569] N:  Using foreign event loop...
[2021/02/01 09:59:39:4572] N:  Listening on port: 8099
[09:59:39] WARNING: SSH port is disabled. Prevent start of SSH server.

I search the Proxmox site for solutions to this but i found this item in the Proxmox Forum:

https://forum.proxmox.com/threads/ssh-ftp-zugriff-auf-eine-vm.74288/

I am sorry but this is in German language. But halfway i find that there should be an /etc/ssh/sshd_config where one should set: PermitRootLogin yes

But in the VM i used for Home Assistant with the qcow2 installation there is no ssh installed in the VM
(there is no /etc/ssh directory).
So i created a new VM using an image of Ubuntu 12.04 TLS.
And when i go (via the Proxmox GUI) to the Console, i see in this install there is ssh supported and i am able to login from an other machine in my network to this Ubuntu VM.

For HA in a Proxmox VM I used the script from @whiskerz007. Perhaps there is something missing in the VM created by the script from @whiskerz007.

https://gist.github.com/whiskerz007/53c6aa5d624154bacbbc54880e1e3b2a

Or it must be possible to add ssh support to an existing VM? But i have no idea how…

Or could it be that there is no ssh support in the qcow2 install? I have no idea…

EDIT. No there is nothing wrong with @whiskers007 script nor with the qcow2 install.
But i still can not get access with putty to the HA VM.
Trying to install the qcow2 install on an Debian or Ubuntu VM at which have already ssh access to.
Still searching for a solution…

EDIT. No there is nothing wrong with @whiskers007 script not with the qcow2 install.
But i still can not get access with putty to the HA VM.
Trying to install the qcow2 install on an Debian or Ubuntu VM at which have already ssh access to.
Still searching for a solution…

On proxmox you have a webinterface.
Clicking on console of the Hassio VM will give you a terminal to your hassio box :slight_smile:

Is that not useful or do you really want to use putty/terminal?

@Romkabouter Thank you for your reaction!
And yes i was aware of that, and i am using that for now. But i would like to access this VM hassos instance also via putty from any device in my network. Keep in mind, i am new to proxmox, so still learning.
I created two other VM’s (Ubuntu and Debian 10) and with these i am able to ssh into them. So i would like to do that with the hassos VM also. The same as i am used to with my RPi install.

I created a key-pair on my windows machine and placed the public key of that in the config of the Terminal & SSH configuration of the hass addon. Now if i open a putty session, i’l get a login screen. But as soon as i enter the login name i’l get a connection refused message.
So i think it has to do with the mutual authentication ,

But i do not know how is can f.i. configure the ssh daemon on the VM side (the qcow2 install).

On the VM side i can’t find where the ssh daemon could be configured:

I see no /etc/ssh or /etc/.ssh But when i search for sshd_config i find this:

Ok, then you must set the port to 22 in the configuration of the SSH addon.

Yes i know, and that was what i did. Otherwise i would never had the login prompt when i connect to the VM instance… No that is not the problem, it is on de VM itself.
With port 22 set and no ssh key in the addon conficuration i get this error message:

Next, I tried it with a public key in the addon configration (which i created on Win10).


But that geve me an other error message:

I think I found the sshd_config on the VM for hassos.

/mnt/data/supervisor/addons/core/ssh/rootfs/etc/ssh/sshd_config

The content of this sshd_config file is:

If this is the right file, i have to look how i can add the public key from my Windows 10 machine.

But this should actually not been nessecary. My both other VM’s (Debian and Ubuntu) permit ssh login without this configuration.
I think this is somehow configured in the QCOW2 image.
Maybe @whiskers007 knows how this is configured. He used this in his qcow2 install script.

Whow, i think i have got it.
Made the following configuration in de addon:

authorized_keys: []
password: '<user-password>'
server:
  tcp_forwarding: false
username: <username>
sftp: false
compatibility_mode: false
allow_agent_forwarding: false
allow_remote_port_forwarding: false
allow_tcp_forwarding: false
zsh: true
share_sessions: false
packages: []
init_commands:
  - ls -la

And no authentication (pub key) in putty. And i am in.


Thank you both @Romkabouter and @tom_l for your sugestions!

1 Like