# Can't connect to vm

**URL:** <https://forum.opennebula.io/t/cant-connect-to-vm/4795>\
**Category:** Product Support\
**Created:** [August 22, 2017, 2:58pm UTC](https://forum.opennebula.io/t/cant-connect-to-vm/4795 "2017-08-22T14:58:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmcornejocrespo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cmcornejocrespo/32/5308_2.png) [@cmcornejocrespo](https://forum.opennebula.io/u/cmcornejocrespo)\
**Post date:** [August 22, 2017, 2:58pm UTC](https://forum.opennebula.io/t/cant-connect-to-vm/4795/1 "2017-08-22T14:58:20Z")

</div>

Hi there,

I’m having issues while trying to connect to a newly created vm. The idea is to being able to ping the vm and after that setting up the ssh access via contextualization.

My setup is:

- **Opennebula 5.4**

- **Front and node Centos7**

- **brctl show(node)**  

- **onetemplate show 0**  
 ![image](https://yyz1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/4/45e6a9ebb0f64903596ff14b37c9c582d3f5f40a.png)

- **onevnet show 0**  

- **onevm show 0**  

- **onevm list**  

Any help would be appreciated!!

Many thanks,  
Carlos M.

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [August 22, 2017, 4:49pm UTC](https://forum.opennebula.io/t/cant-connect-to-vm/4795/2 "2017-08-22T16:49:40Z")

</div>

You can not ping the VM because it is in network 10.0.0.0/24 and I believe that virbr0 by default is 192.168.122.0/24.

---

<div class="post-metadata">

**Author:** ![cmcornejocrespo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cmcornejocrespo/32/5308_2.png) [@cmcornejocrespo](https://forum.opennebula.io/u/cmcornejocrespo)\
**Post date:** [August 23, 2017, 7:59am UTC](https://forum.opennebula.io/t/cant-connect-to-vm/4795/3 "2017-08-23T07:59:10Z")

</div>

Hi jfontan and thanks for your help.

I’ve changed the network settings accordingly to:  
**onevnet show 0**

 ![image](https://yyz1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/4/43882327b2638d78c979768652532ab43db6a5ea.png)

then create the vm as:  
**onevm create --name vm-test --cpu 2 --vcpu 2 --arch x86\_64 --memory 2048 --disk ‘Ubuntu 16.04’ --nic ‘private’ --ssh ~/.ssh/id\_rsa.pub --context NETWORK=YES**

then I check vm is running and config is all ok  
**onevm list**  
 ![image](https://yyz1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/1/1bbf57617b642496200d7d3a276bdf49591d24f1.png)  
**onevm show 4**

 ![image](https://yyz1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/0/0695f1309d3b74944e8a3c6ce2a371b96c4c82bb.png)  
 ![image](https://yyz1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/5/50bb673c22085d5b31efb1fdbbdbb7b746a5ccff.png)

Unfortunately I’m not still able to ping it or to access via ssh

Any tips guys?

Thanks,  
Carlos M.

---

<div class="post-metadata">

**Author:** ![atodorov\_storpool](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/atodorov_storpool/32/5327_2.png) [@atodorov\_storpool](https://forum.opennebula.io/u/atodorov_storpool)\
**Post date:** [August 24, 2017, 12:11pm UTC](https://forum.opennebula.io/t/cant-connect-to-vm/4795/4 "2017-08-24T12:11:50Z")

</div>

Hi Carlos,

From where you are trying to ping the VMs?

With this setup you should be able to ping and connect to them from the HV node on which they are running.

Best Regards,  
Anton Todorov

---

<div class="post-metadata">

**Author:** ![marcindulak](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@marcindulak](https://forum.opennebula.io/u/marcindulak)\
**Post date:** [August 24, 2017, 12:19pm UTC](https://forum.opennebula.io/t/cant-connect-to-vm/4795/5 "2017-08-24T12:19:14Z")

</div>

Accessing the instance over VNC usually helps to diagnose problems like unable to ping or unable to boot.

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [August 24, 2017, 2:23pm UTC](https://forum.opennebula.io/t/cant-connect-to-vm/4795/6 "2017-08-24T14:23:18Z")

</div>

As @marcindulak says the best approach will be accessing the VM with VNC. Also check the IP of virbr0 and try to ping/connect from the same node as @atodorov_storpool suggests. The bridge created by libvirt is not accesible from other nodes.

---

<div class="post-metadata">

**Author:** ![cmcornejocrespo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cmcornejocrespo/32/5308_2.png) [@cmcornejocrespo](https://forum.opennebula.io/u/cmcornejocrespo)\
**Post date:** [August 25, 2017, 7:16am UTC](https://forum.opennebula.io/t/cant-connect-to-vm/4795/7 "2017-08-25T07:16:42Z")

</div>

Hi @atodorov_storpool, @marcindulak and @jfontan.

Thanks for your help guys.

Will reply inline

— With this setup you should be able to ping and connect to them from the HV node on which they are running.  
Yes you are right, I can ping the newly created vm from within the HV node.

— Accessing the instance over VNC …  
I’ve provisioned the opennebula stack (front and node) within a private cluster. This implies that I have to ssh into a bastion in order to have access to the latter resources. At this point It’d a time consuming task to setup a tunnel or a NAT or a port forwarding to being able to VNC from outside the private cluster network. So the VNC option is discarded … sorry

— …The bridge created by libvirt is not accesible from other nodes.

**This image describes the topology layout and the network setup**  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/7/7661ba0dc89adcfce892f5d7d36bda7f31dc8a92.png)

![image](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/6/6c97e4ea6645468d3a9f888c4195bca1b324f1a2.png)

As I can ping/ssh now (from the HV node to the vm), the next step will be to being able to access the newly created vm from the proxy host. How can I make the bridge created by libvirt accesible from the proxy???

Many thanks guys!  
Carlos M.

---

<div class="post-metadata">

**Author:** ![cmcornejocrespo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cmcornejocrespo/32/5308_2.png) [@cmcornejocrespo](https://forum.opennebula.io/u/cmcornejocrespo)\
**Post date:** [September 20, 2017, 7:33am UTC](https://forum.opennebula.io/t/cant-connect-to-vm/4795/8 "2017-09-20T07:33:37Z")

</div>

Hi there,

I finally solved this issue by:

- Changing the topology of my network to:  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/f/f771fdeda2988e4e0ccc20e34bba4dd7316cb24d.png)
- Added a route from proxy to node as:  
ip route add 192.168.122.0/24 via 192.168.0.2 dev eth01
- Enable por forwarding in the node  
sysctl -w net.ipv4.ip\_forward=1
- Refreshing iptables as one installation adds reject rules to iptables  
iptables --flush  
 ![Pasted image at 2017_09_05 11_01 AM](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/7/7188f893df888e1a3fb4fefe0084a6552600d242.png)

Many thanks,  
Carlos M.
