I installed Linux Mint 17 on my Virtualbox, and I want to access files in it.
I installed openssh-client and openssh-server by the following command:
sudo apt-get install ssh
Then I tried ssh localhost by "ssh 127.0.0.1" and it shows the following:
Welcome to Linux Mint 17 Qiana (GNU/Linux 3.13.0-24-generic x86_64)
Welcome to Linux Mint
* Documentation: http://www.linuxmint.com
Last login: Fri Jun 27 13:18:53 2014 from localhost
I considered it as ssh successful from localhost. Then I tried to ssh from outside the Virtualbox.
I modified the network setting of the Linux virtual machine as follows:
The VM network card is appended to "NAT"
Port transfer set as "Rule1","TCP","","9023","10.0.2.15","22"
Note: The corresponding fields are "name", "protocol", "host IP", "host port", "client IP", "client port"
Then I tried to connect to the Mint OS from Windows by FileZilla:
Host: my host IP address
User Name: my user name
Password: my password
Port: 9023
and the console showed that:
Status: Connecting to x.x.x.x:9023..
Status: Connection established, waiting for Welcome message..
Error: Can't connect to server
Then I tried to use "putty" to connect, but the putty console didn't show anything.
It seems the Virtualbox port transfer mechanism didn't work (since I could ssh to localhost in my Mint machine so I don't think it's the problem of the ssh I installed.) The port transfer mechanism worked well with my Ubuntu machines. I don't know why it doesn't work for Linux Mint.
Can anyone give me a suggestion? Thank you in advance.
====================================================
Thank you so much guys! This problem was solved by updating my Virtualbox. Here are the two settings I ran successfully:
1) NAT
Append interface of my VM(10.0.2.15) to NAT, and set the port forwarding rule as following:
Port transfer set as "Rule1", "TCP", "", "9025", "10.0.2.15", "22"
Then I can ssh my VM (10.0.2.15) from outside Virtualbox by
open"putty" in Windows and set SSH connection with my PC's public IP and port 9025
2) NAT-Network
Create a NAT-Network:
CIDR: 10.0.3.0/24
Port transfer set as "Rule1", "TCP", "", "9023", "10.0.3.4", "22" and "Rule2", "TCP", "", "9024", "10.0.3.5", "22"
Then Append two virtual machines (guest OS) to NAT-Network (Their IPs are 10.0.3.4 and 10.0.3.5 respectively)
Now the two machines can ping each other successfully, and they can access each other by (taking 10.0.3.4 as an example)
ssh username@10.0.3.5
I can also ssh my VM (10.0.3.5) from outside Virtualbox by
open"putty" in Windows and set SSH connection with my PC's public IP and port 9024