使用netterm连接linux虚拟机,实现了主机和虚拟机之间的通信即可以使用netterm连接虚拟机。
PS:要确定service xinetd start已经运行。
一、在linux虚拟机中启动telnet服务:
(1)编辑/etc/xinetd.d/telnet,将disable值改为no;
(2)激活服务,service xinetd restart;
(3)测试telnet服务,telnet ip(hostname);
(4)设置telnet端口,编辑/etc/services文件,找到telnet 23/tcp,telnet 23/udp,修改其为未使用的端口号;(可有可无)
(5)修改telnet中root用户不能登入问题:
因为telnet不安全,因此一般默认不允许root用户登入,若要允许,修改以下配置:
编辑/etc/pam.d/login文件
#auth required pam_security.so这一行注释掉或者是
mv /etc/securetty /etc/securetty.bak
二、使用host-only方式
1、更改虚拟机网络连接方式为host-only,并在主机真实网卡的属性的“高级”标签中设置其为共享,共享网卡为vmnet1.
2、更改虚拟机IP或者vmnet1 IP,使两者IP在同一个网段。
例如vmnet1 IP为192.168.0.10,虚拟机IP为192.168.0.100,子网掩码为255.255.255.0.
3、使用netterm访问虚拟机(前提当然是linux虚拟机是运行状态喽),在“文件”的“地址簿”中,设置你的虚拟机IP以及其telnet端口(前面所设定的端口号)即可顺利访问了。
三、使用bridge方式
1、设置linux虚拟机的IP,使其和主机真实的IP处于同一个网段,包括设置网关和DNS。
2、使用netterm访问虚拟机(前提当然是linux虚拟机是运行状态喽),在“文件”的“地址簿”中,设置你的虚拟机IP以及其telnet端口(前面所设定的端口号)即可顺利访问了。
四、使用nat方式
不用配置IP,直接使用上述netterm连接访问虚拟机方式即可。