Debian

Virtual Machine Manager - 自動執行重複啟動步驟

  • May 20, 2022

每次啟動 Virtual Machine Manager 時,我都必須先執行此命令,然後才能成功執行任何虛擬機:

sudo virsh net-start default

在 Debian 11 桌面上,如何配置 Virtual Machine Manager 以便僅通過啟動應用程序來完成?

您需要告訴 libvirt,當 libvirtd 啟動時,“預設”網路應該會自動啟動。

sudo virsh net-autostart default

如果“default”尚未啟動,您仍然需要最後一次手動啟動它,但下次重新啟動時,“default”將與 libvirtd 一起自動啟動。

僅供參考,virsh具有內置幫助,例如:

# virsh help network
Networking (help keyword 'network'):
   net-autostart                  autostart a network
   net-create                     create a network from an XML file
   net-define                     define an inactive persistent virtual network or modify an existing persistent one from an XML file
   net-destroy                    destroy (stop) a network
   net-dhcp-leases                print lease info for a given network
   net-dumpxml                    network information in XML
   net-edit                       edit XML configuration for a network
   net-event                      Network Events
   net-info                       network information
   net-list                       list networks
   net-name                       convert a network UUID to network name
   net-start                      start a (previously defined) inactive network
   net-undefine                   undefine a persistent network
   net-update                     update parts of an existing network's configuration
   net-uuid                       convert a network name to network UUID
   net-port-list                  list network ports
   net-port-create                create a network port from an XML file
   net-port-dumpxml               network port information in XML
   net-port-delete                delete the specified network port

# virsh help net-autostart
 NAME
   net-autostart - autostart a network

 SYNOPSIS
   net-autostart <network> [--disable]

 DESCRIPTION
   Configure a network to be automatically started at boot.

 OPTIONS
   [--network] <string>  network name or uuid
   --disable        disable autostarting

引用自:https://unix.stackexchange.com/questions/703182