我曾经使用KVM虚拟化,现在已经回到它,但我有一个问题。
当我用virt-install来安装guest虚拟机时,我曾经使用-x“extra args”部分为安装和guest虚拟机设置控制台,但不再有效。
这里是我使用的命令:
virt-install -n server01 -r 512 --os-variant=virtio26 -c /isos/c5u5.iso --nographics --noautoconsole -f /storage/vm/server01 -s 5 bus=virtio -w bridge:br0 -x "console=ttyS0 ks=http://www.domain.com/c5u5.cfg"
正如你可以看到即时将控制台设置为ttyS0,但是当我去连接到控制台:
virsh console server01
它要么不会连接或想出来:错误:无法获得本地主机名
这里是xml的转储,但是也没有提到ttyS0。
<domain type='qemu' id='5'> <name>server01</name> <uuid>5991cf85-db6c-2b87-b76d-07a0caae77b9</uuid> <memory>524288</memory> <currentMemory>524288</currentMemory> <vcpu>1</vcpu> <os> <type arch='x86_64' machine='rhel5.4.0'>hvm</type> <boot dev='cdrom'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>destroy</on_reboot> <on_crash>destroy</on_crash> <devices> <emulator>/usr/libexec/qemu-kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' cache='none'/> <source file='/storage/vm/server01'/> <target dev='hda' bus='ide'/> </disk> <disk type='file' device='cdrom'> <source file='/isos/c5u5.iso'/> <target dev='hdc' bus='ide'/> <readonly/> </disk> <interface type='bridge'> <mac address='54:52:00:61:ea:78'/> <source bridge='br0'/> <target dev='vnet0'/> </interface> <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> </domain>
任何人都可以摆脱任何光线,因为我完全卡住了。
检查串行控制台是否在guest虚拟机内被初始化。 Ubuntu似乎已经从服务器发行版中删除了这个(默认情况下),所以没有ttyS0出现(即使有)。
libvirtd正在运行。 如果不是,virsh将无法连接。
检查/ var / log / libvirt中的日志以获取其他线索。