时间:2023-07-14 12:48:01 | 来源:网站运营
时间:2023-07-14 12:48:01 来源:网站运营
Linux 虚拟化-0002-创建虚拟机:# 1.使用 ssh 远程到 home 主机# ssh -Y root@home# 2.启动 virt-manager# virt-manager
# 1.从 home 主机测试 node1 主机连通性[root@home ~]# ping -c 1 node1PING node1 (192.168.1.101) 56(84) bytes of data.64 bytes from node1 (192.168.1.101): icmp_seq=1 ttl=64 time=0.264 ms--- node1 ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0msrtt min/avg/max/mdev = 0.264/0.264/0.264/0.000 ms# 2.从 home 主机远程登录 node1 虚机[root@home ~]# ssh node1The authenticity of host 'node1 (192.168.1.101)' can't be established.ECDSA key fingerprint is SHA256:UO3Pkm1MvkMHuvoCOFZWOoNsuoX+I0fqZFLdvORZyrc.ECDSA key fingerprint is MD5:fe:ff:07:66:43:14:1c:1d:6e:0e:ab:06:8c:6d:f6:16.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'node1,192.168.1.101' (ECDSA) to the list of known hosts.root@node1's password:Last login: Mon Oct 25 21:48:34 2021# 3.远程登录后查看 node1 主机地址[root@node101 ~]# ip a1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 52:54:00:5a:d2:12 brd ff:ff:ff:ff:ff:ff inet 192.168.1.101/24 brd 192.168.1.255 scope global noprefixroute eth0 valid_lft forever preferred_lft forever inet6 fe80::5323:5535:eaf0:b4ef/64 scope link noprefixroute valid_lft forever preferred_lft forever[root@node101 ~]#
# 4.从主机 home 查看虚拟 node1 的磁盘文件[root@home ~]# cd /data/sdb1/kvm/[root@home kvm]# lscentos7.192.168.1.101.qcow2[root@home kvm]# du -sh centos7.192.168.1.101.qcow22.0G centos7.192.168.1.101.qcow2[root@home kvm]#
# 5.使用 virsh 命令查看虚机[root@home kvm]# virsh list --all Id 名称 状态---------------------------------------------------- 2 centos7.192.168.1.101 running[root@home kvm]#
后续详细讲解命令行下的使用关键词:虚拟,创建