vm(由libvirt创建)上的archlinux无法启动?

vm(由libvirt创建)上的archlinux无法启动?

有 vm0x01 的域 xml:

<domain type='kvm' id="1">
    <name>vm0x01</name>
    <uuid>4dea24b3-1d52-d8f3-2516-782e98a23fa1</uuid>
    <genid>915a7887-4603-42a1-b72c-95eb0a87761f</genid>
    <memory unit='MiB'>512</memory>
    <vcpu>1</vcpu>
    <os>
        <type arch='x86_64' machine='pc'>hvm</type>
        <bootmenu enable='yes' />
        <boot dev='cdrom' />
    </os>
    <cpu mode='host-model' />
    <clock offset='utc' />
    <devices>
        <emulator>/usr/bin/qemu-system-x86_64</emulator>
        <disk type='file' device='disk'>
            <driver name='qemu' type='qcow2' />
            <source file='/var/lib/libvirt/images/vm0x01.qcow2' />
            <target dev='vda' bus='virtio' />
        </disk>
        <disk type='file' device='cdrom'>
            <driver name='qemu' type='raw' />
            <source file="/var/lib/libvirt/images/archlinux-2023.08.01-x86_64.iso" />
            <target dev='hda' bus='sata' />
            <readonly />
        </disk>
        <interface type='bridge'>
            <source bridge='ovsbr1' />
            <virtualport type='openvswitch' />
            <mac address='52:54:00:9f:98:c9' />
        </interface>
        <graphics type='vnc' port='5900' autoport='yes' listen='10.10.10.3' />
        <video>
            <model type='qxl' vram='65536' heads='1' />
        </video>
        <rng model="virtio">
            <backend model="random">/dev/urandom</backend>
        </rng>
    </devices>
</domain>

和网络 xml:

<network>
    <name>ovs-nw0</name>
    <forward mode='bridge'/>
    <bridge name='ovsbr1'/>
    <virtualport type='openvswitch'/>
</network>

结果是ip addr

root@archlinux0x01 ~/develop/lang/rust/virtrunc
  # ip addr                                                                                                       
1: 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 noprefixroute
       valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master ovs-system state UP group default qlen 1000
    link/ether d0:17:c2:a7:83:e8 brd ff:ff:ff:ff:ff:ff
3: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether f6:80:83:fe:02:71 brd ff:ff:ff:ff:ff:ff
4: ovsbr1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether d0:17:c2:a7:83:e8 brd ff:ff:ff:ff:ff:ff
    inet 10.10.10.3/24 scope global ovsbr1
       valid_lft forever preferred_lft forever
5: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master ovs-system state UNKNOWN group default qlen 1000
    link/ether fe:54:00:9f:98:c9 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fe9f:98c9/64 scope link proto kernel_ll
       valid_lft forever preferred_lft forever

virsh net-list:

root@archlinux0x01 ~/develop/lang/rust/virtrunc
  # virsh net-list                                                                                                
 Name      State    Autostart   Persistent
--------------------------------------------
 ovs-nw0   active   yes         yes

virsh list:

root@archlinux0x01 ~/develop/lang/rust/virtrunc
  # virsh list                                                                                                    
 Id   Name     State
------------------------
 1    vm0x01   running

现在,我使用 vnc 客户端连接到 vm0x01。我首先选择的是: 在此输入图像描述 然后,得到的是: 在此输入图像描述 在此输入图像描述

帮助!这实在难倒我了。

答案1

我得到了它!将内存设置为2048MiB后,这个问题就消失了。我不知道最小内存阈值是多少。但看起来我给的内存较少使它不起作用。

相关内容