一 删除所有虚拟机
二 构建新的实验环境
1.真机创建两台虚拟机操作系统为RHEL7.4
[root@room9pc01 ~]# clone-vm7
Enter VM number: 7
Creating Virtual Machine disk image...... [OK]
Defining new virtual machine...... [OK]
[root@room9pc01 ~]# clone-vm7
Enter VM number: 8
Creating Virtual Machine disk image...... [OK]
Defining new virtual machine...... [OK]
[root@room9pc01 ~]# clone-vm7
Enter VM number: 7
File exists. #文件已存在
2.虚拟机A与虚拟机B的配置
真机:虚拟机快速连接(不需要有IP地址)
[root@room9pc01 ~]# virsh console 虚拟机名字
[root@room9pc01 ~]# virsh console A #真机直接连接虚拟机A
连接到域 A
换码符为 ^]
Red Hat Enterprise Linux Server 7.4 (Maipo)
Kernel 3.10.0-693.el7.x86_64 on an x86_64
localhost login: root
密码: #输入密码123456
[root@localhost ~]#
ctrl + ] = 回到真机
真机名字:room9pc01.tedu.cn
虚拟机A:
1.配置主机名:svr7.tedu.cn
[root@localhost ~]# echo svr7.tedu.cn > /etc/hostname
[root@localhost ~]# cat /etc/hostname
[root@localhost ~]# hostname svr7.tedu.cn
[root@localhost ~]# hostname
[root@localhost ~]# exit
2.配置eth0网卡IP地址:192.168.4.7/24
]# nmcli connection modify 'eth0'
ipv4.method manual ipv4.addresses 192.168.4.7/24
connection.autoconnect yes
]# nmcli connection up eth0 #激活配置
]# ifconfig | head -2
虚拟机B:
1.永久配置主机名:pc207.tedu.cn
2.永久配置eth0网卡IP地址:192.168.4.207/24
[root@room9pc01 ~]# virsh console B #连接虚拟机B
3.真机进行远程管理两台虚拟机
1)真机可以与两台虚拟机ping通
[root@room9pc01 ~]# ping 192.168.4.7
[root@room9pc01 ~]# ping 192.168.4.207
2)真机利用ssh进行远程管理
[root@room9pc01 ~]# vim /root/.bashrc
alias goa='ssh -X [email protected]'
alias gob='ssh -X [email protected]'
开启一个新的终端,进行验证
[root@room9pc01 ~]#