Virt install os variant list не работает

Проблема с virt-install

ОС хоста — gentoo, ОС гостя — centos7. Со стабильными версиями libvirt, qemu, virt-manager пробовал, там то же самое. Ещё неделю назад эта же команда установки отлично работала.

При этом в man virt-install сказано:

osinfo-query os ничего не выводит.

можно, конечно, поставить —os-variant=auto, но всё равно ругается, что

В чем может быть проблема?

Попробуй, как рекомендует man virt-install, команду

Distro ‘list’ does not exist in our dictionary

Но вообще я пытался что-то такое предпринять, ничего в списке нет.

Вот ещё симптом: при начале автоматической установки говорит:

может быть я бы и поверил, если бы vda не существовал и если бы этот же скрипт установки не использовался бы до этого 100500 раз.

Откатывал всё, в том числе и ядро до версии 4.8.11, всё то же самое.

WARNING No operating system detected, VM performance may suffer. Specify an OS with —os-variant for optimal results.

Это сообщение из скрипта на python. О том, что скрипт не знает про os-variant == rhel7

В моём debian список os-variant явно задан в файле /usr/share/virt-manager/virtinst/osdict.py из пакета virtinstall

Попробуй переустановить ( или как там в генте — пересобрать? ) этот пакет. Кстати, версия python соответствует требованиям virtinstall ?

это, скорее всего, версия с использованием libosinfo. а у них нет определения для rhel7, только для rhel-7.0, rhel-7.1 и т.д. попробуй скормить ему полные имена. там должны быть установлены xml-ки для каждого вида осей.

это, скорее всего, версия с использованием libosinfo

ура, это было оно! спасибо!

Раньше была версия 1.0.0, откатился на 0.3.1, и всё заработало. В /usr/share/libosinfo нашел подобные вещи (rhel-7.0), попробовал, но оно их не заработало. А просто rhel7 заработал. и, кстати, диск снова называется vda.

Кстати, версия python соответствует требованиям virtinstall ?

нет ) Python 3.5.2 был в тот момент. А virt-manager говорит, что он Build with Python 2.7 . Ну тогда я включил пистон 2.7, обратно поставил 1.0.0, пересобрал virt-manager на всякий случай, но оно опять сломалось (в смысле возникла первичная проблема). Что и требовалось доказать )

попробуй, может, варианты типа rhel7.1 заработают. мало ли какой у них там хитрожопый синтаксис.

Источник

15 virt-install examples | KVM virtualization commands cheatsheet

Table of Contents

In this article I will share a list of commands to create KVM Virtual machine command line using virt-install examples in RHEL/CentOS 8 Linux.

virt-install is a command line tool for creating new KVM, Xen, or Linux container guests using the libvirt hypervisor management library
The virt-install tool provides a number of options that can be passed on the command line. To see a complete list of options run the following command:

Pre-requisite

As a pre-requisite, you must first install KVM and enable KVM Virtualization on your Linux server host before you can create KVM Virtual Machine using virt-install or any other method in RHEL/CentOS 8 Linux

Читайте также:  Как настроить принтер hp ink tank wireless 415 для печати

1. virt-install ­­­­—name

To define a name of the VM use —name with virt-install command

2. virt-install —vcpus

To define CPU for the VM use —vcpus with virt-install command

3. virt-install —memory

To define memory for the VM use —memory with virt-install command

4. virt-install —os-type and —os-variant

You can define OS Variant and OS Type when you create VM with virt-install command
Next use —os-variant and —os-type to define the OS Variant and OS Type respectively

To get the list of supported OS Variant types, execute below command from the terminal

In the below virt-install example cheat sheet I have defined —os-type as Linux and —os-variant as Centos7.0

5. virt-install —network

To check list of available networks use virsh command

In the below virt-install example cheat sheet we will create KVM VM and assign this default network for our Virtual Machine

6. virt-install example with multiple networks

You can use —network argument multiple times to add multiple network cards to the VM
In this virt-install example cheat sheet I am creating KVM VM with one network using bridge connection and other network using default network

7. virt-install —location

  • Below virt-install example uses —location argument to define the path of the ISO which will be used to create KVM Virtual Machine.
  • In this command we have not defined any —graphics
  • So the problem with this command would be that you will connect to the new VM using serial console but since console is not defined you will end up with no STDOUT
  • In such case your virt-install will be stuck at » Escape character is ^] » prompt

Also if you try to connect to your VM using virsh or Virtual Manager, you will get the same output

Hence this combination is not recommended to create KVM Virtual Machine

8. virt-install console ttyS0 (—extra-args)

  • Now in the earlier virt-install example, we used —location to define the ISO with —graphics=none
  • Due to this combination we ended up with a serial console connection with no graphical access
  • You can combine —location with —extra-args to define additional kernel arguments which will be considered for installation
  • Use —extra-args console=ttyS0 to redirect the STDOUT on your terminal window
  • The problem with this command would be that you will again connect to the new VM using serial console
  • So if you have to select custom options to perform the installation, using serial console it may be difficult for you
  • For normal use case where we need graphical console to perform the installation, do not use this command

use Ctrl+5 to exit the session

To reconnect to the session use below command

You can choose to use this command based on your requirement.

9. virt-install —noautoconsole

  • Don’t automatically try to connect to the guest console.
  • By default the virt-install command will continue to wait for the installation to complete after creating the VM
  • If you wish to detach from the virt-install session then you can use —noautoconsole
  • If your command requested a multistep install, like —cdrom or —location , after the install phase is complete the VM will be shutoff, regardless of whether a reboot was requested in the VM.
  • If you want the VM to be rebooted, virt-install must remain running.
  • You can use ‘ —wait ‘ to keep virt-install alive even if —noautoconsole is specified.
Читайте также:  Не могу настроить дек

As expected the command exited after creating the VM. Next connect to the console using virsh

10. virt-install —graphics with virt-viewer

  • In the earlier virt-install examples we disabled graphics which is why the end result was not very user friendly
  • In this command we will use virt-viewer to view the console after creating the VM
  • You can install virt-viewer using yum -y install virt-viewer on RHEL/CentOS 7/8 Linux
  • I have defined —graphics to use VNC to perform installation
  • At the end of this command execution, virt-viewer will automatically connect to the new VM’s console
  • This is the recommended command for most use cases to create KVM Virtual Machine using virt-install

Next virt-viewer will automatically connect to the centos8-2 console

11. virt-install —graphics with VNC Viewer

  • Similar to virt-viewer you can also connect to your new VM using VNC Viewer
  • In this virt-install example cheat sheet I have executed virt-install from CLI in one terminal with —noautoconsole to detach the session
  • Next I will connect to the VM console using VNC viewer

To get the VNC port number VNC is listening on use virsh command

Install tigervnc on your Linux server

Next execute vncviewer to connect to the console

12. virt-install —disk (path, size, format)

  • In all the above virt-install examples we were using default storage path and disk size to create KVM Virtual Machine
  • To define custom path to store the disks use —disk argument
  • To define disk size of your VM use » size » with —disk argument. The provided value will be considered in GB
  • You can use ‘ raw ‘, ‘ qcow2 ‘, ‘ vmdk ‘ as supported disk formats
  • In this virt-install example command, the 20GB disk for the VM will be created under /disks as centos8-2.qcow2

13. virt-install —autostart

By default the VMs are configured to stay powered off when the host server reboots
You can use —autostart to also start the VM when the host server comes up after reboot

14. virt-install example with multiple disks

  • In the earlier virt-install example we used single disk to create KVM Virtual Machine
  • You can also define multiple disks with virt-install using —disk argument multiple times
  • In this virt-install example I am creating KVM Virtual Machine with 2 disks with a custom path under /disks

Verify the list of disks assigned to this VM

15. virt-install —pxe and —boot network

  • Create VM using virt-install command to perform installation using PXE
  • So if you have a working PXE server then just use —pxe with virt-install
  • If you also define —location with —pxe , then virt-install will get the initrd and vmlinuz file from the provided —location of the ISO
  • To also specific kickstart file along with PXE use —extra-args=

Alternatively you can also use » —boot network » to boot from PXE server

Читайте также:  Не работает правый дворник ваз 2110

Lastly I hope this article with virt-install examples cheat sheet to create KVM Virtual Machine on Linux was helpful. So, let me know your suggestions and feedback using the comment section.

Didn’t find what you were looking for? Perform a quick search across GoLinuxCloud

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

For any other feedbacks or questions you can either use the comments section or contact me form.

Thank You for your support!!

3 thoughts on “15 virt-install examples | KVM virtualization commands cheatsheet”

Hello. Thanks for this writeup. I had one question about the –console option. How do I generate the following in the xml file that defines the VM:

I am not aware of any tool which can generate such xml file but you may use the xml from any existing VM and use that to create new VM

Very good article indeed to be used as reference!
Minor remark, the use of below as an adjective is a bit heavy while readin, much better if used as an adverb, like the virt-X examples below.

Источник

LOR помоги разобраться с kvm

Пытаюсь создать машину гостя на debian 8 Jessie.

  • Что я делаю не так? LOR, помоги.
  • Как добавить дистрибутив в директорию?
  • Скиньте хороший мануал.

Используй virt-manager если не способен разобраться в документации

Надо из под консоли без графического интерфейса запустить и разобраться.

Читай документацию. И первый вопрос: зачем sudo ?

Давай конкретней, без «пользуйся гуглом» и «кури маны». Это я и без тебя знаю, но мне это не помогает. Sudo что бы от рута команду выполнить.

If the special value ‘list’ is passed, virt-install will print the full list of variant values and exit. The printed format is not a stable interface, DO NOT PARSE IT .
Use ‘—os-variant list’ to see the full OS list

Sudo что бы от рута команду выполнить.

wow! не может быть!

Намекну: sudo не нужен в данном случае.

Это на сегодняшний день «The printed format is not a stable interface»? Не старьё?

Скинь мануал или документацию, пожалуйста. Что-нибудь хорошее. Если есть. А то в первый раз ставлю, видимо не то читаю.

Это на сегодняшний день «The printed format is not a stable interface»? Не старьё?

не старье, пока libosinfo не допилят до вменяемого состояния, и не зацепятся за нее, вместо собственных hardcoded ключевых слов

Скинь мануал или документацию, пожалуйста. Что-нибудь хорошее. Если есть. А то в первый раз ставлю, видимо не то читаю.

дык это из онлайн мана virt-install. я им вообще не пользуюсь сам, мне проще написать domxml и сделать virsh define

Я на форуме видел у тебя комментарии по виртуалкам. Подскажи как что-нибудь хорошее настроить и с чего начать? Я Xen пробовал, у меня hvm не вщлетела, только pvm. В kvm тоже что-то не вкуриваю. Всё равно мне что-ни надо научиться настраивать полноценное. В общем + в карму за любые полезные советы.

выбери технологию, возьми учебник или CBT и вперед. или найди себе работу где есть конкретные задачи, и приходи уже с конкретными задачами сюда.

Большое спасибо, обязательно прочту. Хоть теперь знаю, в каком направлении двигаться, надеюсь, что разбирусь. У меня на самом деле ведь конкретная проблема:

Источник

Оцените статью