Enabling Host SSH *in virtual machine*

Hi,
My Home Assistant OS install is in a qemu VM. I’d like to enable SSH to the host as my other access is via a slightly fragile serial console.

Yes, I know about Debugging the Home Assistant Operating System | Home Assistant Developer Docs

No, it’s not simple to “plug a USB drive” into the VM.

What’s ha os import doing behind the scenes?

Edit:

From serial terminal (VM console):

cat > /root/.ssh/authorized_keys
#(enter key, ctrl+D)
systemctl start dropbear

Via looking at the ConditionFileNotEmpty setting here:

1 Like

Since your VM “console” works…
A trick I have used is to take the “authorized_keys” file that one can generate off-line and copy it into say HA’s “share” folder. From the VM Console (HAOS shell) you can get to the “share” folder at /mnt/data/supervisor/share/. So just copy authorized_keys file into /root/.ssh/authorized_keys

1 Like

Thanks Tommy. My edit works as well, the key piece is that dropbear won’t start until authorized_keys is in place.