How to connect to server through ssh with guest os ubuntu

Discussions about using Linux guests in VirtualBox.
Post Reply
Karan Shah
Posts: 11
Joined: 7. Jul 2014, 13:46

How to connect to server through ssh with guest os ubuntu

Post by Karan Shah »

Hi,

I have ubuntu 14.04 installed as a guest os in virtual box, with host os of windows 8.1

Now I want to connect to another IP (server) in ubuntu through 'ssh' command, but due to virtual box, I am not able to do it.

How to connect to another ubuntu machine in virtual box???

Note - I require my internet connectivity in ubuntu, while connecting to the server
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: How to connect to server through ssh with guest os ubunt

Post by noteirak »

You can configure your VM to use three modes :
- NAT: make sure no software or firewall rules block the Virtualbox process in the host, and that the network allows SSH in output in the guest
- NAT Network: same as NAT
- Bridged: Make sure that the network allows SSH in output in the guest
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Karan Shah
Posts: 11
Joined: 7. Jul 2014, 13:46

Re: How to connect to server through ssh with guest os ubunt

Post by Karan Shah »

Thanks a lot. Now i am able to use ssh to connect to another ip.

But when I tried to copy files from another system to my system through network, with the use of "scp" command, I got following error,
"ssh: connect to host 192.168.36.19 port 22: Connection timed out
lost connection"


Please help me to solve this, if possible.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: How to connect to server through ssh with guest os ubunt

Post by noteirak »

which network mode are you using?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Karan Shah
Posts: 11
Joined: 7. Jul 2014, 13:46

Re: How to connect to server through ssh with guest os ubunt

Post by Karan Shah »

I am using NAT mode.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: How to connect to server through ssh with guest os ubunt

Post by noteirak »

Make sure you forward the SSH port, open the port in the host, and use the host IP from your other system. More info into the User Manual.
Be aware that NAT mode is aimed to provide web access into the guest, and if you require a more advanced config (like port forwarding), you should look into Bridged mode.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Karan Shah
Posts: 11
Joined: 7. Jul 2014, 13:46

Re: How to connect to server through ssh with guest os ubunt

Post by Karan Shah »

In NAT mode also port forwarding settings can be done. But I don't know how??

Please can you guide me through that
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: How to connect to server through ssh with guest os ubunt

Post by noteirak »

Have you read the link I give you?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Karan Shah
Posts: 11
Joined: 7. Jul 2014, 13:46

Re: How to connect to server through ssh with guest os ubunt

Post by Karan Shah »

Yeah I read that article, but I need to check some things described in it.

So I will comment again when I check out all that stuff.

Is it fine??
Karan Shah
Posts: 11
Joined: 7. Jul 2014, 13:46

Re: How to connect to server through ssh with guest os ubunt

Post by Karan Shah »

Yeah I read that but could not find the solution as that person has done something which was not written over there.

But IPs are different for my windows host and ubuntu guest, so which IP should I use in scp cpmmand?
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: How to connect to server through ssh with guest os ubunt

Post by noteirak »

Any of your host IP and the host port you've configured in the port forwarding window.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Karan Shah
Posts: 11
Joined: 7. Jul 2014, 13:46

Re: How to connect to server through ssh with guest os ubunt

Post by Karan Shah »

Yeah, but I don't know anything about port forwarding in NAT mode.

Can u please guide me about that?
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: How to connect to server through ssh with guest os ubunt

Post by socratis »

You might have better luck if you read a tutorial about NAT and port forwarding. Start with the Simple English version of Wikipedia on NAT and port forwarding to understand the terminology. Wikipedia may also have an article in your native language. Continue with a simple tutorial like this one.

If you understand the basic idea and the terminology, THEN take a look at the Chapter 6 that noteirak has pointed you to. It should become obvious. You have to invest some time yourself in order to understand some basic concepts.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Karan Shah
Posts: 11
Joined: 7. Jul 2014, 13:46

Re: How to connect to server through ssh with guest os ubunt

Post by Karan Shah »

OK. I will try to understand this and do accordingly.
Post Reply