Find the answer to your Linux question:
Results 1 to 9 of 9
Hello, I would really appreciate if somebody could answer this one. So, I have successfully created a virtual machine using <a href="https://help.ubuntu.com/community/KVM" target="_blank">this guide. Only problem is that I haven't ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    5

    Can't connect to kvm virtual machine


    Hello,

    I would really appreciate if somebody could answer this one.

    So, I have successfully created a virtual machine using <a href="https://help.ubuntu.com/community/KVM" target="_blank">this guide.
    Only problem is that I haven't been able to connect the virtual machine in any way. It has definitely started as I can ping to the ip address which I've assigned for it.

    I created a VM called hostnameformyvm3 using
    Code:
    ubuntu-vm-builder kvm hardy --domain newvm3 --dest newvm3 --arch i386 --hostname hostnameformyvm3 --mem 256 --user user --pass pass --ip 192.168.1.49 --addpkg acpid vim openssh-server --libvirt qemu:///system
    This should've made possible to connect via ssh, right? When I do nmap to the ip it says that all ports are closed.
    It's starting to be really frustrating that I can't connect to it any way. Could someone help me, please.
    Edit: when I start the VM syslog says only:
    Code:
    Jan &nbsp;6 15:47:52 ubuntuserver kernel: [ 3087.572787] device vnet0 entered promiscuous mode<br />
    Jan &nbsp;6 15:47:52 ubuntuserver kernel: [ 3087.573773] br0: port 2(vnet0) entering forwarding state<br />
    Jan &nbsp;6 15:48:02 ubuntuserver kernel: [ 3097.897014] vnet0: no IPv6 routers present
    My /etc/libvirt/qemu/hostnameformyvm3.xml
    Code:
    <domain type='kvm'>
      <name>hostnameformyvm3</name>
      <uuid>2f7728c4-85e9-f9f0-b1e9-7ca56d458a4e</uuid>
      <memory>262144</memory>
      <currentMemory>262144</currentMemory>
      <vcpu>1</vcpu>
      <os>
        <type arch='i686' machine='pc-0.12'>hvm</type>
        <boot dev='hd'/>
      </os>
      <features>
        <acpi/>
      </features>
      <clock offset='utc'/>
      <on_poweroff>destroy</on_poweroff>
      <on_reboot>restart</on_reboot>
      <on_crash>destroy</on_crash>
      <devices>
        <emulator>/usr/bin/kvm</emulator>
        <disk type='file' device='disk'>
          <driver name='qemu' type='qcow2'/>
          <source file='/etc/libvirt/qemu/newvm3/tmpwYBA2i.qcow2'/>
          <target dev='hda' bus='ide'/>
        </disk>
        <interface type='bridge'>
          <mac address='52:54:00:31:fb:cf'/>
          <source bridge='br0'/>
          <model type='virtio'/>
        </interface>
        <input type='mouse' bus='ps2'/>
        <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'/>
        <video>
          <model type='cirrus' vram='9216' heads='1'/>
        </video>
      </devices>
    </domain>
    I'm running Ubuntu server 10.04. Is there any other way to connect to it.

    I would seriously appreciate if someone could find a solution

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Has the SSHD been started on the guest host?

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Jan 2011
    Posts
    5
    Thank you for answering Lazydog,

    I think that could be the problem too, but I don't know how to check it. How do I check whether it has started or not.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Form the CLI:

    Code:
    ps -e | grep sshd
    If sshd is running then you will get something back. If it is not running then you will get nothing.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  6. #5
    Just Joined!
    Join Date
    Jan 2011
    Posts
    5
    Quote Originally Posted by Lazydog View Post
    Form the CLI:

    Code:
    ps -e | grep sshd
    If sshd is running then you will get something back. If it is not running then you will get nothing.
    Yes, sshd is running on host and i can connect to the host fine, but i can't connect to the virtual machine/any virtual machines (tried installing several). Is there way to check if sshd is running on the virtual machine?

  7. #6
    Just Joined!
    Join Date
    Jan 2011
    Posts
    5
    How do I access the virtual machine?

  8. #7
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    That command you run on the VM not the host machine.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  9. #8
    Just Joined!
    Join Date
    Jan 2011
    Posts
    5
    Okay, this maybe a stupid question, but how do I run the command on the vm when I can't/don't know how to access the command line of the vm?

  10. #9
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Is the VM on your machine or a remote machine?

    If local then run virt-manager. There you can open the VM and be at the CLI or GUI of the VM.

    Another question is if it is local are you running a bride on your interface so this VM can connect to the internet?

    If it is remote then you are going to have to have someone there look and see if SSH is running and the firewall isn't blocking it.

    Sorry I assumed that you would know how to log onto the VM locally if you set it up.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •