app教程网 综合百科 ubuntu安装kvm虚拟机windows(ubuntu虚拟机安装vmware tools)

ubuntu安装kvm虚拟机windows(ubuntu虚拟机安装vmware tools)

这次在UBuntu12.04.2系统中安装了KVM,然后创建了一个虚拟机,新的问题出现了。

现象:

Ping不到虚拟机,ssh无法登录,console无法登录,虚拟机无法关机。电源管理似乎没有安装成功。

让我们先解决网络问题:

幸运的是,你可以通过virt-cat检查虚拟机内部的文件。

首先关闭虚拟机

Virsh destroy vm1然后检查网卡设置文件:

Root @ dbkvm: ~ # virt-cat-dvm1/etc/network/interfaces # This file describes the network interfaces # available on your system and how to activate them. For more information, see Interface (5). # Loopback network interface automatic loiface looinet loopback # Main network interface automatic eth0 interface eth0 inet static address 192. 168. 1. 51 network mask 255.255.0 network 192. 168. 1. 0 broadcast 192. 168. 1. 255 gateway 192.168.1.1# The dns-* option is implemented by the resolvconf package (if dns- name server 8.8.8 dnservers is installed, this DNS- searching local domain seems strange.

本地域在主机的/etc/hosts中配置为:

127 .0 .0 .1个本地主机。本地域dbk虚拟机将其换成这种配置:

127 . 0 . 0 . 1 localhost 127 . 0 . 1 . 1 db KVM再次创建虚拟机,网络正常。您可以在中ping或ssh。控制台问题和.

虚拟机中的网络设置dns-search被设置为defaultdomain。

所以推测是hosts文件的配置错误导致虚拟机中网卡设置的dns-search错误,导致无法连接网络,所以创建过程中无法从网络下载安装openssh-server。

让我们来看看电源管理

如果未安装电源管理,则无法通过关机来关闭主机上的虚拟机。

在创建虚拟机的选项中,您需要添加:

-添加pkg=acpid进行事后补,登录虚拟机,然后运行命令:

Apt-get install acpid会处理控制台无法登录的问题。

请先停止虚拟机。

Virsh stop vm1准备一个文件ttyS0.conf,内容如下:

# ttyS0.conf-getty# This service maintains a getty on ttyS0, starting from system # startup until it is shut down again. 2345] Rebirth to install the guessing fish program:

Apt-get installs guestfish. Now, copy the file to the voltmeter's /etc/initialization directory with virtual copy input:

virt-copy-in-dv m1 ttys 0 . conf/etc/init然后调用virsh edit vm1编辑vm1的配置文件,增加以下内容:

Device . serial type='pty' source path='/dev/pts/2 '/destination port='0'/serial console type='pty' tty='/dev/pts/2' source path='/dev/pts/2 '/destination port='0'/console.

快速启动域vm1启动了root @ dbk VM:~/KVM _ scripts # virsh控制台vm1连接到域vm1场景字符是^]ubuntu lts vm1 ttys 0 VM 1登录:根密码:上次登录:世界协调时2013年5月2日星期四09:21:03从192。168 .1 .pts/1上的4个欢迎使用Ubuntu 12。04 .2 lts(GNU/Linux 3。2 .0-41-虚拟x86可以了。

本文来自网络,不代表本站立场,转载请注明出处:https: