KVM fault debugging experience

Source: Internet
Author: User
Tags to domain

KVM fault debugging experience this time in UBuntu12.04.2 system to install KVM, and then create a virtual machine, there are new problems. Phenomenon: the virtual machine cannot be pinged, the ssh Login fails, the console login fails, and the virtual machine cannot be shutdown. It seems that the power management has not been installed successfully. Solve the network problem first: You can use virt-cat to check files in the virtual machine. First shut down the Virtual Machine [plain] virsh destroy vm1 and then check the NIC setting file: [plain] root @ dbkvm :~ # Virt-cat-d vm1/etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. for more information, see interfaces (5 ). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.1.51 netmask implements 255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gate Way 192.168.1.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 8.8.8.8 dns-search localdomain this dns-search localdomain looks strange. It is generally defadomain domain. localdomain is because [plain] 127.0.0.1 localhost is configured in/etc/hosts of the host machine. replace localdomain dbkvm with this configuration: [plain] 127.0.0.1 localhost 127.0.1.1 dbkvm and then create a VM. The network is normal. Can be pinged, and can be logged on through ssh. The console still has problems. The network settings dns-search in the virtual machine is set to defaultdomain. therefore, it is assumed that the hosts file configuration is incorrect, resulting in a dns-search error set by the NIC in the virtual machine, resulting in a network connection failure. Therefore, you cannot download and install openssh-server from the network during the creation process. if power management is not installed, the VM cannot be shut down on the host through shutdown. In the vm creation option, you must add [plain] -- addpkg = acpid to log on to the vm and run the following command: [plain] apt-get install acpid and then handle the problem that the console cannot be logged on. Stop the VM first. [Plain] Prepare a file ttyS0.conf for virsh stop vm1. The content is as follows: [plain] # ttyS0.conf-getty # This service maintains a getty on ttyS0 from the point the system is # started until it is shut down again. start on stopped rc RUNLEVEL = [2345] stop on runlevel [! 2345] respawn install the guestfish program [plain] apt-get install guestfish now uses virt-copy-in to copy files to the/etc/init directory of the vm: [plain] virt-copy-in-d vm1 ttyS0.conf/etc/init and then call virsh edit vm1 to edit the vm1 configuration file and add the following content: [html] <devices>... <serial type = 'PTY'> <source path = '/dev/pts/2'/> <target port = '0'/> </serial> <console type =' pty 'tty = '/dev/pts/2'> <source path ='/dev/pts/2'/> <target port = '0'/> </console> </devices> try it out: [pl Ain] virsh start vm1 Domain vm1 started root @ dbkvm :~ /Kvm_scripts # virsh console vm1 Connected to domain vm1 Escape character is ^] Ubuntu 12.04.2 LTS vm1 ttyS0 vm1 login: root Password: Last login: thu May 2 09:21:03 UTC 2013 from 192.168.1.4 on pts/1 Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-41-virtual x86_64. The root cause of all problems lies in the/etc/hosts configuration on the incorrect host machine.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.