w1w 发表于 2015-10-12 12:15:50

centos in virtualbox (nat 模式) 实现 ssh

近来,想在linux系统下装个oracle学学。但是虚拟机和物理机不能通讯,郁闷,找到这篇文章后可以了。
我的环境是:

Host OS : Windows xp sp3
Guest OS : CentOS 6.3
Virtual Machine : VirtualBox 4.2.6

Connection Type: Nat

转载文章如下:


首先看这里:
Network Address Translation (NAT)
http://www.virtualbox.org/manual/ch06.html


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

Host OS : Windows 7
Guest OS : CentOS 5.7
Virtual Machine : VirtualBox 4.1.2

Connection Type: Nat

--------------------------------------------------------------------
只是简单实现,其他的细化的东西碰到再扩展, 支持开源软件,实现如下:
进入 GuestOS :
#/sbin/ifconfig
查看 inet addr : 10.0.2.15

然后到 HostOS 去, 看控制面板, 看网络和共享中心的VirtualBox Host-Only Network 的
ipv4 属性的ip 地址:192.168.56.1


准备够了, 下面果断配置:
提示一下 : ssh 的默认端口是 22

打开virtualbox 的设置窗口 -〉网络-〉 Adapter1 启用 网络连接-〉连接方式:Nat -> 接入网线->
Port Forwarding , 设置如下:




把 TCP 协议的   192.168.56.1:2222 映射到10.0.2.15:22.

OK , 重启, 打开putty。
session-> host name(or ip address) 192.168.56.1; port: 2222-> open


->登陆成功。


转自:http://blog.iyunv.com/qzier_go/article/details/6875831
页: [1]
查看完整版本: centos in virtualbox (nat 模式) 实现 ssh