1

I am trying to connect to a virtual machine running on KVM hypervisor from a host machine (Ubuntu 14.04) through ssh, but it is giving me the following error:

ssh: connect to host 10.117.82.2 port 22: Connection refused

How can I enable ssh on the guest virtual machine? I've installed the virtual machine using virt-install. So, is there any provision in virt-install for enabling ssh?

3
  • You install and enable it the same as any other system. Sep 18, 2015 at 7:37
  • okay, but specifically is there any provision in the virt-install utility to enable ssh during virtual machine installation? Sep 18, 2015 at 7:46
  • 2
    virt-install just runs the operating system installer. It's up to you to preseed/kickstart that if you wish. Remember that Debian/Ubuntu do not install an ssh server by default. Sep 18, 2015 at 7:49

1 Answer 1

0

One straightforward way to apply the initial configurations such as SSH installation is to use VNC.

  1. Use the following command to get the list of VMs

sudo virsh list --all

  1. Open the XML config file:

sudo virsh edit YOUR_VM_NAME

  1. Append the following line before final :
<graphics type='vnc' port='-1' autoport='yes' listen='192.168.1.5' passwd='YOUR-PASSWORD-HERE' keymap='en-us'/>

where the listen address is the IP address of the server, not the guest OS

  1. Use a VNC client to connect to the guest OS

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .