带有libvirt/svirt的启动QEMU KVM,但不使用命令行中的virt-andstall工具
任何人都可以帮助我如何使用libvirt/svirt启动qemu kvm,但不使用命令行中的virt-install工具。
或使用Virsh工具
Can anyone help me on how to boot QEMU KVM with libvirt/sVirt but without using virt-install tool in command line.
or using virsh tool
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了使用Virt-Antall,您需要安装以下内容:
然后,您可以启动守护程序:
现在,下载要安装的操作系统,然后将其复制到下面显示的文件夹:
最后,运行Virt-And-Astall。以下是脚本应该是什么样子的示例:
运行virt-install后,验证VM使用virsh运行:
virt-install-onstall命令行选项
以下是一些命令行选项,但是这不是一个广泛的列表,因此我鼓励您进行一些研究,以充分利用此工具。
其中一些命令具有主要选项以及子选项。例如,如果键入OS-Type = Linux,则需要进一步指定-os-variant = Centos7.0。您可以通过键入Osinfo-Query OS来获取Virt-Antall支持的OS列表。
这是您复制包含要安装的操作系统的ISO映像文件的地方。
CPU命令行选项使您可以指定分配给VM的VCPU的数量。在此示例中,我正在分配两个VCPU。
RAM命令行选项使您可以指定分配给VM的内存量。在此示例中,我分配了2,048 MB-或2 GB。
名称命令行选项使您可以为VM分配名称。在此示例中,我正在命名VM CentOS7。
这是将VM安装的地方,并以Gogabytes的形式分配大小。这必须是磁盘分区,而不是安装点。键入DF -H列出磁盘分区。
类型命令行使您可以选择要安装的VM类型。您可以使用KVM,QEMU,XEN或KQEMU。键入Virsh功能以列出所有选项。在此示例中,我正在使用QEMU。
使用网络=默认设置使用默认桥设备设置桥梁网络。这是最简单的方法,但是还有其他选择。
图形命令行选项指定不应创建图形VNC或SPICE接口。将其用于启动安装,或者如果要使用TTYS0串行连接。
In order to use virt-install, you need to install the following:
Then, you can start the daemon:
Now, download the OS you want to install, and then copy it to the folder shown below:
Finally, run virt-install. Here is an example of what the script should look like:
After running virt-install, verify that the VM is running using virsh:
Virt-install command-line options
Below are some command-line options, but this isn't an extensive list, so I encourage you to do some research in order to fully take advantage of this tool.
Some of these commands have main options, as well as sub options. For example, if you type os-type=linux, then you need to further specify --os-variant=centos7.0. You can get a list of OSes that virt-install supports by typing osinfo-query os.
This is where you've copied the ISO image file containing the OS you want to install.
The CPU command-line option enables you to specify the number of vCPUs assigned to the VM. In this example, I'm assigning two vCPUs.
The RAM command-line option enables you to specify the amount of memory assigned to the VM. In this example, I'm assigning 2,048 MBs -- or 2 GBs.
The name command-line option enables you to assign a name to the VM. In this example, I'm naming the VM centos7.
This is where the VM will be installed and the size, in gigabytes, to be allocated. This must be a disk partition and not a mount point. Type df -h to list disk partitions.
The type command-line enables you to choose the type of VM you want to install. You can use KVM, QEMU, Xen or KQEMU. Type virsh capabilities to list all of the options. In this example, I'm using QEMU.
Use network=default to set up bridge networking using the default bridge device. This is the easiest method, but there are other options.
The graphics command-line option specifies that no graphical VNC or SPICE interface should be created. Use this for a kickstart installation or if you want to use a ttyS0 serial connection.