Use Remote Tools under Windows to log on to Linux on a virtual machine, access services on a virtual machine, port forwarding, Win7 telnet to a virtual machine

Source: Internet
Author: User
Tags learn php ssh secure shell

The first thing you need to know about virtual box is how to set port forwarding:

An article:

How to use VirtualBox for port forwarding

Because the default approach is to use NAT for virtual machine networking , it can be annoying if you want to access virtual machine applications from outside the network . Used to bridge the way, but the IP is limited, its own designated IP may conflict with the LAN IP, and the IP obtained by DHCP may change lead to uncertainty, how to do? On the Internet, a simple and effective solution is to use the VirtualBox "Port mapping" function.
Here are some examples to talk about how to do:

scenario: to have the virtual machine's Web 80 port accessible from outside.

1. First of all to know the virtual Machine network card "Big" IP, think of network card to see the Internet Sharing Center.

Look at the properties of VirtualBox host-only Network, see the IP assigned to it is 192.168.56.1, remember this address.
Open cmd window ping 192.168.56.1 see can ping through

2. Configure Port forwarding, open the virtual machine, select the virtual machine you want to access, point to "settings"-"Network"

Point "Port Forwarding", add Web80 items, see no host , IP filled in is 192.168.56.1, subsystem IP needs to be viewed in the virtual machine's system through commands such as Linux using Ifconfig view.


Need to explain that the host port can be inconsistent with the subsystem port, such as the MySQL for example, if the host port is configured to 6033, then the MySQL database address from the extranet to access the virtual machine is 192.168.56.1, the port is 6033, The virtual opportunity is automatically forwarded to the 3306 port in the subsystem (the default port for MySQL), so that the application port of the protection subsystem is not directly exposed to the outside.

Another digression, even when MySQL, although the creation of the MySQL account is allowed outside the connection, but still not connected, this time into the /etc/mysql/my.cnf file for editing. Comment out # bind-address = 127.0.0.1
Then restart MySQL so you can connect from the outside .

--------------------------------------

Use Remote Tools under Windows to log on to Linux on a virtual machine, access services on a virtual machine

First, Virtualbox,nat network (just a beginner experiment, recommended to use the back of the bridged bridge)

Plan to learn PHP, but the computer is a Mac, do not want to install three systems, so want to access the virtual machine in the Linux to complete the environment to build and run. Anyway, also use command line learning, then through putty, SSH secure Shell, secure shell (chrome plug-in, recommended) and other remote tools to access the line, the following start.

System is win7, virtual machine is VirtualBox (free open source, very useful). (1) First look at your own ip,windows under the IP (my is 169.254.116.47), look at the virtual machine's external network ip:169.254.132.135 (from the connection VirtualBox host-only Network), the virtual machine, The ip:10.0.2.15 of the Linux eth0 NIC.
(2) Set the parameters of the VirtualBox: settings, network--, connection: set to network address translation (NAT), and then set up port forwarding, specific parameters such as: (Host port is a random set of parameters, virtual machine a bit like Intranet) (3) Ping each other, If you can ping the pass, the setting is OK. (4) With the tool access, here directly under the chrome plug-in secure shell, the other tools are basically similar, the login name is set, Access IP for Windows view under the VirtualBox connection IP, the port number is set 2222, it seems, is a bit like the structure of the extranet intranet.
Here is the end, there is a lot to continue to study ah ... ================================================== Split Line installed on the CentOS virtual machine phpmyadmin, want to access under Win7, very simple, according to the previous method, add forwarding rules, Here add rule2:8000 is an externally assigned port, the subsystem port 80 is the Apache service port, so win7 in the access link is: http://169.254.132.135:8000/phpMyAdmin/, is actually access to Linux under: http://10.0.2.15:80/phpMyAdmin/. To access other services, the method is the same, so simple:) My own configuration: reference: http://blog.sina.com.cn/s/blog_4438ac090101gx8p.htmlhttp://www.linuxidc.com/ linux/2014-04/100450.htm--------------------------------------------------Win7 telnet to the virtual machine, first read an article:

Ubuntu Telnet configuration (openbsd-inetd)

Configure the lower port forwarding: (telnet default port is 23)

Then cmd under Telnet 192.168.56.1 display:

Display as on landing successful.

Use Remote Tools under Windows to log on to Linux on a virtual machine, access services on a virtual machine, port forwarding, Win7 telnet to a virtual machine

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.