Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previaÚltima revisiónAmbos lados, revisión siguiente |
es:howtos:general_admin:kvm_libvirt [2019/02/09 00:33 (UTC)] – slackwarespanol | es:howtos:general_admin:kvm_libvirt [2019/02/09 00:55 (UTC)] – [Sources] slackwarespanol |
---|
<note>Nota del Autor. Trabajo en progreso</note> | <note>Nota del Autor. Trabajo en progreso</note> |
| |
===== Advanced topics ===== | ===== Temas avanzados ===== |
| |
==== Mount qcow image using nbd ==== | ==== Monte la imagen qcow usando nbd ==== |
Raw disk images can be mounted outside the virtual machine using a loopback device. To mount other image types like qcow, the ''qemu-nbd'' command can be used, which comes with qemu-kvm. It relies on the nbd (network block device) kernel module. | Las imágenes de disco sin procesar se pueden montar fuera de la máquina virtual mediante un dispositivo de bucle invertido. Para montar otros tipos de imágenes como qcow, se puede usar el comando '' qemu-nbd '', que viene con qemu-kvm. Se basa en el módulo del núcleo nbd (dispositivo de bloqueo de red). |
| |
Start by loading the kernel module. The only parameter is the maximum partitions to be accessed. If this parameter is omitted, the default value is 0, which means no partitions will be mapped. | Comience cargando el módulo del kernel. El único parámetro es el número máximo de particiones a las que se puede acceder. Si se omite este parámetro, el valor predeterminado es 0, lo que significa que no se asignarán particiones. |
<code> | <code> |
# modprobe nbd max_part=8 | # modprobe nbd max_part=8 |
</code> | </code> |
This will create various new devices ''/dev/nbdxx''. Now the disk image can be connected to one of them: | Esto creará varios dispositivos nuevos '' /dev/nbdxx ''. Ahora la imagen del disco se puede conectar a uno de ellos: |
<code> | <code> |
# qemu-nbd -c /dev/ndb0 slackware.img | # qemu-nbd -c /dev/ndb0 slackware.img |
</code> | </code> |
This will create additional devices ''/dev/nbd0pxx'' for the partitions on the disk. Partitions are numbered sequentially starting with 1. You can use the nbd0 device to access the whole disk, or the nbd0pxx devices to access the partitions: | Esto creará dispositivos adicionales '' /dev/nbd0pxx '' para las particiones en el disco. Las particiones se numeran secuencialmente comenzando con 1. Puede usar el dispositivo nbd0 para acceder a todo el disco, o los dispositivos nbd0pxx para acceder a las particiones: |
<code> | <code> |
# fdisk /dev/nbd0 | # fdisk /dev/nbd0 |
# mount /dev/nbd0p1 /mnt/hd | # mount /dev/nbd0p1 /mnt/hd |
</code> | </code> |
<note important>Make sure the virtual machine is not running when you mount the disk image. Mounting the disk of a running machine will damage it.</note> | <note important>Asegúrese de que la máquina virtual no se esté ejecutando cuando monte la imagen de disco. Montar el disco de una máquina en marcha lo dañará.</note> |
To remove the connection: | Para eliminar la conexión: |
<code> | <code> |
# qemu-nbd -d /dev/nbd0 | # qemu-nbd -d /dev/nbd0 |
</code> | </code> |
| |
==== Setup PXE boot in libvirt ==== | ==== Configurar el arranque PXE en libvirt ==== |
To enable PXE booting for the guest machines, a PXE boot server and a TFTP server are needed. Libvirt can be configured to handle both internally. These configuration options are not available in virt-manager, so virsh must be used to set this up. | Para habilitar el arranque PXE para las máquinas invitadas, se necesitan un servidor de arranque PXE y un servidor TFTP. Libvirt se puede configurar para manejar tanto internamente. Estas opciones de configuración no están disponibles en virt-manager, por lo que se debe usar virsh para configurar esto. |
| |
- Create a directory ''/tftpboot'' and fill with the required files for the tftp boot service. See the article [[http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:pxe|PXE: Installing Slackware over the network]] by AlienBOB for more details. | - Cree un directorio '' /tftpboot '' y rellénelo con los archivos necesarios para el servicio de arranque tftp. Consulte el artículo [[http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:pxe|PXE: Instalación de Slackware en la red]] por AlienBOB para obtener más detalles. |
- Stop the default network and edit the network definition: <code> | - Detenga la red predeterminada y edite la definición de red: <code> |
# virsh net-destroy default | # virsh net-destroy default |
# virsh net-edit default | # virsh net-edit default |
</code> | </code> |
- This will open the network configuration in a vi session. Add the //tftp// and //bootp// parameters in the //ip// section and save the file: <code> | - Esto abrirá la configuración de red en una sesión vi. Agregue los parámetros // tftp // y // bootp // en la sección // ip // y guarde el archivo: <code> |
<ip address='192.168.122.1' netmask='255.255.255.0'> | <ip address='192.168.122.1' netmask='255.255.255.0'> |
<tftp root='/tftpboot' /> | <tftp root='/tftpboot' /> |
</ip> | </ip> |
</code> | </code> |
- Now restart the network: <code> | - Ahora reinicie la red: <code> |
# virsh net-start default | # virsh net-start default |
</code> | </code> |
| Ahora el servidor DHCP libvirt permitirá a los invitados arrancar con PXE. |
Now the libvirt DHCP server will allow guests to PXE boot. | |
===== Troubleshooting ===== | ===== Troubleshooting ===== |
| |
==== Remove password prompt in virt-manager ==== | ==== Eliminar solicitud de contraseña en virt-manager ==== |
When you start virt-manager as a regular user, you may still be asked for the root password, even when you have setup the correct unix socket permissions (notification: "system policy prevents management of local virtualized systems"). This is because older versions of libvirt were using PolicyKit by default. Disable the use of PolicyKit by editing ''/etc/libvirt/libvirtd.conf''. Uncomment the following options and change them to ''none'' : | Cuando inicie virt-manager como un usuario regular, es posible que se le solicite la contraseña de root, incluso cuando haya configurado los permisos de socket de Unix correctos (notificación: "la política del sistema impide la administración de sistemas virtualizados locales"). Esto se debe a que las versiones anteriores de libvirt usaban PolicyKit de forma predeterminada. Desactive el uso de PolicyKit editando '' /etc/libvirt/libvirtd.conf ''. Descomente las siguientes opciones y cámbielas a '' ninguna '': |
<code> | <code> |
auth_unix_ro = "none" | auth_unix_ro = "none" |
auth_unix_rw = "none" | auth_unix_rw = "none" |
</code> | </code> |
==== Improve mouse movement ==== | ==== Mejorar el movimiento del ratón ==== |
In graphics mode, the mouse movement can be erratic and difficult to change in the settings of your VM. To solve this, add a virtual tablet. | En el modo gráfico, el movimiento del mouse puede ser errático y difícil de cambiar en la configuración de su VM. Para resolver esto, agregue una tableta virtual. |
| |
In //virt-manager//, open the VM by double-clicking on the machine and select the hardware info screen (the blue <key>''i''</key> button). Now, press <key>+ Add Hardware</key> and select //Input//. Select Type //EvTouch USB Graphics Tablet// and press <key>Finish</key>. The next time the VM is started, the mouse movement is synchronized with your desktop cursor. | |
| |
==== Change screen resolution to higher than 1024x768 ==== | En // virt-manager //, abra la máquina virtual haciendo doble clic en la máquina y seleccione la pantalla de información del hardware (el botón azul <key> '' i '' </key>). Ahora, presione <key> + Add Hardware </key> y seleccione // Input //. Seleccione Type // EvTouch USB Graphics Tablet // y presione <key> Finish </key>. La próxima vez que se inicie la máquina virtual, el movimiento del mouse se sincronizará con el cursor del escritorio. |
The default emulated video card is of type Cirrus. This has a maximum resolution of 1024x768. The //vga// type can achieve a higher resolution, but for that to work, the X configuration in the guest OS needs to be changed as well. | ==== Cambiar la resolución de la pantalla a más de 1024x768 ==== |
| La tarjeta de video emulada predeterminada es de tipo Cirrus. Esto tiene una resolución máxima de 1024x768. El tipo // vga // puede lograr una resolución más alta, pero para que funcione, la configuración de X en el sistema operativo invitado también debe cambiarse. |
| |
To change this, open the VM and select the hardware info screen. Select the Video card and change the type to //vga//. | Para cambiar esto, abra la máquina virtual y seleccione la pantalla de información de hardware. Seleccione la tarjeta de video y cambie el tipo a // vga //. |
| |
Start the VM. If a file ''/etc/X11/xorg.conf'' exists, change that. Otherwise create a new text file in ''/etc/X11/xorg.conf.d'' with extension ''conf'', for example ''/etc/X11/xorg.conf.d/monitor.conf''. | Iniciar la máquina virtual. Si existe un archivo '' /etc/X11/xorg.conf '', cámbielo. De lo contrario, cree un nuevo archivo de texto en '' /etc/X11/xorg.conf.d '' con la extensión '' conf '', por ejemplo '' /etc/X11/xorg.conf.d/monitor.conf ''. |
| |
Add or change the following sections: | Agrega o cambia las siguientes secciones: |
<code> | <code> |
Section "Monitor" | Section "Monitor" |
EndSection | EndSection |
</code> | </code> |
You can change the screen resolution (the //Modes// line) depending on your needs. | Puede cambiar la resolución de la pantalla (la línea // Modes //) según sus necesidades. |
| |
===== Resources ===== | ===== Recursos ===== |
| |
* Official pages for [[http://libvirt.org|libvirt]], [[http://virt-manager.org|virt-manager]], [[http://wiki.qemu.org/Index.html|QEMU]], [[http://www.linux-kvm.org/page/Main_Page|KVM]]. | * Páginas oficiales de [[http://libvirt.org|libvirt]], [[http://virt-manager.org|virt-manager]], [[http://wiki.qemu.org/Index.html|QEMU]], [[http://www.linux-kvm.org/page/Main_Page|KVM]]. |
* Red Hat [[https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/index.html|Virtualization Administration Guide]]. | * Red Hat [[https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/index.html|Guía de administración de virtualización]]. |
| |
===== Sources ===== | ===== Sources ===== |
<!-- * Originally written by [[wiki:user:xxx | User X]] --> | <!-- * Originally written by [[wiki:user:xxx | User X]] --> |
<!-- * Contributions by [[wiki:user:yyy | User Y]] --> | <!-- * Contributions by [[wiki:user:yyy | User Y]] --> |
* This page originally written by [[wiki:user:fdonkers|Frank Donkers]] | * Esta página escrita originalmente por [[wiki:user:fdonkers|Frank Donkers]] |
| * Traducido por: [[wiki:user: slackwarespanol | Victor]] 2019/02/09 00:53 (UTC) |
| |
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> |
<!-- You must remove the tag-word "template" below before saving your new page --> | <!-- You must remove the tag-word "template" below before saving your new page --> |
{{tag>howtos kvm libvirt virtualization virt-manager qemu author_fdonkers}} | {{tag>howtos kvm libvirt virtualization virt-manager qemu author_fdonkers}} |