How to access vm inside a vm via VNC?

Posted by can. on Server Fault See other posts from Server Fault or by can.
Published on 2012-11-16T09:01:42Z Indexed on 2012/11/16 11:03 UTC
Read the original article Hit count: 196

For some reasons I installed virtual machines inside a virtual machine, like this:

A( B( C ))

where A is the physical machine, B is a vm and the network type is NAT. And C is also a virtual machine and the network type is bridged.

The OSes are Ubuntu 12.04 and the hypervisors are kvm.

I can access B via VNC and via ssh from A, but for C I can't use ssh because C has no IP address at the start. And I assume I can only access C via VNC.

I tried something like(on A):

iptables -t nat -A PREROUTING -d $ip-of-A -p tcp --dport 6500 -j DNAT --to-destination $ip-of-B:5900

(I referred to this)

But it doesn't work. And I'm reading the man pages of iptables and hope someone could help :)

© Server Fault or respective owner

Related posts about virtualization

Related posts about iptables