How to connect to guest vm(KVM) on remote host PC
up vote
0
down vote
favorite
I have dedicated server with ip.
I installed KVM, launched virtual machine(Centos), vm has internet connection(NAT), I installed and launched openssh server (22 port).
How can I connect to that VM via ssh?
Yes, i can connect to host pc via ssh, then from host pc connect to VM via ssh. But I want to connect to VM directly, without typing host PC password.
I think, i need forward ports? how to do that in right way?
P.S. host pc uses ppp0
ssh kvm virtualization
add a comment |
up vote
0
down vote
favorite
I have dedicated server with ip.
I installed KVM, launched virtual machine(Centos), vm has internet connection(NAT), I installed and launched openssh server (22 port).
How can I connect to that VM via ssh?
Yes, i can connect to host pc via ssh, then from host pc connect to VM via ssh. But I want to connect to VM directly, without typing host PC password.
I think, i need forward ports? how to do that in right way?
P.S. host pc uses ppp0
ssh kvm virtualization
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have dedicated server with ip.
I installed KVM, launched virtual machine(Centos), vm has internet connection(NAT), I installed and launched openssh server (22 port).
How can I connect to that VM via ssh?
Yes, i can connect to host pc via ssh, then from host pc connect to VM via ssh. But I want to connect to VM directly, without typing host PC password.
I think, i need forward ports? how to do that in right way?
P.S. host pc uses ppp0
ssh kvm virtualization
I have dedicated server with ip.
I installed KVM, launched virtual machine(Centos), vm has internet connection(NAT), I installed and launched openssh server (22 port).
How can I connect to that VM via ssh?
Yes, i can connect to host pc via ssh, then from host pc connect to VM via ssh. But I want to connect to VM directly, without typing host PC password.
I think, i need forward ports? how to do that in right way?
P.S. host pc uses ppp0
ssh kvm virtualization
ssh kvm virtualization
asked Sep 3 '16 at 11:09
Igor Kasuan
112
112
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
In my opinion, you need to set up a bridge on your host and assign IP(s) to your VM(s) in order to connect directly via ssh. Here is an example setup on this link (under title "Public Bridge"): http://www.linux-kvm.org/page/Networking
Thanks for reply. I have only 1 static ip for server. I can't understand how to differ 22 port of host pc and 22 port on VM at the same public IP. I want to have access <myPublicIp>:22 to my host server and allow access to VMs on other ports. for e.q.: <local VM1 address on host>:22 will be allowed on <myPublicIp>:2222 <local VM2 address on host>:22 will be allowed on <myPublicIp>:3333 etc.
– Igor Kasuan
Sep 3 '16 at 13:37
So you cannot get / assign IPs for your VMs, is that right?
– B. Turan
Sep 4 '16 at 7:24
yes, i have only 1 ip for my host pc; I solved that problem by transmitting input packets from my host's ports to internal VM's ports
– Igor Kasuan
Sep 5 '16 at 12:47
@IgorKasuan please post an answer with what you did to solve this (I'm guessing NAT rules with iptables?)
– Robert Riedl
Jan 20 at 10:11
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
In my opinion, you need to set up a bridge on your host and assign IP(s) to your VM(s) in order to connect directly via ssh. Here is an example setup on this link (under title "Public Bridge"): http://www.linux-kvm.org/page/Networking
Thanks for reply. I have only 1 static ip for server. I can't understand how to differ 22 port of host pc and 22 port on VM at the same public IP. I want to have access <myPublicIp>:22 to my host server and allow access to VMs on other ports. for e.q.: <local VM1 address on host>:22 will be allowed on <myPublicIp>:2222 <local VM2 address on host>:22 will be allowed on <myPublicIp>:3333 etc.
– Igor Kasuan
Sep 3 '16 at 13:37
So you cannot get / assign IPs for your VMs, is that right?
– B. Turan
Sep 4 '16 at 7:24
yes, i have only 1 ip for my host pc; I solved that problem by transmitting input packets from my host's ports to internal VM's ports
– Igor Kasuan
Sep 5 '16 at 12:47
@IgorKasuan please post an answer with what you did to solve this (I'm guessing NAT rules with iptables?)
– Robert Riedl
Jan 20 at 10:11
add a comment |
up vote
0
down vote
In my opinion, you need to set up a bridge on your host and assign IP(s) to your VM(s) in order to connect directly via ssh. Here is an example setup on this link (under title "Public Bridge"): http://www.linux-kvm.org/page/Networking
Thanks for reply. I have only 1 static ip for server. I can't understand how to differ 22 port of host pc and 22 port on VM at the same public IP. I want to have access <myPublicIp>:22 to my host server and allow access to VMs on other ports. for e.q.: <local VM1 address on host>:22 will be allowed on <myPublicIp>:2222 <local VM2 address on host>:22 will be allowed on <myPublicIp>:3333 etc.
– Igor Kasuan
Sep 3 '16 at 13:37
So you cannot get / assign IPs for your VMs, is that right?
– B. Turan
Sep 4 '16 at 7:24
yes, i have only 1 ip for my host pc; I solved that problem by transmitting input packets from my host's ports to internal VM's ports
– Igor Kasuan
Sep 5 '16 at 12:47
@IgorKasuan please post an answer with what you did to solve this (I'm guessing NAT rules with iptables?)
– Robert Riedl
Jan 20 at 10:11
add a comment |
up vote
0
down vote
up vote
0
down vote
In my opinion, you need to set up a bridge on your host and assign IP(s) to your VM(s) in order to connect directly via ssh. Here is an example setup on this link (under title "Public Bridge"): http://www.linux-kvm.org/page/Networking
In my opinion, you need to set up a bridge on your host and assign IP(s) to your VM(s) in order to connect directly via ssh. Here is an example setup on this link (under title "Public Bridge"): http://www.linux-kvm.org/page/Networking
answered Sep 3 '16 at 11:28
B. Turan
18714
18714
Thanks for reply. I have only 1 static ip for server. I can't understand how to differ 22 port of host pc and 22 port on VM at the same public IP. I want to have access <myPublicIp>:22 to my host server and allow access to VMs on other ports. for e.q.: <local VM1 address on host>:22 will be allowed on <myPublicIp>:2222 <local VM2 address on host>:22 will be allowed on <myPublicIp>:3333 etc.
– Igor Kasuan
Sep 3 '16 at 13:37
So you cannot get / assign IPs for your VMs, is that right?
– B. Turan
Sep 4 '16 at 7:24
yes, i have only 1 ip for my host pc; I solved that problem by transmitting input packets from my host's ports to internal VM's ports
– Igor Kasuan
Sep 5 '16 at 12:47
@IgorKasuan please post an answer with what you did to solve this (I'm guessing NAT rules with iptables?)
– Robert Riedl
Jan 20 at 10:11
add a comment |
Thanks for reply. I have only 1 static ip for server. I can't understand how to differ 22 port of host pc and 22 port on VM at the same public IP. I want to have access <myPublicIp>:22 to my host server and allow access to VMs on other ports. for e.q.: <local VM1 address on host>:22 will be allowed on <myPublicIp>:2222 <local VM2 address on host>:22 will be allowed on <myPublicIp>:3333 etc.
– Igor Kasuan
Sep 3 '16 at 13:37
So you cannot get / assign IPs for your VMs, is that right?
– B. Turan
Sep 4 '16 at 7:24
yes, i have only 1 ip for my host pc; I solved that problem by transmitting input packets from my host's ports to internal VM's ports
– Igor Kasuan
Sep 5 '16 at 12:47
@IgorKasuan please post an answer with what you did to solve this (I'm guessing NAT rules with iptables?)
– Robert Riedl
Jan 20 at 10:11
Thanks for reply. I have only 1 static ip for server. I can't understand how to differ 22 port of host pc and 22 port on VM at the same public IP. I want to have access <myPublicIp>:22 to my host server and allow access to VMs on other ports. for e.q.: <local VM1 address on host>:22 will be allowed on <myPublicIp>:2222 <local VM2 address on host>:22 will be allowed on <myPublicIp>:3333 etc.
– Igor Kasuan
Sep 3 '16 at 13:37
Thanks for reply. I have only 1 static ip for server. I can't understand how to differ 22 port of host pc and 22 port on VM at the same public IP. I want to have access <myPublicIp>:22 to my host server and allow access to VMs on other ports. for e.q.: <local VM1 address on host>:22 will be allowed on <myPublicIp>:2222 <local VM2 address on host>:22 will be allowed on <myPublicIp>:3333 etc.
– Igor Kasuan
Sep 3 '16 at 13:37
So you cannot get / assign IPs for your VMs, is that right?
– B. Turan
Sep 4 '16 at 7:24
So you cannot get / assign IPs for your VMs, is that right?
– B. Turan
Sep 4 '16 at 7:24
yes, i have only 1 ip for my host pc; I solved that problem by transmitting input packets from my host's ports to internal VM's ports
– Igor Kasuan
Sep 5 '16 at 12:47
yes, i have only 1 ip for my host pc; I solved that problem by transmitting input packets from my host's ports to internal VM's ports
– Igor Kasuan
Sep 5 '16 at 12:47
@IgorKasuan please post an answer with what you did to solve this (I'm guessing NAT rules with iptables?)
– Robert Riedl
Jan 20 at 10:11
@IgorKasuan please post an answer with what you did to solve this (I'm guessing NAT rules with iptables?)
– Robert Riedl
Jan 20 at 10:11
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f820401%2fhow-to-connect-to-guest-vmkvm-on-remote-host-pc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown