This article was sponsored by Xiuyi linfeng and first launched in the dark world.
KVM Virtualization has been studied for some time. Now there are a lot of virtualization software, compared to the current use of VMware vsphere. Vsphere can view the IP address of the VM without entering the VM system ,. As follows:
At the same time, you will also find that vsphere can only view the vm ip address, but not other information. To view the information, you can only log on to the VM system. To view the vm ip address, we also need to install the vmtools package in the VM system.
Of course, we can also use descriptions to view the status of virtual machines. As follows:
In this case, we can compare the VM in KVM and find that KVM cannot view the vm ip address through the vsphere method.
Is KVM not supported?
Incorrect. KVM is also supported. KVM is simpler than vsphere. You only need to add a line of commands in the XML configuration file of the VM to install any software packages.
The specific operation is as follows. log on to KVM and find a VM. As follows:
SSH [email protected]
Modify the xml configuration of the kvm vm Vm and add the <title> parameter. In this parameter, you can customize VM information, including vm ip address and hostname. The procedure is as follows:
Virsh edit XP
Save the VM configuration file and start the VM as follows:
Virsh start XP
Then useVirsh list-titleCommand to view, as follows:
We can easily see that the IP address of the Virtual Machine XP is 192.168.1.202. This is the same as the <title> parameter we entered in the preceding configuration file.
In this way, you can view the IP address of the VM when the VM is running.
<Title>The parameter is not in the virt-install command, but in the virsh command, we can view it through man virsh.As follows:
Note that the above test shows information about the VM when the VM is running. What if the VM is not running?
How can I view the VM IP address?
You can also use the <description> parameter to add related descriptions. As follows:
Virsh edit win7
Then useVirsh DESC win7Command to view, as follows:
We can easily see that the current Virtual Machine win7 is closed, but we can see that the IP address of win7 is 192.168.1.201. This is the same as the <description> parameter we entered in the preceding VM configuration file.
Note: The <description> parameter is supported by the virt-install command, but not virsh. You can use man virt-install to view the <description> parameter usage.:
The virt-install command supports the <description> parameter, which means you can add the description about the VM when installing the VM. Run the following command:
Virt-install-N win7-r 2048 -- vcpus = 1 -- OS-type = Windows-l http: // 192.168.1.102/g71_x64_ie10_v5.2.iso-F/dev/vg1/win7 -- Bridge = br0-M 00: 16: 3E: 12: D7: 5D -- VNC -- vnclisten = 0.0.0.0 -- vncport = 5999-- Description "192.168.1.201 _ win7_20140926"-X "-- device = eth0 IP = 192.168.1.220 netmask = 255.255.255.0 gateway = 192.168.1.1"
Note that the preceding command is also quite interesting. For example, I only have one server on the network, and this server currently only has one web application, the system's image files are stored on this server. I now require that no other software or other configurations be installed on this server. How to allow other KVM servers in the network to install the system over the network using this image file.
The above command can meet the requirements.
ROTTEN: enables KVM to display the vm ip address and Host Name