How to connect to server through ssh with guest os ubuntu

Discussions about using Linux guests in VirtualBox.

How to connect to server through ssh with guest os ubuntu

Postby Karan Shah » 7. Jul 2014, 13:48

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
Karan Shah
 
Posts: 11
Joined: 7. Jul 2014, 13:46

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

Postby noteirak » 7. Jul 2014, 19:52

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://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

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

Postby Karan Shah » 8. Jul 2014, 08:38

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.
Karan Shah
 
Posts: 11
Joined: 7. Jul 2014, 13:46

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

Postby noteirak » 8. Jul 2014, 10:32

which network mode are you using?
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

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

Postby Karan Shah » 8. Jul 2014, 14:36

I am using NAT mode.
Karan Shah
 
Posts: 11
Joined: 7. Jul 2014, 13:46

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

Postby noteirak » 8. Jul 2014, 19:51

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://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

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

Postby Karan Shah » 8. Jul 2014, 20:16

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

Please can you guide me through that
Karan Shah
 
Posts: 11
Joined: 7. Jul 2014, 13:46

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

Postby noteirak » 10. Jul 2014, 00:00

Have you read the link I give you?
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

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

Postby Karan Shah » 11. Jul 2014, 16:42

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

Postby Karan Shah » 12. Jul 2014, 11:07

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?
Karan Shah
 
Posts: 11
Joined: 7. Jul 2014, 13:46

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

Postby noteirak » 12. Jul 2014, 15:47

Any of your host IP and the host port you've configured in the port forwarding window.
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5198
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

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

Postby Karan Shah » 12. Jul 2014, 17:20

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

Can u please guide me about that?
Karan Shah
 
Posts: 11
Joined: 7. Jul 2014, 13:46

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

Postby socratis » 12. Jul 2014, 19:07

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.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 25216
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

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

Postby Karan Shah » 12. Jul 2014, 19:48

OK. I will try to understand this and do accordingly.
Karan Shah
 
Posts: 11
Joined: 7. Jul 2014, 13:46


Return to Linux Guests

Who is online

Users browsing this forum: Google [Bot] and 20 guests